/* The Brain, a demo (axi0.io/brain/demo/): the brain map's look, true black with the orange core, and the suite's light
   paper through /axi0/theme.js. No inline styles anywhere (the page runs under style-src 'self'): swatches are classes
   or data-c values the script paints through the CSSOM. No external requests. */

@font-face {
  font-family: "Instrument Sans";
  src: url(./fonts/instrument-sans-latin-var.woff2) format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #000; --panel: #0a0a0c; --hover: #141418; --field: #0a0a0c; --chipbg: #000; --veil: rgba(0, 0, 0, .75);
  --line: #1c1c21; --line2: #26262c; --line3: #3a3a42; --scroll: #2a2a31; --shadow: rgba(0, 0, 0, .75); --shadow2: rgba(0, 0, 0, .6);
  --head: #fff; --ink: #f5f5f7; --text: #d6d6dc; --mute: #8e8e98; --dim: #5c5c66;
  --core: #f6a04d; --core-ink: #f6a04d; --core-hover: #ffb26a; --on-core: #000; --ok: #7bd88f; --warn: #f6a04d;
  --r: 16px;
  --k-core: #f6a04d; --k-playbook: #f5f5f7; --k-routine: #f6a04d; --k-repository: #9ad1ff; --k-operator: #ffffff;
  --k-memory: #ff8fa3; --k-handbook: #f7d774; --k-check: #7bd88f; --k-proposal: #d9a3ff;
  --map-link: #f5f5f7; --map-label-bg: #0a0a0c; --map-glow: rgba(255, 255, 255, .8);
  color-scheme: dark;
}
html[data-axi0-theme="light"] {
  --bg: #f6f2ea; --panel: #fffdf9; --hover: #efe8dc; --field: #fffdf9; --chipbg: #fffdf9; --veil: rgba(255, 253, 249, .85);
  --line: #e6dfd3; --line2: #d3cabb; --line3: #8a8174; --scroll: #c9bfae; --shadow: rgba(40, 30, 20, .25); --shadow2: rgba(40, 30, 20, .18);
  --head: #17140f; --ink: #17140f; --text: #2c2823; --mute: #675f54; --dim: #8a8174;
  --core-ink: #9a4a0a; --ok: #17733f; --warn: #9a4a0a;
  --k-playbook: #2c2823; --k-repository: #1d5f93; --k-operator: #17140f; --k-memory: #b3264a; --k-handbook: #8a6400; --k-check: #17733f; --k-proposal: #6d3fa0;
  --map-link: #2c2823; --map-label-bg: #fffdf9; --map-glow: rgba(23, 20, 15, .35);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  html:not([data-axi0-theme="dark"]) {
    --bg: #f6f2ea; --panel: #fffdf9; --hover: #efe8dc; --field: #fffdf9; --chipbg: #fffdf9; --veil: rgba(255, 253, 249, .85);
    --line: #e6dfd3; --line2: #d3cabb; --line3: #8a8174; --scroll: #c9bfae; --shadow: rgba(40, 30, 20, .25); --shadow2: rgba(40, 30, 20, .18);
    --head: #17140f; --ink: #17140f; --text: #2c2823; --mute: #675f54; --dim: #8a8174;
    --core-ink: #9a4a0a; --ok: #17733f; --warn: #9a4a0a;
    --k-playbook: #2c2823; --k-repository: #1d5f93; --k-operator: #17140f; --k-memory: #b3264a; --k-handbook: #8a6400; --k-check: #17733f; --k-proposal: #6d3fa0;
    --map-link: #2c2823; --map-label-bg: #fffdf9; --map-glow: rgba(23, 20, 15, .35);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 13.5px/1.45 "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: var(--core); text-underline-offset: 3px; }
::selection { background: rgba(246, 160, 77, .35); }
[hidden] { display: none !important; }
svg { display: block; }
.sprite { position: absolute; }
.ic { fill: currentColor; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 80; padding: 8px 14px; border-radius: 999px; background: var(--core); color: var(--on-core); font-weight: 600; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--core-ink); outline-offset: 2px; }

