/* LAN Assistant → Brain (public/lan-nila-brain.js, the brain: public/lan-brain-viz.js) — theme tokens, except the brain's own dark stage */
.nb-hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.nb-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; position: relative; }
/* the brain sits on its own dark stage in every theme — it is light, and light needs the dark */
.nb-mind { min-height: 460px; background: radial-gradient(120% 90% at 50% 42%, #142050 0%, #0a1030 38%, #05070f 78%); border-color: #1a2347; color: #e8ecff; }
.nb-stage { position: absolute; inset: 0; touch-action: pan-y; }
.nb-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.nb-stage .bv-ov { cursor: grab; }
.nb-mind .nb-cap { position: absolute; left: 18px; top: 16px; pointer-events: none; }
.nb-cap h2 { margin: 0; font-size: 15px; font-weight: 600; color: #fff; letter-spacing: -.01em; }
.nb-cap small { color: #93a0cf; font-size: 12px; }
.nb-tools { position: absolute; right: 14px; top: 14px; display: flex; gap: 8px; align-items: center; }
.nb-ghost { font: inherit; font-size: 12px; padding: 5px 11px; border-radius: 99px; border: 1px solid #2b3768; background: rgba(10,16,40,.6); color: #cfd6ff; cursor: pointer; backdrop-filter: blur(6px); }
.nb-ghost:hover { border-color: #5866b8; color: #fff; }
.nb-live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: #9fb0e8; padding: 5px 11px; border-radius: 99px; background: rgba(10,16,40,.6); border: 1px solid #1f2a55; }
.nb-live i { width: 7px; height: 7px; border-radius: 50%; background: #5eead4; box-shadow: 0 0 0 0 #5eead488; animation: nb-beat 2.4s ease-out infinite; }
.nb-live.grow { color: #d1fae5; border-color: #2c7a63; } .nb-live.grow i { background: #6ee7b7; animation-duration: .9s; }
.nb-live.think { color: #fde7c2; border-color: #7a5a2c; } .nb-live.think i { background: #fdba74; animation-duration: .6s; }
.nb-live.replay { color: #e0e7ff; border-color: #4652a0; } .nb-live.replay i { background: #a5b4fc; animation-duration: 1.2s; }
@keyframes nb-beat { 0% { box-shadow: 0 0 0 0 rgba(110,231,183,.55); } 80%, 100% { box-shadow: 0 0 0 9px rgba(110,231,183,0); } }
.nb-ticker { position: absolute; left: 16px; bottom: 38px; margin: 0; padding: 0; list-style: none; max-width: min(380px, 46%); pointer-events: none; display: grid; gap: 5px; }
.nb-ticker li { font-size: 12px; color: #cdd5f7; background: rgba(8,12,30,.72); border: 1px solid #22305f; border-radius: 10px; padding: 5px 10px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: nb-in .45s cubic-bezier(.2,.8,.2,1); backdrop-filter: blur(6px); }
.nb-ticker li b { color: #6ee7b7; font-weight: 600; margin-right: 4px; }
@keyframes nb-in { from { transform: translateY(8px); opacity: 0; } }
.nb-legend { position: absolute; left: 16px; right: 16px; bottom: 12px; display: flex; gap: 14px; font-size: 11.5px; color: #8e9acb; pointer-events: none; }
.nb-legend span { display: inline-flex; align-items: center; gap: 6px; }
.nb-legend .muted { margin-left: auto; color: #6c78a8; }
.nb-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.nb-legend i.new { background: #a7f3d0; box-shadow: 0 0 8px #6ee7b7; } .nb-legend i.old { background: #93c5fd; box-shadow: 0 0 6px #60a5fa; }
.nb-k b.bump { animation: nb-bump .6s ease; }
@keyframes nb-bump { 40% { transform: scale(1.12); color: var(--ok); } }
.nb-growth .scrub { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 3; transition: x1 .15s, x2 .15s; }
.nb-growth .halo { fill: none; stroke: var(--accent); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: nb-halo 1.8s ease-out infinite; }
@keyframes nb-halo { from { transform: scale(1); opacity: .9; } to { transform: scale(2.6); opacity: 0; } }
.nb-side { display: grid; grid-template-rows: auto 1fr; gap: 14px; min-width: 0; }
.nb-growth { display: flex; flex-direction: column; }
.nb-growth #nb-chart { flex: 1; display: flex; align-items: flex-end; }
.nb-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.nb-k { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.nb-k b { display: block; font-size: 28px; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.nb-k span { font-size: 12px; color: var(--muted); }
.nb-k.acc b { color: var(--accent-text); } .nb-k.warn b { color: var(--warn); } .nb-k.ok b { color: var(--ok); }
.nb-growth { padding: 14px 16px 8px; }
.nb-growth h3 { margin: 0 0 2px; font-size: 13px; font-weight: 600; }
.nb-growth small { color: var(--muted); font-size: 12px; }
.nb-growth svg { width: 100%; height: 130px; display: block; margin-top: 6px; }
.nb-growth .area { fill: var(--accent-soft); }
.nb-growth .ln { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: nb-draw 1.6s cubic-bezier(.2,.8,.2,1) forwards; }
.nb-growth .dot { fill: var(--accent); }
.nb-growth .ax { font-size: 10px; fill: var(--muted); }
@keyframes nb-draw { to { stroke-dashoffset: 0; } }
.nb-topics { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px 14px; border-top: 1px solid var(--line); }
.nb-chip { font-size: 12px; padding: 4px 10px; border-radius: 99px; background: var(--soft); color: var(--ink-2); border: 1px solid transparent; cursor: pointer; }
.nb-chip b { font-weight: 600; margin-left: 4px; color: var(--ink); }
.nb-chip.on { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.nb-tabs { display: flex; gap: 6px; margin: 4px 0 12px; flex-wrap: wrap; }
.nb-tabs button { font: inherit; font-size: 13px; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.nb-tabs button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.nb-tabs .n { font-size: 11px; opacity: .8; margin-left: 4px; }
.nb-feed { list-style: none; margin: 0; padding: 4px 0; }
.nb-feed li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); align-items: start; }
.nb-feed li:last-child { border-bottom: 0; }
.nb-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-size: 15px; background: var(--soft); }
.nb-ico.study { background: var(--accent-soft); } .nb-ico.answer { background: var(--ok-soft); } .nb-ico.chat { background: var(--warn-soft); }
.nb-feed .when { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.nb-feed .got { font-size: 12px; color: var(--muted); margin-top: 2px; }
.nb-feed .got b { color: var(--ink); font-weight: 600; }
.nb-st { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.nb-st.asked { background: var(--warn-soft); color: var(--warn); } .nb-st.answered { background: var(--ok-soft); color: var(--ok); } .nb-st.urgent { background: var(--bad-soft); color: var(--bad); }
.nb-tbl td { text-align: left; vertical-align: top; white-space: normal; }
.nb-q { font-weight: 500; color: var(--ink); line-height: 1.4; }
.nb-q .muted { font-weight: 400; }
.nb-why { color: var(--muted); font-size: 12px; margin-top: 3px; }
.nb-ans { color: var(--ok); font-size: 12.5px; margin-top: 5px; }
.nb-row-act { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.nb-form { display: grid; grid-template-columns: 160px 1fr; gap: 10px 14px; padding: 14px 16px; align-items: center; }
.nb-form label.l { color: var(--ink-2); font-weight: 500; }
.nb-form .line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.nb-new { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.nb-new input[type=text], .nb-new select { flex: 1; min-width: 140px; }
.nb-empty { padding: 26px 16px; text-align: center; color: var(--muted); }
.nb-pulse { animation: nb-pulse 1.2s ease-in-out infinite; }
@keyframes nb-pulse { 50% { opacity: .45; } }
@media (max-width: 900px) { .nb-hero { grid-template-columns: 1fr; } .nb-mind { min-height: 360px; } .nb-legend .muted { display: none; } .nb-form { grid-template-columns: 1fr; } .nb-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (prefers-reduced-motion: reduce) { .nb-growth .ln { animation: none; stroke-dashoffset: 0; } .nb-pulse, .nb-live i, .nb-growth .halo, .nb-ticker li, .nb-k b.bump { animation: none; } }

.nb-facts tr.nb-grp td { background: var(--soft); font-weight: 600; font-size: 12.5px; letter-spacing: .02em; padding-top: 9px; padding-bottom: 9px; }
.nb-facts td { padding-top: 10px; padding-bottom: 10px; }
.nb-from { color: var(--muted); font-size: 12px; white-space: nowrap !important; }
.nb-chk { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.nb-new { align-items: center; }
.nb-new .btn { flex: none; }
.nb-growth svg { height: 150px; }
.nb-facts td { vertical-align: middle !important; }
@media (max-width: 700px) { .nb-from { white-space: normal !important; } .nb-tabs .grow { display: none; } }
.nb-chk input, .nb-form input[type=checkbox] { margin: 0; flex: none; width: 15px; height: 15px; accent-color: var(--accent); }
.nb-chk-ink { color: var(--ink); }
.nb-chk-ink .muted { margin-left: 2px; }
.nb-form .line { gap: 8px 16px; }
@media (max-width: 700px) {
  .nb-facts thead { display: none; }
  .nb-facts tr:not(.nb-grp) { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .nb-facts tr:not(.nb-grp) td { display: block; padding: 0 !important; border: 0; }
  .nb-facts td.nb-from { display: block !important; grid-column: 1; font-size: 11.5px; }
  .nb-facts td.nb-act { grid-column: 2; grid-row: 1 / 3; align-self: center; }
  .nb-facts .nb-row-act { flex-direction: column; gap: 2px; }
  .nb-new input, .nb-new select { flex: 1 1 100% !important; }
}
@media (max-width: 700px) {
  .nb-facts, .nb-facts tbody { display: block; width: 100% !important; min-width: 0 !important; }
  .nb-facts tr.nb-grp { display: block; }
  .nb-facts tr.nb-grp td { display: block; padding: 9px 14px !important; }
  .nb-facts td { white-space: normal !important; word-break: break-word; }
  .nb-tbl:not(.nb-facts) { min-width: 640px; }
}
@media (max-width: 600px) {
  .nb-mind { min-height: 400px; }
  .nb-tools { top: auto; bottom: 10px; right: 10px; }
  .nb-legend { display: none; }
  .nb-ticker { left: 10px; right: 10px; bottom: 50px; max-width: none; }
  .nb-ticker li + li { display: none; }
}
