:root {
      --bg: #07111f;
      --panel: #0b1728;
      --panel-2: #0e1d31;
      --line: #22334b;
      --text: #eef5ff;
      --muted: #91a4bb;
      --soft: #5f738d;
      --feedback: #f973a9;
      --context: #2dd4bf;
      --memory: #8b9cff;
      --skills: #f6b84a;
      --workflow: #a78bfa;
      --harness: #38bdf8;
      --loops: #fb7185;
      --code: #c084fc;
      --environment: #4ade80;
      --evaluation: #facc15;
      --science: #fb923c;
      --trunk: #67e8f9;
      --peer: #4ade80;
      --preprint: #a78bfa;
      --industry: #fb923c;
      --survey: #facc15;
      --concept: #64748b;
    }

    * { box-sizing: border-box; }

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

    body {
      margin: 0;
      color: var(--text);
      background:
        radial-gradient(circle at 20% -10%, rgba(45, 212, 191, .12), transparent 31rem),
        radial-gradient(circle at 90% 10%, rgba(167, 139, 250, .10), transparent 33rem),
        var(--bg);
      font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    a { color: inherit; }

    .app {
      width: min(100%, 1900px);
      margin: 0 auto;
      padding: 24px;
    }

    .top {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 24px;
      align-items: end;
      margin-bottom: 18px;
    }

    .eyebrow {
      display: flex;
      align-items: center;
      gap: 9px;
      color: #71e2db;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: .14em;
      text-transform: uppercase;
    }

    .eyebrow::before {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #2dd4bf;
      box-shadow: 0 0 20px #2dd4bf;
      content: "";
    }

    h1 {
      max-width: 980px;
      margin: 8px 0 7px;
      font-size: clamp(27px, 4vw, 48px);
      line-height: 1.03;
      letter-spacing: -.045em;
    }

    .dek {
      max-width: 990px;
      margin: 0;
      color: var(--muted);
      font-size: 14px;
    }

    .report-link {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-height: 42px;
      padding: 0 15px;
      border: 1px solid #31506e;
      border-radius: 10px;
      background: rgba(14, 29, 49, .82);
      color: #d9f9ff;
      font-weight: 750;
      text-decoration: none;
      white-space: nowrap;
    }

    .report-link:hover { border-color: #4a789e; background: #11243b; }

    .stats {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
      margin-bottom: 12px;
    }

    .stat {
      min-height: 68px;
      padding: 11px 14px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: rgba(11, 23, 40, .76);
    }

    .stat b { display: block; font-size: 22px; letter-spacing: -.03em; }
    .stat span { color: var(--muted); font-size: 11px; }

    .view-switch {
      display: inline-grid;
      grid-template-columns: 1fr 1fr;
      gap: 4px;
      margin-bottom: 12px;
      padding: 4px;
      border: 1px solid var(--line);
      border-radius: 11px;
      background: rgba(11, 23, 40, .82);
    }

    .view-switch button {
      display: grid;
      min-width: 230px;
      min-height: 48px;
      padding: 6px 13px;
      border-color: transparent;
      background: transparent;
      color: #8195ad;
      cursor: pointer;
      text-align: left;
    }

    .view-switch button b {
      color: #b8cadc;
      font-size: 12px;
    }

    .view-switch button span {
      font-size: 10px;
    }

    .view-switch button.active {
      border-color: #345473;
      background: #102239;
      color: #9eb4ca;
      box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
    }

    .view-switch button.active b { color: #ecf7ff; }

    .controls {
      display: grid;
      grid-template-columns: minmax(220px, 1fr) 190px 180px auto;
      gap: 9px;
      margin-bottom: 12px;
      padding: 10px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: rgba(11, 23, 40, .82);
    }

    input, select, button {
      min-height: 38px;
      border: 1px solid #29405a;
      border-radius: 8px;
      outline: none;
      background: #0a1525;
      color: var(--text);
      font: inherit;
    }

    input, select { width: 100%; padding: 0 11px; }
    input:focus, select:focus, button:focus-visible { border-color: #49cfc7; box-shadow: 0 0 0 3px rgba(45, 212, 191, .12); }

    .zoom {
      display: flex;
      gap: 6px;
    }

    .zoom button {
      min-width: 38px;
      padding: 0 11px;
      cursor: pointer;
      font-weight: 760;
    }

    .zoom .fit { min-width: 70px; }
    .zoom .spacing { min-width: 92px; color: #9ceee9; }
    .zoom .spacing[aria-pressed="true"] {
      border-color: #379e99;
      background: rgba(45, 212, 191, .10);
      color: #d9fffc;
    }
    .zoom button:hover { background: #13263d; }

    .workspace {
      display: grid;
      grid-template-columns: 280px minmax(0, 1fr);
      min-height: 760px;
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 15px;
      background: rgba(7, 17, 31, .92);
      box-shadow: 0 26px 80px rgba(0, 0, 0, .28);
    }

    .sidebar {
      position: relative;
      z-index: 3;
      padding: 17px;
      border-right: 1px solid var(--line);
      background: linear-gradient(180deg, rgba(14, 29, 49, .98), rgba(8, 19, 34, .98));
    }

    .sidebar h2 {
      margin: 0 0 5px;
      font-size: 14px;
      letter-spacing: -.01em;
    }

    .sidebar p {
      margin: 0 0 12px;
      color: var(--muted);
      font-size: 12px;
    }

    .selected {
      min-height: 210px;
      margin: 14px 0 17px;
      padding: 14px;
      border: 1px solid #2a415b;
      border-radius: 11px;
      background: rgba(6, 15, 27, .66);
    }

    .selected .selected-branch {
      color: #69ddd5;
      font-size: 10px;
      font-weight: 850;
      letter-spacing: .11em;
      text-transform: uppercase;
    }

    .selected h3 {
      margin: 7px 0 7px;
      font-size: 16px;
      line-height: 1.23;
    }

    .selected .meta {
      color: #aec0d3;
      font-size: 11px;
    }

    .selected .note {
      margin-top: 11px;
      color: var(--muted);
      font-size: 12px;
    }

    .selected a {
      display: inline-flex;
      margin-top: 11px;
      color: #8deae4;
      font-size: 12px;
      font-weight: 760;
      text-decoration: none;
    }

    .legend-title {
      margin: 16px 0 7px;
      color: #c8d8e8;
      font-size: 10px;
      font-weight: 850;
      letter-spacing: .12em;
      text-transform: uppercase;
    }

    .legend {
      display: grid;
      gap: 6px;
    }

    .legend-row {
      display: flex;
      align-items: center;
      gap: 8px;
      color: var(--muted);
      font-size: 11px;
    }

    .dot {
      width: 8px;
      height: 8px;
      flex: none;
      border-radius: 50%;
      background: var(--concept);
    }

    .dot.peer { background: var(--peer); }
    .dot.preprint { background: var(--preprint); }
    .dot.industry { background: var(--industry); }
    .dot.survey { background: var(--survey); }
    .dot.concept { background: var(--concept); }

    .branch-jump {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 5px;
    }

    .branch-filter-note {
      margin: -3px 0 8px;
      color: #71879f;
      font-size: 9px;
    }

    .branch-jump button {
      min-height: 30px;
      padding: 4px 7px;
      cursor: pointer;
      color: #a9bdd1;
      font-size: 10px;
      text-align: left;
    }

    .branch-jump button:hover { background: #11243b; color: #fff; }
    .branch-jump button.all-branches { grid-column: 1 / -1; }
    .branch-jump button.active {
      border-color: var(--branch-button-color, #4b718f);
      background: color-mix(in srgb, var(--branch-button-color, #4b718f) 15%, #0a1525);
      color: #f3fbff;
      box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--branch-button-color, #4b718f) 35%, transparent);
    }

    .viewport {
      position: relative;
      height: 820px;
      overflow: auto;
      background:
        linear-gradient(rgba(33, 51, 74, .18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(33, 51, 74, .18) 1px, transparent 1px);
      background-size: 32px 32px;
      cursor: grab;
      scrollbar-color: #314866 #0a1423;
    }

    .viewport.dragging { cursor: grabbing; user-select: none; }

    .world { position: relative; width: 3200px; height: 2380px; }

    .stage {
      position: absolute;
      inset: 0 auto auto 0;
      width: 3200px;
      height: 2380px;
      transform-origin: 0 0;
    }

    .era {
      display: none;
    }

    .era span {
      position: sticky;
      top: 10px;
      display: inline-block;
      margin: 12px 0 0 11px;
      padding: 4px 8px;
      border: 1px solid #273e58;
      border-radius: 999px;
      background: rgba(8, 19, 34, .9);
      color: #71879f;
      font-size: 10px;
      font-weight: 800;
      letter-spacing: .08em;
    }

    .lane {
      position: absolute;
      left: 760px;
      width: 2360px;
      height: 1px;
      border-top: 1px solid rgba(84, 110, 139, .17);
      pointer-events: none;
    }

    .lane span {
      position: absolute;
      left: -175px;
      top: -12px;
      width: 160px;
      color: var(--lane-color);
      font-size: 10px;
      font-weight: 850;
      letter-spacing: .09em;
      text-align: right;
      text-transform: uppercase;
    }

    .stage.filtered-layout .era,
    .stage.filtered-layout .lane {
      display: none;
    }

    #edges {
      position: absolute;
      inset: 0;
      width: 3200px;
      height: 2380px;
      overflow: visible;
      pointer-events: none;
    }

    .edge {
      fill: none;
      stroke: #3c536d;
      stroke-width: 1.6;
      opacity: .56;
      vector-effect: non-scaling-stroke;
    }

    .edge.cross {
      stroke-dasharray: 5 6;
      opacity: .34;
    }

    .edge.category-fan {
      stroke-width: 1.9;
      opacity: .76;
    }

    .edge.category-link {
      stroke-width: 2;
      opacity: .84;
    }

    .edge.cross.routed { opacity: .48; }
    .edge.cross.backlink {
      stroke-dasharray: 3 5;
      opacity: .62;
    }

    .edge.dimmed { opacity: .035; }
    .edge.filtered-out { visibility: hidden; opacity: 0; }
    .edge.filtered-edge {
      stroke-width: 2.3;
      opacity: .88;
    }

    .viewport.tracing-relations .edge:not(.trace-edge) { opacity: .025; }
    .viewport.tracing-relations .edge.trace-edge:not(.dimmed) {
      stroke-width: 2.8;
      opacity: 1;
    }
    .viewport.tracing-relations .node:not(.trace-node) { opacity: .12; }
    .viewport.tracing-relations .node.trace-node {
      z-index: 4;
      box-shadow: 0 0 0 2px color-mix(in srgb, var(--branch-color) 36%, transparent), 0 10px 28px rgba(0, 0, 0, .30);
    }
    .viewport.relation-focus.tracing-relations .edge:not(.trace-edge) { opacity: .14; }
    .viewport.relation-focus.tracing-relations .node:not(.trace-node) { opacity: .32; }

    .node {
      position: absolute;
      width: 208px;
      min-height: 72px;
      overflow: hidden;
      padding: 10px 11px 9px 14px;
      border: 1px solid color-mix(in srgb, var(--branch-color) 74%, #21324a);
      border-radius: 10px;
      background:
        linear-gradient(120deg, color-mix(in srgb, var(--branch-color) 8%, transparent), transparent 58%),
        rgba(10, 22, 38, .97);
      box-shadow: 0 8px 24px rgba(0, 0, 0, .20);
      color: var(--text);
      cursor: pointer;
      transition: opacity .18s, transform .18s, border-color .18s, box-shadow .18s;
    }

    .node::before {
      position: absolute;
      inset: 0 auto 0 0;
      width: 3px;
      background: var(--branch-color);
      content: "";
    }

    .node:hover, .node.selected-node {
      z-index: 5;
      transform: translateY(-2px);
      border-color: var(--branch-color);
      box-shadow: 0 12px 30px rgba(0, 0, 0, .34), 0 0 0 2px color-mix(in srgb, var(--branch-color) 18%, transparent);
    }

    .node.category {
      width: 218px;
      min-height: 76px;
      background:
        radial-gradient(circle at 92% 10%, color-mix(in srgb, var(--branch-color) 23%, transparent), transparent 75px),
        #102037;
    }

    .node.trunk-node { width: 212px; min-height: 80px; }

    .node .topline {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 5px;
    }

    .node .year {
      color: var(--branch-color);
      font-size: 9px;
      font-weight: 850;
      letter-spacing: .09em;
      text-transform: uppercase;
    }

    .node .status-dot {
      width: 7px;
      height: 7px;
      flex: none;
      border-radius: 50%;
      background: var(--status-color);
      box-shadow: 0 0 10px color-mix(in srgb, var(--status-color) 70%, transparent);
    }

    .node strong {
      display: -webkit-box;
      overflow: hidden;
      color: #f4f8fd;
      font-size: 12px;
      line-height: 1.21;
      letter-spacing: -.008em;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
    }

    .node small {
      display: block;
      overflow: hidden;
      margin-top: 5px;
      color: #8195ad;
      font-size: 9.5px;
      line-height: 1.25;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .node.muted-node { opacity: .075; pointer-events: none; }
    .node.match-node { box-shadow: 0 0 0 3px rgba(250, 204, 21, .35), 0 10px 28px rgba(0, 0, 0, .28); }
    .node.filtered-out { visibility: hidden; opacity: 0; pointer-events: none; }
    .node.filtered-node {
      box-shadow: 0 0 0 2px color-mix(in srgb, var(--branch-color) 24%, transparent), 0 10px 28px rgba(0, 0, 0, .24);
    }

    .era-view {
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 15px;
      background:
        radial-gradient(circle at 8% 0%, rgba(103, 232, 249, .08), transparent 26rem),
        radial-gradient(circle at 94% 0%, rgba(192, 132, 252, .08), transparent 30rem),
        rgba(7, 17, 31, .92);
      box-shadow: 0 26px 80px rgba(0, 0, 0, .28);
    }

    .era-view[hidden],
    .workspace[hidden],
    .controls[hidden],
    .caption[hidden] { display: none !important; }

    .era-intro {
      display: grid;
      grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr);
      gap: 30px;
      padding: 23px 24px 20px;
      border-bottom: 1px solid var(--line);
      background: rgba(12, 27, 46, .64);
    }

    .era-intro .era-eyebrow {
      color: #7ce2dc;
      font-size: 10px;
      font-weight: 850;
      letter-spacing: .13em;
      text-transform: uppercase;
    }

    .era-intro h2 {
      max-width: 850px;
      margin: 6px 0 7px;
      font-size: clamp(20px, 3vw, 31px);
      line-height: 1.08;
      letter-spacing: -.035em;
    }

    .era-intro p {
      max-width: 850px;
      margin: 0;
      color: var(--muted);
      font-size: 12px;
    }

    .era-reading-key {
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 7px 12px;
      align-content: center;
      padding: 12px 14px;
      border: 1px solid #2a415b;
      border-radius: 11px;
      background: rgba(6, 15, 27, .52);
      color: #91a4bb;
      font-size: 10px;
    }

    .era-reading-key b {
      color: #dce9f5;
      font-size: 10px;
      letter-spacing: .06em;
      text-transform: uppercase;
    }

    .attention-ribbon {
      display: grid;
      grid-template-columns: repeat(5, minmax(220px, 1fr));
      min-width: 1180px;
      padding: 0 0 14px;
    }

    .attention-step {
      position: relative;
      min-height: 58px;
      padding: 8px 30px 8px 12px;
      border-top: 2px solid var(--era-color);
      background: linear-gradient(180deg, color-mix(in srgb, var(--era-color) 9%, transparent), transparent);
    }

    .attention-step:not(:last-child)::after {
      position: absolute;
      top: -7px;
      right: 7px;
      color: #526a82;
      font-size: 18px;
      content: "→";
    }

    .attention-step small {
      display: block;
      color: #688098;
      font-size: 8px;
      font-weight: 800;
      letter-spacing: .11em;
      text-transform: uppercase;
    }

    .attention-step b {
      display: block;
      margin-top: 3px;
      color: #dce8f4;
      font-size: 11px;
      line-height: 1.25;
    }

    .era-scroll {
      overflow-x: auto;
      padding: 18px 22px 23px;
      scrollbar-color: #314866 #0a1423;
    }

    .era-flow {
      display: grid;
      grid-template-columns: repeat(5, minmax(220px, 1fr));
      gap: 12px;
      min-width: 1180px;
    }

    .era-card {
      position: relative;
      display: flex;
      min-height: 550px;
      flex-direction: column;
      overflow: hidden;
      padding: 16px;
      border: 1px solid color-mix(in srgb, var(--era-color) 42%, #263b54);
      border-radius: 12px;
      background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--era-color) 16%, transparent), transparent 130px),
        linear-gradient(180deg, rgba(14, 30, 51, .95), rgba(8, 19, 34, .96));
    }

    .era-card::before {
      position: absolute;
      inset: 0 0 auto;
      height: 3px;
      background: var(--era-color);
      content: "";
    }

    .era-card-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 10px;
    }

    .era-number {
      color: color-mix(in srgb, var(--era-color) 76%, white);
      font-size: 10px;
      font-weight: 900;
      letter-spacing: .12em;
    }

    .era-years {
      padding: 3px 7px;
      border: 1px solid color-mix(in srgb, var(--era-color) 45%, #31435a);
      border-radius: 999px;
      color: color-mix(in srgb, var(--era-color) 78%, white);
      font-size: 9px;
      font-weight: 850;
    }

    .era-card h3 {
      margin: 0;
      font-size: 18px;
      line-height: 1.12;
      letter-spacing: -.025em;
    }

    .era-question {
      min-height: 68px;
      margin: 8px 0 15px;
      color: #aabed2;
      font-size: 12px;
      font-weight: 650;
      line-height: 1.45;
    }

    .era-label {
      margin: 12px 0 6px;
      color: #61788f;
      font-size: 8px;
      font-weight: 900;
      letter-spacing: .13em;
      text-transform: uppercase;
    }

    .era-focus {
      padding: 10px 11px;
      border-left: 3px solid var(--era-color);
      border-radius: 3px 8px 8px 3px;
      background: color-mix(in srgb, var(--era-color) 8%, #0a1525);
      color: #e5eff8;
      font-size: 12px;
      font-weight: 780;
      line-height: 1.35;
    }

    .era-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
    }

    .era-chip {
      padding: 4px 7px;
      border: 1px solid #293f58;
      border-radius: 999px;
      color: #93a8bd;
      font-size: 9px;
      white-space: nowrap;
    }

    .surface-path {
      display: flex;
      align-items: center;
      gap: 6px;
      color: #b8c8d8;
      font-size: 10px;
      font-weight: 720;
    }

    .surface-path span {
      color: var(--era-color);
      font-size: 12px;
    }

    .era-links {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
    }

    .era-links a {
      padding: 4px 7px;
      border: 1px solid #2b435d;
      border-radius: 6px;
      background: rgba(6, 15, 27, .46);
      color: #a9deda;
      font-size: 9px;
      font-weight: 720;
      text-decoration: none;
    }

    .era-links a:hover {
      border-color: var(--era-color);
      color: #fff;
    }

    .era-bottleneck {
      margin-top: auto;
      padding: 11px;
      border: 1px solid rgba(251, 113, 133, .24);
      border-radius: 9px;
      background: rgba(81, 19, 38, .16);
      color: #9eafc0;
      font-size: 10px;
      line-height: 1.4;
    }

    .era-bottleneck b {
      display: block;
      margin-bottom: 3px;
      color: #fb9eb1;
      font-size: 8px;
      letter-spacing: .12em;
      text-transform: uppercase;
    }

    .era-takeaway {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      padding: 0 22px 22px;
    }

    .era-takeaway article {
      padding: 15px 16px;
      border: 1px solid var(--line);
      border-radius: 11px;
      background: rgba(8, 19, 34, .68);
    }

    .era-takeaway h3 {
      margin: 0 0 5px;
      font-size: 12px;
    }

    .era-takeaway p {
      margin: 0;
      color: var(--muted);
      font-size: 11px;
    }

    .caption {
      display: grid;
      grid-template-columns: 1.4fr 1fr 1fr;
      gap: 11px;
      margin-top: 12px;
    }

    .caption article {
      padding: 14px 15px;
      border: 1px solid var(--line);
      border-radius: 11px;
      background: rgba(11, 23, 40, .72);
    }

    .caption h3 { margin: 0 0 5px; font-size: 12px; }
    .caption p { margin: 0; color: var(--muted); font-size: 11px; }

    .footer {
      margin-top: 12px;
      color: #61748a;
      font-size: 10px;
      text-align: center;
    }

    @media (max-width: 980px) {
      .top { grid-template-columns: 1fr; }
      .report-link { justify-self: start; }
      .stats { grid-template-columns: 1fr 1fr; }
      .view-switch { display: grid; }
      .controls { grid-template-columns: 1fr 1fr; }
      .workspace { grid-template-columns: 1fr; }
      .sidebar { display: none; }
      .era-intro { grid-template-columns: 1fr; }
      .caption { grid-template-columns: 1fr; }
    }

    @media (max-width: 620px) {
      .app { padding: 14px; }
      .view-switch { width: 100%; }
      .view-switch button { min-width: 0; }
      .controls { grid-template-columns: 1fr; }
      .viewport { height: 680px; }
      .era-takeaway { grid-template-columns: 1fr; }
    }

    @media print {
      body { background: white; }
      .app { width: 100%; padding: 0; }
      .view-switch, .controls, .sidebar, .caption, .footer, .report-link { display: none; }
      .workspace { display: block; border: 0; }
      .viewport { height: auto; overflow: visible; background: #07111f; }
      .world { width: 1600px !important; height: 1190px !important; }
      .stage { transform: scale(.5) !important; }
    }