/* ---- header ------------------------------------------------------------------------------------------- */
.top { height: 60px; display: flex; align-items: center; gap: 22px; padding: 0 20px; }
.wordmark { display: inline-flex; align-items: baseline; gap: .16em; font-size: 23px; font-weight: 600; letter-spacing: -.045em; line-height: 1; color: var(--head); white-space: nowrap; }
.wordmark:hover { text-decoration: none; }
.wm-a { color: var(--head); }
.wm-s { color: var(--mute); font-weight: 500; }
.wm-tag { margin-left: .35em; padding: 2px 7px; border: 1px solid var(--line2); border-radius: 999px; color: var(--core-ink); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; transform: translateY(-2px); }
.wm-dot {
  display: inline-block; width: .24em; height: .24em; border-radius: 50%; background: var(--core);
  box-shadow: 0 0 .7em var(--core); transform: translateY(-.06em); margin-left: -.06em;
}
.search { position: relative; flex: 1; max-width: 560px; }
.search-ic { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--mute); pointer-events: none; }
#q {
  width: 100%; background: var(--field); border: 1px solid var(--line2); border-radius: 999px;
  padding: 9px 44px 9px 38px; color: var(--head); font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#q::placeholder { color: var(--mute); }
#q:focus { border-color: var(--core); box-shadow: 0 0 0 4px rgba(246, 160, 77, .14), 0 10px 40px var(--shadow2); }
.search-key {
  position: absolute; right: 12px; top: 50%; margin-top: -10px; height: 20px; min-width: 20px; padding: 0 6px;
  border: 1px solid var(--line2); border-radius: 6px; color: var(--mute); font: 500 11px/18px "Instrument Sans", sans-serif; text-align: center;
}
.search:focus-within .search-key { opacity: 0; }
.results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 40; max-height: min(60vh, 520px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line2); border-radius: 18px; padding: 6px; box-shadow: 0 30px 80px var(--shadow);
}
.result {
  display: grid; grid-template-columns: 16px 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 11px; color: var(--ink);
}
.result:hover, .result.active { background: var(--hover); }
.result .ic { width: 12px; height: 12px; }
.result .r-main { display: flex; flex-direction: column; min-width: 0; }
.result .r-label { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result .r-sub { color: var(--mute); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result .r-kind { color: var(--mute); font-size: 11.5px; white-space: nowrap; }
.results .empty { color: var(--mute); padding: 10px 12px; font-size: 13px; }
.meta { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--mute); font-size: 12.5px; white-space: nowrap; }
.meta-sep { width: 1px; height: 14px; background: var(--line2); }
.meta .warn { color: var(--warn); }

/* ---- the banner --------------------------------------------------------------------------------------- */
.banner {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px 18px; margin: 0 16px 10px;
  padding: 12px 18px; border: 1px solid rgba(246, 160, 77, .45); border-radius: var(--r); background: rgba(246, 160, 77, .07);
}
.banner-text { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.45; text-align: center; max-width: 60em; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 5px 11px; border: 1px solid var(--line2); border-radius: 999px;
  color: var(--ink); font-size: 12.5px; font-weight: 500; white-space: nowrap; background: var(--panel); text-decoration: none;
}
.btn:hover { border-color: var(--core); text-decoration: none; }
.btn.done { color: var(--core-ink); border-color: var(--core); }
.btn.primary { min-height: 36px; padding: 0 16px; border-color: var(--core); background: var(--core); color: var(--on-core); font-size: 14px; font-weight: 600; }
.btn.primary:hover { background: var(--core-hover); border-color: var(--core-hover); }

/* ---- layout ------------------------------------------------------------------------------------------- */
.grid {
  display: grid; grid-template-columns: 280px minmax(0, 1fr) 320px; gap: 14px;
  padding: 2px 16px 16px; height: calc(100vh - 60px - 62px); min-height: 560px;
}
.col { display: flex; flex-direction: column; gap: 12px; overflow: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; padding-bottom: 4px; }
.col::-webkit-scrollbar { width: 6px; }
.col::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 3px; }
.centre { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 12px; flex-shrink: 0; }
.panel h2 { margin: 0 0 10px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; color: var(--head); }
.panel .sub { margin: -8px 0 10px; color: var(--mute); font-size: 12px; }
.count { color: var(--mute); font-weight: 500; font-size: 12.5px; }
.count.badge {
  min-width: 20px; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--core); color: var(--on-core);
  font-size: 11.5px; font-weight: 600; line-height: 20px; text-align: center;
}
.count.badge.zero { background: var(--line2); color: var(--mute); }
.list { display: flex; flex-direction: column; }
.list .empty { color: var(--mute); font-size: 13px; padding: 2px 0 4px; }

