/* ---------- buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--raise); color: var(--text); font-weight: 500; transition: background .18s, border-color .18s, transform .18s var(--ease); white-space: nowrap; }
.btn:hover { background: rgba(255,255,255,.06); border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.icon { width: 38px; padding: 0; } .btn.sq { width: 40px; height: 40px; }
.btn.primary { background: linear-gradient(180deg, #4d86ee, #3a67c7); border-color: rgba(140,180,255,.5); color: #fff; }
.btn.primary:hover { background: linear-gradient(180deg, #5b92f5, #4373d6); }
.btn.approve { background: rgba(69,217,160,.12); border-color: rgba(69,217,160,.45); color: #9cf0cf; }
.btn.approve:hover { background: rgba(69,217,160,.2); }
.btn.reject { background: rgba(255,122,147,.08); border-color: rgba(255,122,147,.4); color: #ffb0bf; }
.btn.reject:hover { background: rgba(255,122,147,.16); }
.btn.ghost { background: transparent; }
.panel-close, .inspect-fab { display: none; }
.linkbtn { background: none; border: 0; color: var(--accent); padding: 2px 0; font-size: 12.5px; }
.linkbtn:disabled { color: var(--faint); cursor: default; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; line-height: 1.6; border: 1px solid var(--line-2); color: #b7c1da; background: rgba(255,255,255,.03); white-space: nowrap; }
.chip.approved, .chip.confirmed, .chip.verified { color: #8fecc6; border-color: rgba(69,217,160,.4); background: rgba(69,217,160,.08); }
.chip.inferred { color: #cdb9ff; border-color: rgba(166,139,255,.45); background: rgba(166,139,255,.09); }
.chip.rejected { color: #ffb0bf; border-color: rgba(255,122,147,.4); background: rgba(255,122,147,.07); }
.chip.deferred { color: #f0c27c; border-color: rgba(240,181,96,.4); }
.chip.kind { text-transform: capitalize; } .chip.count { margin-left: 8px; }
.chip.src { gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px; border-radius: 999px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; border: 1px solid var(--line-2); white-space: nowrap; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.run { color: #cdb9ff; border-color: rgba(166,139,255,.5); background: rgba(166,139,255,.12); } .pill.run i { animation: blink 1.1s ease-in-out infinite; }
.pill.ready { color: #f0c27c; border-color: rgba(240,181,96,.45); background: rgba(240,181,96,.08); }
.pill.done { color: #8fecc6; border-color: rgba(69,217,160,.4); background: rgba(69,217,160,.08); }
@keyframes blink { 50% { opacity: .25; } }
.card { border: 1px solid var(--line-2); border-radius: 14px; background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.015)); padding: 16px; }

/* ---------- atlas page ---------- */
.atlas-page { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.atlas-head { padding: 14px 20px 10px; align-items: center; display: grid; grid-template-columns: minmax(0, 1.15fr) auto minmax(0, .4fr); gap: 12px; }
.atlas-head .page-tools { justify-self: end; }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -.015em; line-height: 1.2; }
h1:focus { outline: none; }
.page-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.switcher { display: inline-flex; border: 1px solid var(--line-2); border-radius: 12px; padding: 3px; background: rgba(255,255,255,.025); gap: 2px; }
.switcher button { display: inline-flex; align-items: center; gap: 8px; padding: 0 15px; height: 34px; border: 1px solid transparent; background: none; border-radius: 9px; color: #b7c1da; transition: all .2s var(--ease); }
.switcher button:hover { color: #fff; background: rgba(255,255,255,.04); }
.switcher button[aria-pressed="true"] { color: #fff; border-color: rgba(240,181,96,.55); background: rgba(240,181,96,.09); box-shadow: 0 0 18px rgba(240,181,96,.12); }
.views { position: relative; min-height: 0; min-width: 0; display: grid; }
.view { min-height: 0; min-width: 0; overflow: auto; padding: 0 20px 20px; }
.view-graph { padding: 0; overflow: hidden; }
.view-in { animation: rise .38s var(--ease) both; }
.stage { position: relative; height: 100%; min-height: 280px; overflow: hidden; background: radial-gradient(60% 60% at 50% 50%, rgba(70,60,150,.14), transparent 70%); }
.atlas-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.atlas-canvas.grabbing { cursor: grabbing; }
.atlas-canvas:focus-visible { outline: 2px solid var(--focus); outline-offset: -3px; border-radius: 0; }
.legend { position: absolute; left: 16px; top: 8px; width: 168px; pointer-events: none; }
.legend h2 { font-size: 10.5px; letter-spacing: .16em; color: var(--muted); font-weight: 600; padding: 4px 0 8px 8px; }
.legend-list { display: grid; gap: 1px; pointer-events: auto; }
.legend-list li { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; border-radius: 8px; transition: background .18s; }
.legend-list li:hover { background: rgba(255,255,255,.05); }
.legend-list li.active { background: color-mix(in srgb, var(--dc) 16%, transparent); }
.legend-list li.off .lname, .legend-list li.off .lcount { opacity: .4; text-decoration: line-through; }
.ldot { display: grid; place-items: center; width: 22px; height: 28px; border: 0; background: none; padding: 0; }
.ldot i { width: 10px; height: 10px; border-radius: 50%; background: var(--dc); box-shadow: 0 0 8px var(--dc); transition: transform .2s; }
li.off .ldot i { background: transparent; border: 1.5px solid var(--dc); box-shadow: none; }
.ldot:hover i { transform: scale(1.3); }
.lname { background: none; border: 0; text-align: left; padding: 5px 4px; color: #d6dcf0; font-size: 13px; }
.lcount { font-size: 12.5px; color: var(--muted); padding-right: 8px; font-variant-numeric: tabular-nums; }
.sample-tag { position: absolute; top: 10px; right: 14px; font-size: 10px; letter-spacing: .14em; font-weight: 700; color: #f0c27c; border: 1px solid rgba(240,181,96,.4); background: rgba(240,181,96,.07); padding: 3px 9px; border-radius: 999px; pointer-events: none; }
.zoomctl { position: absolute; left: 16px; bottom: 14px; display: flex; gap: 8px; }
.zgroup { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; background: rgba(8,11,20,.8); }
.zgroup .btn { border: 0; background: none; width: 38px; min-height: 40px; }
.zoom-pct { min-width: 48px; text-align: center; font-size: 12.5px; color: #c3cbe2; font-variant-numeric: tabular-nums; }
.zoomctl > .btn { background: rgba(8,11,20,.8); }
.hint { position: absolute; right: 16px; bottom: 18px; display: flex; gap: 10px; align-items: center; font-size: 11.5px; color: var(--muted); pointer-events: none; }
.hint i { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.inspect-fab { position: absolute; right: 14px; bottom: 56px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.tooltip { position: absolute; left: var(--tx, 0); top: var(--ty, 0); z-index: 5; pointer-events: none; display: grid; gap: 2px; max-width: 220px; padding: 8px 11px; border-radius: 10px; background: rgba(10,13,26,.96); border: 1px solid color-mix(in srgb, var(--dc, #8aa) 55%, transparent); box-shadow: 0 8px 28px rgba(0,0,0,.5), 0 0 16px color-mix(in srgb, var(--dc, #8aa) 22%, transparent); font-size: 12px; }
.tooltip b { font-size: 12.5px; } .tooltip span { color: var(--muted); }

/* ---------- right panel ---------- */
.panel { grid-area: panel; border-left: 1px solid var(--line); background: rgba(10,14,25,.97); min-height: 0; min-width: 0; overflow: hidden; display: flex; }
.panel-inner { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.tabs { display: flex; align-items: center; gap: 2px; padding: 14px 18px 0; border-bottom: 1px solid var(--line); flex: none; }
.tab { background: none; border: 0; padding: 10px 16px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; transition: color .2s, border-color .2s; border-radius: 8px 8px 0 0; }
.tab:hover { color: #fff; }
.tab[aria-selected="true"] { color: #fff; border-bottom-color: var(--accent); background: linear-gradient(180deg, transparent, rgba(80,125,235,.12)); }
.panel-close { margin-left: auto; margin-bottom: 8px; }
.pane { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px 24px; display: block; scrollbar-width: thin; scrollbar-color: rgba(150,170,225,.25) transparent; }
.pane:focus-visible { outline-offset: -3px; }
.pane[hidden] { display: none !important; }
.swap > *, .swap { }
.swap > * { animation: rise .36s var(--ease) both; }
.swap > *:nth-child(2) { animation-delay: .04s; } .swap > *:nth-child(3) { animation-delay: .08s; } .swap > *:nth-child(4) { animation-delay: .12s; } .swap > *:nth-child(5) { animation-delay: .16s; } .swap > *:nth-child(n+6) { animation-delay: .2s; }
.searchbox { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--raise); color: var(--muted); margin-bottom: 18px; }
.searchbox:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(80,125,235,.14); }
.searchbox input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); }
.searchbox input::placeholder { color: var(--muted); }
.sec-label { display: flex; justify-content: space-between; align-items: center; font-size: 10.5px; letter-spacing: .16em; color: var(--muted); font-weight: 600; margin: 4px 0 10px; }
.sec-label .linkbtn { letter-spacing: 0; font-weight: 400; }
.frow { display: grid; grid-template-columns: 82px 1fr; gap: 6px; margin-bottom: 8px; align-items: stretch; }
.frow > span { display: flex; align-items: center; justify-content: space-between; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: #b7c1da; font-size: 13px; background: var(--raise); }
.frow select { height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 9px; background: #0e1424; color: var(--text); font-size: 13px; min-width: 0; }
.frow select:focus-visible { outline-offset: 1px; }
.toggles { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 8px; }
.toggle { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--raise); color: #b7c1da; font-size: 13px; }
.toggle .ico { opacity: 0; width: 0; transition: all .2s; }
.toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: #fff; }
.toggle[aria-pressed="true"] .ico { opacity: 1; width: 13px; }
.results { margin: 8px 0 4px; } .res-head { font-size: 12.5px; color: #c3cbe2; margin: 6px 0 8px; } .res-head b { color: #fff; }
.rows { display: grid; gap: 2px; }
.row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 4px 10px; border: 0; border-radius: 9px; background: none; text-align: left; transition: background .15s; }
.row:hover { background: rgba(255,255,255,.05); }
.row .dot, .nodelink i, .ld i { width: 8px; height: 8px; border-radius: 50%; background: var(--dc); box-shadow: 0 0 7px var(--dc); flex: none; display: inline-block; }
.row .rt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected { margin-bottom: 14px; }
.selcard { padding: 16px 16px 14px; }
.selhead { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.selhead > div { flex: 1; min-width: 0; } .selhead h3 { font-size: 16px; font-weight: 600; } .selhead .btn.icon { width: 32px; min-height: 32px; border: 0; background: none; }
.hexico { color: var(--dc, #7b8cc0); display: grid; place-items: center; filter: drop-shadow(0 0 7px color-mix(in srgb, var(--dc, #7b8cc0) 55%, transparent)); flex: none; }
.hexico.core { color: #a68bff; }
.hexico .ico { stroke-width: 1.4; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 12px -16px; padding: 12px 8px; text-align: center; }
.stats3 div + div { border-left: 1px solid var(--line); }
.stats3 b { display: block; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; } .stats3 span { font-size: 12px; color: var(--muted); }
.clamp { font-size: 13px; color: #c3cbe2; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.toplinks .muted { margin-bottom: 8px; }
.links { display: grid; gap: 8px; }
.links li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; }
.links .ld { background: none; border: 0; padding: 0; display: inline-flex; gap: 10px; align-items: center; color: #e6ebfa; text-align: left; }
.links .lw { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.links .bar { grid-column: 1 / -1; height: 3px; } .links .bar b { background: var(--dc); width: var(--w); box-shadow: 0 0 8px var(--dc); }
.links.big li { grid-template-columns: 1fr auto; }
.dreamcard { padding: 16px; background: linear-gradient(180deg, rgba(120,100,255,.08), rgba(255,255,255,.015)); }
.dc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; } .dc-head h3 { font-size: 16px; font-weight: 600; flex: 1; } .dc-ico { color: #b7a5ff; }
.dreamcard > .muted { margin-bottom: 12px; }
.dc-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); padding: 12px 0; gap: 4px; }
.dc-stat { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; color: #8d9bff; }
.dc-stat b { font-size: 17px; color: var(--text); font-weight: 600; } .dc-stat span { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); }
.emerging { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; padding: 12px 12px; border: 1px solid var(--line-2); border-radius: 11px; background: rgba(255,255,255,.03); color: #d6dcf0; font-size: 12.5px; line-height: 1.5; transition: border-color .2s, background .2s; }
.emerging:hover { border-color: rgba(240,181,96,.5); background: rgba(240,181,96,.05); }
.emerging .ico:first-child { color: #f0c27c; margin-top: 2px; flex: none; } .emerging span { flex: 1; } .emerging b { color: #fff; font-weight: 600; } .emerging > .ico:last-child { color: var(--muted); align-self: center; flex: none; }
.dc-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 40px 12px; color: var(--muted); }
.empty h3 { color: var(--text); font-size: 15px; }
.ihead { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; } .ihead h2, .pt { font-size: 18px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 4px; } .pt { margin-bottom: 12px; }
.summary { color: #d3daef; font-size: 14px; line-height: 1.55; margin-bottom: 14px; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
.kvi { padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--raise); } .kvi span { display: block; font-size: 11px; color: var(--muted); } .kvi b { font-weight: 600; font-size: 13.5px; }
h4.sec { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 20px 0 8px; display: flex; align-items: center; }
.quotes { display: grid; gap: 8px; } .quotes li { padding: 9px 12px; border-left: 2px solid var(--accent-line); background: rgba(255,255,255,.025); border-radius: 0 9px 9px 0; }
.quotes q { display: block; color: #dbe2f6; font-size: 13px; } .quotes q::before, .quotes q::after { content: none; } .quotes q { quotes: none; }
.quotes cite { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.note { display: flex; gap: 8px; align-items: flex-start; margin-top: 20px; font-size: 12px; color: var(--muted); } .note .ico { flex: none; margin-top: 2px; }
.rgroup { margin-bottom: 8px; } .rgroup .muted { margin-bottom: 8px; }
.rel { display: grid; gap: 4px; } .rel details { border: 1px solid var(--line); border-radius: 10px; background: var(--raise); }
.rel summary { display: flex; align-items: center; gap: 9px; padding: 8px 10px; cursor: pointer; list-style: none; } .rel summary::-webkit-details-marker { display: none; }
.rel summary .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dc); box-shadow: 0 0 7px var(--dc); flex: none; } .rel summary .rt { font-weight: 500; flex: 0 1 auto; }
.rel summary .chip { margin-left: auto; white-space: normal; text-align: right; max-width: 55%; }
.evid { padding: 4px 12px 12px; display: grid; gap: 6px; } .evid q { quotes: none; color: #cdd5ec; font-size: 12.5px; padding-left: 10px; border-left: 2px solid var(--line-3); }
.nodelink { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 2px 0; color: #e6ebfa; text-align: left; } .nodelink:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--dc); text-underline-offset: 3px; }
@media (max-width: 1279px) { .frow { grid-template-columns: 74px 1fr; } .atlas-head h1 { font-size: 20px; } .atlas-head { grid-template-columns: 1fr auto; } .atlas-head .switcher { order: 3; grid-column: 1 / -1; justify-self: start; } }
@media (max-width: 1000px) {
  .atlas-head { grid-template-columns: 1fr auto; } .atlas-head .switcher { order: 3; grid-column: 1 / -1; justify-self: start; }
  .legend { width: 150px; }
}
@media (max-width: 700px) {
  .atlas-head { padding: 10px 14px 6px; } .atlas-head > div:first-child p { display: none; } h1 { font-size: 19px; }
  .atlas-head .switcher { width: 100%; justify-content: space-between; } .switcher button { padding: 0 10px; flex: 1; justify-content: center; } .switcher button span { display: none; } .atlas-head .page-tools { display: none; }
  .atlas-head { grid-template-columns: 1fr; }
  .legend { top: auto; bottom: 8px; left: 8px; right: 8px; width: auto; }
  .legend h2 { display: none; } .legend-list { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; gap: 4px; padding-bottom: 6px; scrollbar-width: none; }
  .legend-list li { grid-template-columns: 22px auto; border: 1px solid var(--line-2); background: rgba(8,11,20,.85); } .lcount { display: none; } .lname { padding-right: 10px; }
  .zoomctl { bottom: 56px; left: 10px; } .hint { display: none; } .inspect-fab { bottom: 56px; right: 10px; }
  .sample-tag { top: 6px; right: 8px; font-size: 9px; } .view { padding: 0 14px 16px; }
}
#motion-toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: #fff; }

/* "View by" lens (topic / about / source / date over the whole Brain) */
.lens { display: grid; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.frow input { height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 9px; background: #0e1424; color: var(--text); font-size: 13px; min-width: 0; width: 100%; }
.frow input::placeholder { color: var(--faint); }
.lens-dates { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; margin: -2px 0 8px 88px; }
.lens-dates[hidden] { display: none; }
.lens-dates input { height: 34px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 9px; background: #0e1424; color: var(--text); font-size: 12.5px; min-width: 0; color-scheme: dark; }
.lens-go { margin-top: 4px; width: 100%; }
.lens-note { margin-top: 8px; }
.lens-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.lens-chips-label { font-size: 10.5px; letter-spacing: .16em; color: var(--muted); font-weight: 600; margin-right: 2px; }
.lens-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--text); font-size: 12.5px; max-width: 100%; }
.lens-chip b { color: var(--accent); font-weight: 600; }
.lens-x { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); color: var(--text); padding: 0; }
.lens-x:hover { background: rgba(255,255,255,.18); }
@media (max-width: 1279px) { .lens-dates { margin-left: 80px; } }
