@font-face { font-family: "Sora"; src: url("../fonts/sora-latin.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/geist-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
/* Layout: a night "aurora" band holds the section switch and a command-palette search
   (words, "phrases", @tool, #code, --option, field:value, !not, OR) with suggestions, live filter chips,
   an advanced filter panel and topic chips; below, a two-pane reader: results with match snippets,
   and the open note with its matches highlighted and a next/previous match bar (one pane at a time on phones). */
:root {
  --night: #0f0c26;
  --band-fg: #efecff;
  --band-muted: #b8b1e6;
  --band-line: rgba(196, 181, 253, .24);
  --band-glass: rgba(239, 236, 255, .06);
  --band-deep: rgba(10, 8, 32, .55);
  --paper: #f4f2ff;
  --ink: #16123a;
  --cyan: #22c3e6;
  --sun: #f2c14e;
  --rose: #fda4af;
  --bg: #f6f4ff;
  --surface: #ffffff;
  --fg: #16123a;
  --muted: #5d5689;
  --line: rgba(22, 18, 58, .12);
  --accent: #6d28d9;
  --accent-2: #0e7490;
  --chip: rgba(109, 40, 217, .08);
  --chip-on: #16123a;
  --chip-on-fg: #ffffff;
  --code-bg: #120e2e;
  --code-fg: #ebe7ff;
  --code-dim: #8f88c4;
  --code-line: rgba(196, 181, 253, .14);
  --inline-bg: rgba(109, 40, 217, .09);
  --inline-fg: #4c1d95;
  --quote-bg: rgba(34, 195, 230, .09);
  --mark: rgba(242, 193, 78, .55);
  --mark-cur: #f2c14e;
  --pop: #ffffff;
  --pop-fg: #16123a;
  --pop-muted: #5d5689;
  --pop-hover: rgba(109, 40, 217, .09);
  --pop-shadow: 0 24px 60px -14px rgba(5, 3, 20, .55);
  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Geist", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0c26; --surface: #17133a; --fg: #efecff; --muted: #aea8d8; --line: rgba(196, 181, 253, .16);
    --accent: #b49bff; --accent-2: #5fd6f0; --chip: rgba(180, 155, 255, .1); --chip-on: #efecff; --chip-on-fg: #16123a;
    --code-bg: #0a0820; --code-line: rgba(196, 181, 253, .12); --inline-bg: rgba(180, 155, 255, .14); --inline-fg: #d7cbff;
    --quote-bg: rgba(34, 195, 230, .1); --mark: rgba(242, 193, 78, .42);
    --pop: #1b1640; --pop-fg: #efecff; --pop-muted: #aea8d8; --pop-hover: rgba(180, 155, 255, .14); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0c26; --surface: #17133a; --fg: #efecff; --muted: #aea8d8; --line: rgba(196, 181, 253, .16);
  --accent: #b49bff; --accent-2: #5fd6f0; --chip: rgba(180, 155, 255, .1); --chip-on: #efecff; --chip-on-fg: #16123a;
  --code-bg: #0a0820; --code-line: rgba(196, 181, 253, .12); --inline-bg: rgba(180, 155, 255, .14); --inline-fg: #d7cbff;
  --quote-bg: rgba(34, 195, 230, .1); --mark: rgba(242, 193, 78, .42);
  --pop: #1b1640; --pop-fg: #efecff; --pop-muted: #aea8d8; --pop-hover: rgba(180, 155, 255, .14); color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--fg); font: 15.5px/1.6 var(--font-body); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ---------- band ---------- */
.band { position: relative; background: var(--night); color: var(--band-fg); z-index: 2;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 24px 20px; }
.glow { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.glow::before, .glow::after { content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; }
.glow::before { width: 620px; height: 620px; left: -220px; top: -380px; background: radial-gradient(circle, #6d28d9 0%, transparent 66%); }
.glow::after { width: 560px; height: 560px; right: -200px; bottom: -420px; background: radial-gradient(circle, #0891b2 0%, transparent 66%); }
.band-in { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; display: grid; gap: 14px; }
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; padding: 7px 12px 7px 9px; border-radius: 13px; background: rgba(244, 242, 255, .95); color: var(--ink); }
.brand svg { width: 26px; height: 26px; }
.brand b { font: 600 19px/1 var(--font-display); letter-spacing: -.02em; }
.brand i { font: 500 11px/1 var(--font-mono); letter-spacing: .08em; font-style: normal; padding: 5px 7px 4px; border-radius: 7px; background: var(--ink); color: #fff; }
.pv { font: 500 12px/1.4 var(--font-mono); color: var(--band-muted); letter-spacing: .02em; }
h1 { margin: 2px 0 0; font: 300 clamp(28px, 4.4vw, 42px)/1.05 var(--font-display); letter-spacing: -.04em; text-wrap: balance; }
h1 em { font-style: normal; background: linear-gradient(100deg, #b49bff 10%, #5fd6f0 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }

.seg { display: inline-flex; justify-self: start; padding: 4px; border-radius: 12px; background: var(--band-glass); border: 1px solid var(--band-line); }
.seg button { border: 0; background: transparent; color: var(--band-muted); padding: 7px 14px; border-radius: 9px; display: inline-flex; align-items: baseline; gap: 8px; }
.seg button b { font: 600 14px/1.2 var(--font-body); color: var(--band-fg); }
.seg button span { font: 500 12px/1.2 var(--font-mono); }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--muted); }
.seg button[aria-pressed="true"] b { color: var(--ink); }

.searchbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: start; }
.search { position: relative; min-width: 0; }
.search > svg { position: absolute; left: 15px; top: 16px; width: 18px; height: 18px; color: #8f88c4; pointer-events: none; }
.search input { -webkit-appearance: none; appearance: none; width: 100%; height: 50px; padding: 0 76px 0 44px; border-radius: 14px; border: 1px solid var(--band-line); background: var(--band-deep);
  color: var(--band-fg); font: 400 15.5px/1 var(--font-mono); letter-spacing: -.01em; }
.search input::placeholder { color: #8f88c4; font-family: var(--font-body); letter-spacing: 0; }
.search input:focus { border-color: rgba(180, 155, 255, .7); box-shadow: 0 0 0 4px rgba(124, 58, 237, .25); outline: none; }
.search input::-webkit-search-cancel-button { display: none; }
.kbd { position: absolute; right: 12px; top: 13px; font: 500 12px/1 var(--font-mono); color: var(--band-muted); border: 1px solid var(--band-line); border-radius: 7px; padding: 5px 8px; pointer-events: none; }
.clear { position: absolute; right: 8px; top: 8px; width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; color: var(--band-muted); font-size: 20px; line-height: 1; }
.clear:hover { background: var(--band-glass); color: var(--band-fg); }
.tbtn { height: 50px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--band-line); background: var(--band-glass); color: var(--band-fg); font-weight: 500; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.tbtn svg { width: 17px; height: 17px; }
.tbtn:hover { border-color: rgba(180, 155, 255, .6); }
.tbtn[aria-expanded="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.tbtn .n { font: 600 11px/1 var(--font-mono); padding: 4px 6px; border-radius: 999px; background: var(--sun); color: var(--ink); }
.tbtn.icon { width: 50px; padding: 0; justify-content: center; font: 600 17px/1 var(--font-display); }

/* suggestions */
.sugg { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; margin: 0; padding: 6px; list-style: none; background: var(--pop); color: var(--pop-fg);
  border-radius: 14px; box-shadow: var(--pop-shadow), 0 0 0 1px var(--line); max-height: min(400px, 62vh); overflow: auto; }
.sugg .gh { padding: 9px 10px 4px; font: 600 10.5px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--pop-muted); }
.sugg .opt { display: flex; align-items: baseline; gap: 12px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.sugg .opt[aria-selected="true"], .sugg .opt:hover { background: var(--pop-hover); }
.sugg .l { font: 500 14px/1.35 var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sugg .l b { color: var(--accent); font-weight: 600; }
.sugg .l .k { color: var(--accent); }
.sugg .h { flex: 1; min-width: 0; font-size: 13px; color: var(--pop-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sugg .c { margin-left: auto; font: 500 12px/1 var(--font-mono); color: var(--pop-muted); }
.sugg .foot { padding: 8px 10px 4px; font-size: 12px; color: var(--pop-muted); border-top: 1px solid var(--line); margin-top: 4px; }
.sugg kbd { font: 500 11px/1 var(--font-mono); border: 1px solid var(--line); border-radius: 5px; padding: 2px 5px; }

.hintrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; color: var(--band-muted); }
.ex { border: 1px solid var(--band-line); background: var(--band-glass); color: var(--band-fg); border-radius: 8px; padding: 4px 9px; font: 500 12.5px/1.3 var(--font-mono); }
.ex:hover { border-color: rgba(180, 155, 255, .7); }

/* active filters */
.active { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fchip { display: inline-flex; align-items: center; gap: 7px; padding: 3px 3px 3px 10px; border-radius: 9px; font-size: 13.5px;
  background: rgba(242, 193, 78, .12); border: 1px solid rgba(242, 193, 78, .42); color: var(--band-fg); max-width: 100%; }
.fchip .k { font: 600 10.5px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--sun); }
.fchip .v { font: 500 13px/1.3 var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fchip.neg { background: rgba(244, 63, 94, .12); border-color: rgba(244, 63, 94, .45); }
.fchip.neg .k { color: var(--rose); }
.fchip button { width: 24px; height: 24px; border: 0; border-radius: 7px; background: transparent; color: var(--band-muted); font-size: 16px; line-height: 1; flex: none; }
.fchip button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.orsep { font: 600 11px/1 var(--font-mono); color: var(--band-muted); letter-spacing: .08em; padding: 0 2px; }
.linkbtn { border: 0; background: transparent; color: var(--band-muted); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; padding: 4px; }
.linkbtn:hover { color: var(--band-fg); }

/* panels */
.panel { border: 1px solid var(--band-line); background: var(--band-deep); border-radius: 16px; padding: 16px; display: grid; gap: 16px; }
.adv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px 26px; }
.fs { min-width: 0; }
.fs.wide { grid-column: 1 / -1; }
.lg { margin: 0 0 8px; font: 600 10.5px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--band-muted); }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.ob { border: 1px solid var(--band-line); background: var(--band-glass); color: var(--band-fg); border-radius: 999px; padding: 5px 11px; font-size: 13px; display: inline-flex; gap: 7px; align-items: center; }
.ob small { font: 500 11px/1 var(--font-mono); color: var(--band-muted); }
.ob:hover:not(:disabled) { border-color: rgba(180, 155, 255, .7); }
.ob[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.ob[aria-pressed="true"] small { color: var(--muted); }
.ob:disabled { opacity: .38; }
.range { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.range label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--band-muted); }
.range input { width: 96px; padding: 7px 9px; border-radius: 9px; border: 1px solid var(--band-line); background: var(--band-deep); color: var(--band-fg); color-scheme: dark; font: 500 13px/1.2 var(--font-mono); }
.range input[type="month"] { width: 156px; }
.panel-foot { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; font-size: 13px; color: var(--band-muted); }
.gbtn { border: 1px solid var(--band-line); background: transparent; color: var(--band-fg); border-radius: 10px; padding: 7px 12px; font-size: 13.5px; }
.gbtn:hover { border-color: rgba(180, 155, 255, .7); }
.help .tbl { overflow-x: auto; }
.help table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.help th { text-align: left; font: 600 10.5px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--band-muted); padding: 0 10px 8px; }
.help td { padding: 7px 10px; border-top: 1px solid var(--band-line); vertical-align: middle; }
.help td:first-child { font: 500 13.5px/1.3 var(--font-mono); color: var(--sun); white-space: nowrap; }
.help td:last-child { white-space: nowrap; }
.keys { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--band-muted); }
.keys kbd { font: 500 12px/1 var(--font-mono); color: var(--band-fg); border: 1px solid var(--band-line); border-radius: 6px; padding: 3px 6px; margin-right: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { border: 1px solid var(--band-line); background: rgba(239, 236, 255, .05); color: var(--band-fg); border-radius: 999px; padding: 5px 11px; font-size: 13px; display: inline-flex; gap: 7px; align-items: center; }
.chip small { font: 500 11px/1 var(--font-mono); color: var(--band-muted); }
.chip[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.chip[aria-pressed="true"] small { color: var(--muted); }
.chip:disabled { opacity: .38; }

/* ---------- reader ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 22px 60px;
  display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 26px; align-items: start; }
.listhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.listhead b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.listhead .ms { font: 500 11.5px/1 var(--font-mono); }
.sort { display: inline-flex; align-items: center; gap: 6px; }
.sort select { border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 8px; padding: 5px 8px; font-size: 13px; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: calc(100vh - 110px); overflow: auto; position: sticky; top: 12px; border-top: 1px solid var(--line); }
.item { border-bottom: 1px solid var(--line); }
.item button { width: 100%; border: 0; background: transparent; text-align: left; padding: 11px 10px 11px 12px; border-radius: 10px; display: grid; gap: 4px; }
.item button:hover { background: var(--chip); }
.item button[aria-current="true"] { background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.item .t { font-weight: 500; line-height: 1.35; }
.item .snip { font-size: 13px; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item code.snip { display: block; font: 400 12.5px/1.5 var(--font-mono); color: var(--fg); background: var(--chip); padding: 4px 8px; border-radius: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .m { display: flex; flex-wrap: wrap; gap: 5px 9px; align-items: center; font-size: 12.5px; color: var(--muted); }
.item .m code { font: 500 11.5px/1.4 var(--font-mono); color: var(--accent-2); }
.badge { font: 500 10.5px/1 var(--font-mono); letter-spacing: .05em; text-transform: uppercase; padding: 4px 6px 3px; border-radius: 6px; background: var(--chip); color: var(--accent); }
.where { font: 500 10px/1 var(--font-mono); letter-spacing: .05em; text-transform: uppercase; padding: 3px 5px; border-radius: 5px; border: 1px solid var(--line); color: var(--accent-2); }
.empty { padding: 26px 12px; color: var(--muted); display: grid; gap: 10px; justify-items: start; }
.empty b { color: var(--fg); }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
mark.cur { background: var(--mark-cur); color: var(--ink); box-shadow: 0 0 0 2px var(--mark-cur); }

.note { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(18px, 3vw, 34px); }
.back { display: none; border: 0; background: transparent; color: var(--accent); padding: 0 0 12px; font-weight: 600; }
.hits { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 8px); z-index: 5; display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 7px 8px 7px 12px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 24px -16px rgba(22, 18, 58, .5); font-size: 13px; color: var(--muted); }
.hits b { color: var(--fg); font-variant-numeric: tabular-nums; }
.hits .sp { flex: 1; }
.hits button { border: 1px solid var(--line); background: var(--bg); color: var(--fg); min-width: 34px; height: 30px; border-radius: 8px; font-weight: 600; }
.nmeta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.nmeta .where-url { font: 500 12px/1.4 var(--font-mono); color: var(--accent-2); overflow-wrap: anywhere; }
.note h2.ttl { margin: 10px 0 8px; font: 400 clamp(24px, 3.2vw, 32px)/1.15 var(--font-display); letter-spacing: -.03em; text-wrap: balance; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.btn { border: 1px solid var(--line); background: var(--bg); color: var(--fg); padding: 8px 13px; border-radius: 10px; font-size: 13.5px; font-weight: 500; display: inline-flex; gap: 7px; align-items: center; }
.btn:hover { border-color: var(--accent); }
.btn.dark { background: var(--chip-on); color: var(--chip-on-fg); border-color: var(--chip-on); }
.tags { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.tags button { border: 0; background: transparent; padding: 0; font: 500 12px/1.4 var(--font-mono); color: var(--muted); }
.tags button:hover { color: var(--accent); }
.empty-note { color: var(--muted); display: grid; gap: 10px; justify-items: start; }

/* rendered markdown */
.md { max-width: 74ch; }
.md h3.sec { margin: 30px 0 10px; font: 600 12px/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); display: flex; align-items: center; gap: 10px; }
.md h3.sec::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.md h4 { margin: 20px 0 8px; font: 600 16.5px/1.3 var(--font-display); letter-spacing: -.01em; }
.md p { margin: 10px 0; }
.md ul, .md ol { margin: 10px 0; padding-left: 22px; display: grid; gap: 6px; }
.md li::marker { color: var(--muted); }
.md strong { font-weight: 600; }
.md a { color: var(--accent); }
.md blockquote { margin: 14px 0; padding: 12px 16px; border-radius: 12px; background: var(--quote-bg); }
.md blockquote p { margin: 4px 0; }
.md .tbl { overflow-x: auto; margin: 12px 0; border: 1px solid var(--line); border-radius: 12px; }
.md table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.md th, .md td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.md th { font-weight: 600; background: var(--chip); }
.md tr:last-child td { border-bottom: 0; }
.md code.ic { font: 500 .88em/1.4 var(--font-mono); background: var(--inline-bg); color: var(--inline-fg); padding: 1px 5px; border-radius: 5px; cursor: copy; overflow-wrap: anywhere; }
.md code.ic:hover { outline: 1px solid var(--accent); }
.code { position: relative; margin: 12px 0; border-radius: 12px; background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--code-line); }
.code .bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 8px 7px 14px; border-bottom: 1px solid var(--code-line); font: 500 11.5px/1 var(--font-mono); color: var(--code-dim); letter-spacing: .04em; }
.code .bar button { border: 1px solid var(--code-line); background: rgba(239, 236, 255, .06); color: var(--code-fg); padding: 5px 9px; border-radius: 7px; font: 500 12px/1 var(--font-body); }
.code .bar button:hover { border-color: var(--cyan); }
.code pre { margin: 0; overflow-x: auto; padding: 10px 0; font: 400 13.5px/1.65 var(--font-mono); tab-size: 4; }
.code .ln { display: flex; align-items: flex-start; gap: 6px; padding: 0 10px 0 14px; white-space: pre; min-height: 1.65em; }
.code .ln .tx { flex: 1; min-width: max-content; }
.code .ln.cm .tx { color: var(--code-dim); }
.code .ln .lc { flex: none; opacity: 0; border: 0; background: transparent; color: var(--cyan); padding: 0 4px; font: 500 11px/1.65 var(--font-mono); }
.code .ln:hover { background: rgba(239, 236, 255, .05); }
.code .ln:hover .lc, .code .ln .lc:focus-visible { opacity: 1; }
.code mark { color: var(--code-fg); }
.code mark.cur { color: var(--ink); }
@media (hover: none) { .code .ln .lc { opacity: .75; } .kbd { display: none; } }
.code.long pre { max-height: 360px; overflow: auto; }
.code.long.open pre { max-height: none; }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px); opacity: 0; transition: .18s ease;
  background: var(--ink); color: #fff; padding: 9px 14px; border-radius: 10px; font-size: 13.5px; z-index: 60; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 860px) {
  .wrap { grid-template-columns: minmax(0, 1fr); }
  .list { max-height: none; position: static; }
  .wrap.reading .side { display: none; }
  .wrap:not(.reading) .note { display: none; }
  .back { display: inline-block; }
  .band { padding-block: 18px 16px; }
  .seg { justify-self: stretch; }
  .seg button { flex: 1; justify-content: center; flex-direction: column; align-items: center; gap: 2px; padding: 7px 6px; }
  .searchbar { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
  .tbtn .lbl { display: none; }
  .tbtn { width: 50px; padding: 0; justify-content: center; position: relative; }
  .tbtn .n { position: absolute; top: -6px; right: -6px; }
  .search input { padding-right: 46px; }
  .chips, .hintrow { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -4px; padding: 2px 4px 4px;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .chips::-webkit-scrollbar, .hintrow::-webkit-scrollbar { display: none; }
  .chip, .ex { flex: none; }
  .hintrow > span { flex: none; }
  .help td:last-child { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
.band-in { grid-template-columns: minmax(0, 1fr); }
.band-in > * { min-width: 0; }
.searchbar { grid-template-columns: minmax(0, 1fr) auto auto auto; }
@media (max-width: 860px) { .searchbar { grid-template-columns: minmax(0, 1fr) auto auto auto; } #studybtn { width: 50px; } }
body { margin: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 99; background: #fff; color: var(--ink); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 12px; }
a.brand { text-decoration: none; }
.sitenav { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.sitenav a { color: var(--band-muted); text-decoration: none; font-size: 14px; font-weight: 500; padding: 7px 11px; border-radius: 9px; }
.sitenav a:hover { color: var(--band-fg); background: var(--band-glass); }
.sitenav a[aria-current="page"] { background: var(--paper); color: var(--ink); }
.lead { margin: 0; max-width: 70ch; color: var(--band-muted); font-size: 15px; }
.lead b { color: var(--band-fg); font-weight: 600; }
.study h3 { margin: 0 0 4px; font: 600 10.5px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--band-muted); }
.study .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 26px; }
.study ol { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.study li a { display: flex; gap: 10px; align-items: baseline; color: var(--band-fg); text-decoration: none; padding: 4px 6px; border-radius: 7px; font-size: 14px; }
.study li a:hover { background: var(--band-glass); }
.study li a span { font: 500 11.5px/1 var(--font-mono); color: var(--cyan); min-width: 2.2em; }
.study .big { display: flex; flex-wrap: wrap; gap: 8px; }
.study .big a { color: var(--band-fg); text-decoration: none; border: 1px solid var(--band-line); background: var(--band-glass); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.study .big a:hover { border-color: rgba(180, 155, 255, .7); }
.study .soon { color: var(--band-muted); font-size: 13px; margin: 6px 0 0; }
.cmdlinks { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-top: 14px; font-size: 13px; color: var(--muted); }
.cmdlinks a { font: 500 12.5px/1.3 var(--font-mono); color: var(--accent); text-decoration: none; border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; }
.cmdlinks a:hover { border-color: var(--accent); }
.srcs { margin-top: 10px; }
.lg.lg0 { margin: 0; }
.srcs a { color: var(--accent-2); }
.loading { padding: 30px 12px; color: var(--muted); }
@media (max-width: 860px) { .sitenav { width: 100%; overflow-x: auto; flex-wrap: nowrap; } .sitenav a { flex: none; } }
/* the site footer (same links as every other page) */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.site-footer { background: #0a081d; border-top: 1px solid rgba(196, 181, 253, .16); padding-block: 44px calc(30px + env(safe-area-inset-bottom, 0px)); margin-top: 40px; color: #efecff; }
.site-footer .container { max-width: 1240px; margin-inline: auto; padding-inline: max(20px, env(safe-area-inset-left, 0px)); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 32px; align-items: center; }
.site-footer .brand { display: inline-flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; background: none; padding: 0; box-shadow: none; }
.site-footer .brand-mark { width: 30px; height: 30px; }
.site-footer .brand-word { font: 600 19px/1 "Sora", system-ui, sans-serif; letter-spacing: -.02em; }
.footer-note { margin: 10px 0 0; font-size: 14px; color: #aea8d8; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14.5px; }
.footer-links a { color: #aea8d8; text-decoration: none; }
.footer-links a:hover { color: #efecff; }
.footer-copy { grid-column: 1 / -1; margin: 0; padding-top: 16px; border-top: 1px solid rgba(196, 181, 253, .16); font-size: 13.5px; color: #aea8d8; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
.seg { flex-wrap: wrap; max-width: 100%; }
.chip.more { border-style: dashed; }
@media (max-width: 860px) { .seg { display: flex; } .seg button { padding: 7px 10px; } }