/* rows in Today / Next 14 days / Routines */
.row {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: baseline; padding: 7px 0;
  border-top: 1px solid var(--line); text-align: left; width: 100%; color: var(--ink);
}
.row:first-child { border-top: 0; }
.row .when { color: var(--mute); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row .what { min-width: 0; }
.row .label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#today .row .label { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.more { display: block; width: 100%; text-align: left; color: var(--mute); font-size: 12.5px; padding: 8px 0 2px; border-top: 1px solid var(--line); }
.more:hover { color: var(--core-ink); }
.row .fine { color: var(--mute); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.row:hover .label { color: var(--core-ink); }
.kbadge {
  display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--mute);
  border: 1px solid var(--line2); border-radius: 6px; padding: 1px 5px; line-height: 14px; vertical-align: 1px; margin-right: 6px;
}
.kbadge.commit { color: var(--k-repository); border-color: rgba(154, 209, 255, .35); }
.kbadge.playbook { color: var(--ink); }
.kbadge.operator-run { color: var(--core-ink); border-color: rgba(246, 160, 77, .35); }

/* pulse */
.pulse { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; }
.pulse .k { color: var(--mute); font-size: 12.5px; }
.pulse .v { font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.pulse .v.warn { color: var(--warn); }
.pulse .v.ok { color: var(--ok); }
.pulse .agents { grid-column: 1 / -1; margin-top: 4px; color: var(--mute); font-size: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.pulse .agents b { color: var(--text); font-weight: 500; }

/* needs you */
.need { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); cursor: pointer; align-items: start; }
.need:first-child { border-top: 0; }
.need input {
  appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 2px 0 0; border: 1px solid var(--line3); border-radius: 5px;
  background: var(--bg); cursor: pointer; position: relative; flex-shrink: 0;
}
.need input:checked { background: var(--core); border-color: var(--core); }
.need input:checked::after {
  content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px; border: solid #000; border-width: 0 2px 2px 0; transform: rotate(42deg);
}
.need input:focus-visible { outline: 2px solid rgba(246, 160, 77, .5); outline-offset: 2px; }
.need .txt { display: block; color: var(--ink); line-height: 1.4; }
.need .src { display: block; color: var(--mute); font-size: 11.5px; margin-top: 2px; }
.need.done .txt { color: var(--dim); text-decoration: line-through; }
.needs-done-title { color: var(--mute); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 0 2px; border-top: 1px solid var(--line); margin-top: 2px; }

/* routines board */
.routine { grid-template-columns: 10px 1fr auto; align-items: center; }
.routine .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--scroll); }
.routine .dot.ok { background: var(--ok); box-shadow: 0 0 6px rgba(123, 216, 143, .5); }
.routine .dot.down { background: var(--core); box-shadow: 0 0 6px rgba(246, 160, 77, .6); }
.routine .dot.never { background: var(--line3); }
.routine .dot.none { background: var(--line); border: 1px solid var(--line2); }
.routine .what { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.routine .label { flex: 1; min-width: 0; }
.where { font-size: 10.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--mute); border: 1px solid var(--line2); border-radius: 6px; padding: 1px 5px; line-height: 14px; flex-shrink: 0; }

/* ---- center: tabs + stage ----------------------------------------------------------------------------- */
.tabs { display: flex; align-items: center; gap: 2px; height: 40px; padding: 0 4px 0 2px; overflow-x: auto; scrollbar-width: none; flex-shrink: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 9px 13px; color: var(--mute); border-bottom: 2px solid transparent; font-weight: 500; font-size: 13.5px; white-space: nowrap;
  transition: color .12s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--head); border-bottom-color: var(--core); }
.tabs-space { flex: 1; }
.iconbtn {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--mute); border: 1px solid transparent; flex: none;
}
.iconbtn svg { width: 16px; height: 16px; }
.iconbtn:hover { color: var(--head); background: var(--hover); border-color: var(--line2); }

