/* Music brain: the Obsidian-style graph view (owner 2026-10-12). Dark, quiet chrome; the web is the picture. */
:root {
  --bg: #0B0E14; --ink: #E6EAF2; --dim: #8A93A6; --line: rgba(255,255,255,.10); --card: rgba(19,23,32,.94);
  --accent: #9DB4FF; --top: calc(env(safe-area-inset-top, 0px) + 10px); --mx: 12px;
}
@media (min-width: 700px) { :root { --mx: 18px; --top: calc(env(safe-area-inset-top, 0px) + 14px); } }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
body { position: fixed; inset: 0; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; }
#stage, #first { position: absolute; inset: 0; width: 100%; height: 100%; }
#stage canvas { display: block; outline: none; touch-action: none; }
#stage .scene-tooltip, #stage .graph-tooltip, #stage .float-tooltip-kap { display: none !important; }
#stage .graph-info-msg { display: none; }
#first { pointer-events: none; transition: opacity .45s ease; z-index: 1; }
#first.gone { opacity: 0; }
#stage canvas.grabbable { cursor: grabbing; }

/* top bar: brand · 3D/2D/Map · search · whole brain · more */
#top { position: absolute; z-index: 5; top: var(--top); left: calc(var(--mx) + env(safe-area-inset-left, 0px));
  right: calc(var(--mx) + env(safe-area-inset-right, 0px)); display: flex; align-items: center; gap: 8px; pointer-events: none; }
#top > * { pointer-events: auto; }
.brand { font-weight: 650; letter-spacing: .01em; color: var(--ink); text-decoration: none; font-size: 17px; white-space: nowrap; }
.brand span { color: var(--accent); font-weight: 400; margin-left: 1px; }
.seg { display: flex; background: rgba(255,255,255,.07); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.seg button, .seg a { appearance: none; border: 0; background: none; color: var(--dim); font: inherit; font-size: 13px;
  padding: 0 11px; min-height: 32px; border-radius: 999px; cursor: pointer; text-decoration: none; display: flex; align-items: center; }
.seg button[aria-pressed="true"] { background: rgba(157,180,255,.20); color: var(--ink); }
.seg a:hover, .seg button:hover { color: var(--ink); }
.search { position: relative; flex: 1 1 auto; min-width: 0; max-width: 300px; margin-left: auto; }
.search input { width: 100%; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.06);
  color: var(--ink); font: inherit; font-size: 16px; padding: 0 14px; outline: none; -webkit-user-select: text; user-select: text; }
.search input::placeholder { color: #6E778A; }
.search input:focus { border-color: rgba(157,180,255,.5); }
.results { position: absolute; top: 42px; right: 0; left: 0; min-width: 240px; max-height: 50vh; overflow: auto; margin: 0; padding: 4px;
  list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 12px; -webkit-overflow-scrolling: touch;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.results li { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; gap: 8px; align-items: center; min-height: 40px; }
.results li:hover, .results li[aria-selected="true"] { background: rgba(255,255,255,.08); }
.results small { color: var(--dim); margin-left: auto; font-size: 12px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.icon { appearance: none; width: 36px; height: 36px; flex: none; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255,255,255,.06); color: var(--ink); display: grid; place-items: center; cursor: pointer; padding: 0; }
.icon svg { width: 20px; height: 20px; }
#more { position: absolute; top: 44px; right: 0; width: min(300px, calc(100vw - 2 * var(--mx))); background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 6px; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
#more a { display: block; padding: 10px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; }
#more a:hover { background: rgba(255,255,255,.07); }
#more small { display: block; color: var(--dim); font-size: 12px; }
#more .credit { margin: 6px 12px 8px; color: var(--dim); font-size: 11.5px; line-height: 1.35; }
@media (max-width: 520px) {
  .brand { font-size: 15px; }
  .brand span { display: block; margin: -4px 0 0; font-size: 13px; }
  .seg button, .seg a { padding: 0 9px; }
  .search { max-width: none; }
}

/* the one-line how-to: bottom centre, gone after the first touch */
#hint { position: absolute; z-index: 4; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  width: max-content; max-width: calc(100vw - 24px); text-align: center; color: #C9D0DE; font-size: 13.5px; padding: 9px 14px;
  border-radius: 12px; background: rgba(11,14,20,.72); border: 1px solid var(--line); pointer-events: none; transition: opacity .5s; }
#hint b { color: var(--ink); font-weight: 600; }
#hint.fade { opacity: 0; }
#hint .how { color: var(--dim); }
#toast { position: absolute; z-index: 6; left: 50%; transform: translateX(-50%); top: calc(var(--top) + 50px); padding: 7px 13px;
  border-radius: 999px; background: rgba(19,23,32,.92); border: 1px solid var(--line); font-size: 13px; color: var(--ink);
  pointer-events: none; white-space: nowrap; max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis; }
#loading { position: absolute; z-index: 2; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 64px); transform: translateX(-50%);
  color: var(--dim); font-size: 13px; transition: opacity .4s; pointer-events: none; }
#loading.done { opacity: 0; }

/* the panel: a sheet on a phone, a card on the right on an iPad or a desktop */
#panel { position: absolute; z-index: 7; background: var(--card); border: 1px solid var(--line); color: var(--ink);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); overflow: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; -webkit-user-select: text; user-select: text;
  right: calc(var(--mx) + env(safe-area-inset-right, 0px)); top: calc(var(--top) + 52px); width: 360px;
  max-height: calc(100% - var(--top) - 52px - 20px - env(safe-area-inset-bottom, 0px)); border-radius: 16px; padding: 16px 18px 18px; }
@media (max-width: 700px) {
  #panel { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 48%; border-radius: 18px 18px 0 0;
    padding: 14px 16px calc(env(safe-area-inset-bottom, 0px) + 16px); border-bottom: 0; }
}
body:has(#panel:not([hidden])) #mbf-b { display: none !important; }   /* the feedback bubble never sits on the panel */
#panel .close { position: absolute; right: 8px; top: 6px; width: 40px; height: 40px; border: 0; background: none; color: var(--dim);
  font-size: 26px; line-height: 1; cursor: pointer; }
#panel .kind { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; display: flex; gap: 7px; align-items: center; padding-right: 36px; }
#panel h2 { margin: 4px 36px 2px 0; font-size: 22px; line-height: 1.15; font-weight: 650; }
#panel .meta { color: var(--dim); font-size: 13.5px; margin-bottom: 8px; }
#panel p { margin: 8px 0; color: #CDD3DF; }
#panel .src { font-size: 12.5px; color: var(--dim); }
#panel a { color: var(--accent); }
#panel .actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; }
#panel .btn { appearance: none; border: 1px solid rgba(157,180,255,.35); background: rgba(157,180,255,.12); color: var(--ink);
  font: inherit; font-size: 14px; border-radius: 999px; padding: 0 14px; min-height: 38px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; }
#panel .btn.quiet { background: none; border-color: var(--line); color: #C9D0DE; }
#panel h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); margin: 14px 0 4px; font-weight: 600; }
#panel ul { list-style: none; margin: 0; padding: 0; }
#panel li { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-top: 1px solid rgba(255,255,255,.05); cursor: pointer; min-height: 40px; }
#panel li:hover { background: rgba(255,255,255,.05); }
#panel li small { color: var(--dim); margin-left: auto; font-size: 12px; white-space: nowrap; }