.stage {
  position: relative; flex: 1; min-height: 480px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
}
.stage:fullscreen { border-radius: 0; border: 0; background: var(--bg); }
.stage.fs { position: fixed; inset: 0; z-index: 50; border-radius: 0; border: 0; background: var(--bg); }
#map { display: block; width: 100%; height: 100%; cursor: default; }
#map.pointer { cursor: pointer; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--mute); }
.loading.error { color: var(--core-ink); }
.legend {
  position: absolute; left: 14px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--mute); font-size: 11.5px; pointer-events: none; max-width: calc(100% - 28px);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.sw.k-core { background: var(--k-core); box-shadow: 0 0 6px var(--k-core); }
.sw.k-playbook { background: var(--k-playbook); } .sw.k-routine { background: var(--k-routine); } .sw.k-repository { background: var(--k-repository); }
.sw.k-operator { background: var(--k-operator); } .sw.k-memory { background: var(--k-memory); } .sw.k-handbook { background: var(--k-handbook); }
.sw.k-check { background: var(--k-check); } .sw.k-proposal { background: var(--k-proposal); }
.filterchip {
  position: absolute; left: 14px; top: 12px; display: inline-flex; align-items: center; gap: 8px; padding: 5px 8px 5px 12px;
  background: var(--chipbg); border: 1px solid var(--line2); border-radius: 999px; font-size: 12.5px; color: var(--ink); cursor: pointer;
}
.filterchip:hover { border-color: var(--core); }
.filterchip .x { color: var(--mute); font-size: 14px; line-height: 1; }
.view { position: absolute; inset: 0; overflow: auto; padding: 16px; scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; background: var(--panel); }
.shape { margin: 10px 2px 0; color: var(--mute); font-size: 12.5px; line-height: 1.5; }
.shape b { color: var(--text); font-weight: 500; }

/* areas */
.areas { columns: 236px; column-gap: 12px; }
.area { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; break-inside: avoid; margin-bottom: 12px; }
.area.wide { column-span: all; }
.area h3 { margin: 0 0 10px; font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; color: var(--head); }
.area h3 .sw { width: 8px; height: 8px; }
.area h3 .count { margin-left: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px 4px 8px; border: 1px solid var(--line2); border-radius: 999px;
  color: var(--text); font-size: 12.5px; line-height: 1.3; background: var(--panel); text-align: left;
}
.chip .ic { width: 11px; height: 11px; flex-shrink: 0; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip:hover { border-color: var(--core); color: var(--head); }
.chip.selected { border-color: var(--core); color: var(--head); box-shadow: 0 0 0 3px rgba(246, 160, 77, .14); }
.area .empty { color: var(--mute); font-size: 12.5px; }
.k-core { color: var(--k-core); } .k-playbook { color: var(--k-playbook); } .k-routine { color: var(--k-routine); } .k-repository { color: var(--k-repository); }
.k-operator { color: var(--k-operator); } .k-memory { color: var(--k-memory); } .k-handbook { color: var(--k-handbook); } .k-check { color: var(--k-check); } .k-proposal { color: var(--k-proposal); }

/* timeline */
.tl-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tl-filters .chip.on { border-color: var(--core); color: var(--head); }
.tl-day { margin: 0 0 16px; }
.tl-day h3 { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--ink); display: flex; gap: 8px; align-items: baseline; position: sticky; top: -16px; background: var(--panel); padding: 6px 0; }
.tl-day h3 .count { font-weight: 500; }
.tl-day h3 .today { color: var(--core-ink); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.tl-entry {
  display: grid; grid-template-columns: 58px 1fr; gap: 10px; align-items: baseline; width: 100%; text-align: left; padding: 6px 0; border-top: 1px solid var(--line); color: var(--ink);
}
.tl-entry .t { color: var(--mute); font-size: 12px; font-variant-numeric: tabular-nums; }
.tl-entry .l { min-width: 0; }
.tl-entry .d { color: var(--mute); font-size: 12px; margin-left: 6px; }
button.tl-entry:hover .l { color: var(--core-ink); }

/* ---- tooltip ------------------------------------------------------------------------------------------ */
.tip {
  position: fixed; z-index: 70; pointer-events: none; max-width: 300px; padding: 9px 11px;
  background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 12px 40px var(--shadow2);
  font-size: 12.5px; line-height: 1.4; color: var(--text);
}
.tip b { display: block; color: var(--head); font-weight: 600; }
.tip .k { color: var(--mute); font-size: 11.5px; }
.tip .s { margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- detail panel ------------------------------------------------------------------------------------- */
.detail {
  position: fixed; top: 68px; right: 16px; bottom: 16px; width: 440px; max-width: calc(100vw - 32px); z-index: 60; overflow: auto;
  background: var(--panel); border: 1px solid var(--line2); border-radius: 20px; padding: 20px 22px 24px; box-shadow: 0 30px 80px var(--shadow);
  transform: translateX(calc(100% + 40px)); transition: transform .22s ease, visibility 0s linear .22s; visibility: hidden;
  scrollbar-width: thin; scrollbar-color: var(--scroll) transparent;
}
.detail.open { transform: none; visibility: visible; transition-delay: 0s; }
.detail-close { position: absolute; top: 12px; right: 12px; }
.d-kind { display: flex; align-items: center; gap: 8px; color: var(--mute); font-size: 12.5px; margin-bottom: 8px; padding-right: 40px; }
.d-kind .ic { width: 12px; height: 12px; }
.d-kind .ring { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line2); border-radius: 999px; padding: 1px 8px; font-size: 11.5px; }
.d-kind .ring .sw { width: 6px; height: 6px; }
.detail h2 { margin: 0 0 8px; font-size: 19px; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; color: var(--head); padding-right: 30px; }
.d-summary { color: var(--text); margin: 0 0 14px; font-size: 14px; line-height: 1.5; }
.d-path { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 12px; margin-bottom: 14px; }
.d-path code { font: 500 12.5px/1.4 "Instrument Sans", sans-serif; color: var(--text); word-break: break-all; }
.d-meta { display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; font-size: 13px; margin-bottom: 14px; }
.d-meta dt { color: var(--mute); margin: 0; }
.d-meta dd { margin: 0; min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.d-meta .warn { color: var(--warn); font-weight: 500; }
.d-meta .ok { color: var(--ok); }
.detail h3 { margin: 16px 0 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--mute); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { border: 1px solid var(--line2); border-radius: 999px; padding: 2px 9px; font-size: 12px; color: var(--text); }
.entries { margin: 0; padding: 0; list-style: none; }
.entries li { padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.45; color: var(--text); overflow-wrap: anywhere; }
.entries li:first-child { border-top: 0; }
.neigh { display: grid; grid-template-columns: 1fr; gap: 2px; }
.nrow { display: grid; grid-template-columns: 70px 12px 1fr; gap: 8px; align-items: center; width: 100%; text-align: left; padding: 6px 8px; border-radius: 9px; color: var(--ink); }
.nrow:hover { background: var(--hover); }
.nrow .rel { color: var(--mute); font-size: 11.5px; }
.nrow .ic { width: 12px; height: 12px; }
.nrow .nl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-more { color: var(--mute); font-size: 12.5px; padding: 6px 8px; }
.d-more:hover { color: var(--ink); }
.d-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--mute); font-size: 12px; }

/* ---- footer ------------------------------------------------------------------------------------------- */
.foot { max-width: 1280px; margin: 0 auto; padding: 4px 20px 28px; color: var(--mute); font-size: 12.5px; line-height: 1.55; }
.foot p { margin: 0; }
.foot a { color: var(--core-ink); }

/* ---- narrow screens ----------------------------------------------------------------------------------- */
@media (max-width: 1000px) {
  .top { height: auto; flex-wrap: wrap; gap: 10px 16px; padding: 12px 14px 8px; }
  .search { flex: 1 1 100%; order: 3; max-width: none; }
  .meta { margin-left: auto; }
  .banner { margin: 2px 12px 10px; padding: 12px 14px; }
  .grid { grid-template-columns: 1fr; height: auto; min-height: 0; padding: 4px 12px 16px; }
  .centre { order: -1; }
  .stage { height: clamp(460px, calc(100vw + 40px), 80vh); }
  .col { overflow: visible; }
  .detail { top: 8px; right: 8px; bottom: 8px; left: 8px; width: auto; max-width: none; }
  .legend { font-size: 11px; gap: 3px 9px; }
}
@media (max-width: 480px) {
  .meta { font-size: 12px; }
  .meta-sep { display: none; }
  .d-meta { grid-template-columns: 80px 1fr; }
  .banner-text { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .detail { transition: none; }
}
