/* ============================================================ brandonstrain */
:root {
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --bg: #faf7f2;
  --bg-tint: #f3eee5;
  --surface: #ffffff;
  --ink: #1f1c17;
  --ink-soft: #4b4539;
  --muted: #7b7263;
  --rule: #e3dcd0;
  --rule-soft: #eee8dd;
  --accent: #8c3b23;
  --accent-ink: #6f2d19;
  --accent-wash: #f6ece7;
  --shadow: 0 1px 2px rgba(31, 28, 23, .05), 0 8px 24px -12px rgba(31, 28, 23, .18);
  --radius: 10px;
  --sidebar-w: 264px;
  --rail-w: 248px;
}
:root[data-theme="dark"] {
  --bg: #14130e;
  --bg-tint: #1a1913;
  --surface: #1c1b15;
  --ink: #ece7db;
  --ink-soft: #cdc5b5;
  --muted: #948c7c;
  --rule: #2f2d24;
  --rule-soft: #26251d;
  --accent: #e08a6a;
  --accent-ink: #f0a888;
  --accent-wash: #2a201a;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -14px rgba(0,0,0,.7);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #14130e; --bg-tint: #1a1913; --surface: #1c1b15;
    --ink: #ece7db; --ink-soft: #cdc5b5; --muted: #948c7c;
    --rule: #2f2d24; --rule-soft: #26251d;
    --accent: #e08a6a; --accent-ink: #f0a888; --accent-wash: #2a201a;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -14px rgba(0,0,0,.7);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--serif); font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent-ink); text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--accent); }
img { max-width: 100%; height: auto; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.2rem 0; }
kbd {
  font-family: var(--sans); font-size: .68rem; padding: .1em .38em; border-radius: 4px;
  border: 1px solid var(--rule); background: var(--bg-tint); color: var(--muted);
}
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

/* ================================================================= homepage */
body.home {
  display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 2rem;
}
.home-wrap { width: 100%; max-width: 46rem; }
.home-head h1 {
  font-size: clamp(2.2rem, 6vw, 3.1rem); line-height: 1.05; margin: 0 0 .6rem;
  letter-spacing: -.02em; font-weight: 600;
}
.home-sub { color: var(--muted); font-size: 1.05rem; max-width: 34rem; margin: 0; }
.home-projects { margin-top: 3.5rem; }
.home-projects h2 {
  font-family: var(--sans); font-size: .7rem; font-weight: 600; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 1rem;
}
.home-projects ul { list-style: none; padding: 0; margin: 0; }
.home-projects li { padding: 1.1rem 0; border-top: 1px solid var(--rule); }
.proj { display: flex; align-items: baseline; gap: .75rem; text-decoration: none; color: var(--ink); }
.proj-name { font-size: 1.2rem; font-weight: 600; border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.proj:hover .proj-name { border-bottom-color: var(--accent); color: var(--accent-ink); }
.proj-meta { font-family: var(--sans); font-size: .72rem; color: var(--muted); }
.proj-desc { margin: .4rem 0 0; color: var(--muted); font-size: .95rem; max-width: 40rem; }
.home-foot { margin-top: 3.5rem; }
.theme-toggle {
  font-family: var(--sans); font-size: .72rem; color: var(--muted); background: none;
  border: 1px solid var(--rule); border-radius: 99px; padding: .3rem .7rem; cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--muted); }
.empty { color: var(--muted); }

/* =================================================================== topbar */
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: .5rem;
  height: 52px; padding: 0 .9rem; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
}
.brand { font-weight: 600; font-size: .88rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-sep { color: var(--rule); }
.brand-garden { font-size: .88rem; color: var(--muted); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-garden:hover, .brand:hover { color: var(--accent-ink); }
.spacer { flex: 1; }
.icon-btn {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--bg-tint); color: var(--ink); }
.nav-toggle { display: none; }
.search-btn {
  display: flex; align-items: center; gap: .45rem; font-family: var(--sans); font-size: .78rem;
  color: var(--muted); background: var(--surface); border: 1px solid var(--rule);
  border-radius: 99px; padding: .3rem .7rem; cursor: pointer;
}
.search-btn:hover { border-color: var(--muted); color: var(--ink); }
.search-btn kbd { margin-left: .2rem; }

/* ==================================================================== shell */
.shell {
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--rail-w);
  gap: 2.5rem; max-width: 1440px; margin: 0 auto; padding: 0 1.5rem;
  align-items: start;
}
/* ================================================================== sidebar */
.sidebar {
  position: sticky; top: 52px; max-height: calc(100dvh - 52px); overflow-y: auto;
  padding: 1.4rem .4rem 3rem 0; font-family: var(--sans); font-size: .82rem;
  scrollbar-width: thin;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.nav-top { margin-bottom: 1.1rem; }
.nav-top li a { display: block; padding: .28rem .5rem; border-radius: 6px; color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.nav-top li a:hover { background: var(--bg-tint); color: var(--ink); }
.nav-top li.current > a { background: var(--accent-wash); color: var(--accent-ink); }
.nav-section { border-top: 1px solid var(--rule-soft); }
.nav-section > summary {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .5rem .5rem; cursor: pointer; list-style: none;
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.nav-section > summary::-webkit-details-marker { display: none; }
.nav-section > summary:hover { color: var(--ink); }
.nav-section .count { font-size: .62rem; letter-spacing: 0; opacity: .7; }
.nav-section ul { padding: 0 0 .6rem; }
.nav-section li a {
  display: block; padding: .22rem .5rem .22rem .75rem; border-radius: 6px; color: var(--ink-soft);
  text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-section li a:hover { background: var(--bg-tint); color: var(--ink); }
.nav-section li.current > a { background: var(--accent-wash); color: var(--accent-ink); font-weight: 600; }
.nav-section li.more a { color: var(--muted); font-size: .75rem; }

/* ================================================================== content */
.content { padding: 1.6rem 0 6rem; min-width: 0; max-width: 44rem; }
.crumbs { font-family: var(--sans); font-size: .74rem; color: var(--muted); margin-bottom: 1.1rem; display: flex; flex-wrap: wrap; gap: .35rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-ink); }
.crumbs .here { color: var(--ink-soft); }
.note-title { font-size: clamp(1.75rem, 3.6vw, 2.35rem); line-height: 1.15; letter-spacing: -.015em; margin: 0 0 .4rem; font-weight: 600; }
.note-meta { font-family: var(--sans); font-size: .78rem; color: var(--muted); margin: 0 0 1.4rem; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin: -.8rem 0 1.4rem; }
.tag { font-family: var(--sans); font-size: .7rem; color: var(--muted); background: var(--bg-tint); border-radius: 99px; padding: .12rem .55rem; }

/* ==================================================================== prose */
.prose { font-size: 1.02rem; }
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { line-height: 1.25; letter-spacing: -.01em; font-weight: 600; scroll-margin-top: 4.5rem; }
.prose h1 { font-size: 1.9rem; margin: 2.4rem 0 .8rem; }
.prose h2 { font-size: 1.35rem; margin: 2.3rem 0 .7rem; padding-bottom: .3rem; border-bottom: 1px solid var(--rule-soft); }
.prose h3 { font-size: 1.1rem; margin: 1.8rem 0 .5rem; }
.prose h4 { font-size: .95rem; margin: 1.4rem 0 .4rem; color: var(--ink-soft); }
.prose p { margin: 0 0 1.05rem; }
.prose ul, .prose ol { margin: 0 0 1.05rem; padding-left: 1.35rem; }
.prose li { margin: .25rem 0; }
.prose li > ul, .prose li > ol { margin: .25rem 0 .35rem; }
.prose li.task { list-style: none; margin-left: -1.1rem; }
.prose li.task input { margin-right: .4rem; }
.prose blockquote {
  margin: 1.2rem 0; padding: .1rem 0 .1rem 1.1rem; border-left: 3px solid var(--rule);
  color: var(--ink-soft); font-style: italic;
}
.prose code {
  font-family: var(--mono); font-size: .86em; background: var(--bg-tint);
  border: 1px solid var(--rule-soft); border-radius: 5px; padding: .08em .35em;
}
.prose pre.code {
  font-family: var(--mono); font-size: .82rem; line-height: 1.6; background: var(--bg-tint);
  border: 1px solid var(--rule); border-radius: var(--radius); padding: .9rem 1rem; overflow-x: auto; margin: 1.2rem 0;
}
.prose pre.code code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; padding: 0 .15em; border-radius: 3px; }
.prose .anchor {
  margin-left: .35rem; color: var(--rule); text-decoration: none; font-weight: 400;
  opacity: 0; transition: opacity .15s;
}
.prose h1:hover .anchor, .prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor { opacity: 1; }
.prose .anchor:hover { color: var(--accent); }

.table-wrap { overflow-x: auto; margin: 1.3rem 0; border: 1px solid var(--rule); border-radius: var(--radius); }
.prose table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: .82rem; }
.prose th, .prose td { padding: .5rem .7rem; text-align: left; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.prose thead th { background: var(--bg-tint); font-weight: 600; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:hover { background: color-mix(in srgb, var(--bg-tint) 60%, transparent); }

.wikilink { text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 38%, transparent); }
.wikilink:hover { border-bottom-color: var(--accent); background: var(--accent-wash); }
.wikilink.broken { color: var(--muted); border-bottom: 1px dashed var(--rule); cursor: help; }
.wikilink.file::after { content: " ↗"; font-size: .75em; opacity: .6; }

.callout {
  margin: 1.3rem 0; border: 1px solid var(--rule); border-left: 3px solid var(--accent);
  border-radius: var(--radius); background: var(--surface); padding: .8rem 1rem; box-shadow: var(--shadow);
}
.callout-title { font-family: var(--sans); font-weight: 600; font-size: .82rem; letter-spacing: .01em; color: var(--accent-ink); }
.callout-body { margin-top: .4rem; font-size: .95rem; }
.callout-body > :last-child { margin-bottom: 0; }
.callout-warning, .callout-caution, .callout-danger { border-left-color: #b4622a; }
.callout-warning .callout-title, .callout-caution .callout-title, .callout-danger .callout-title { color: #b4622a; }
.callout-tip, .callout-success, .callout-check { border-left-color: #4c7a4c; }
.callout-tip .callout-title, .callout-success .callout-title, .callout-check .callout-title { color: #4c7a4c; }
.callout-note, .callout-info, .callout-abstract, .callout-summary { border-left-color: #4a6b8a; }
.callout-note .callout-title, .callout-info .callout-title, .callout-abstract .callout-title, .callout-summary .callout-title { color: #4a6b8a; }
:root[data-theme="dark"] .callout-tip .callout-title { color: #8fbf8f; }
:root[data-theme="dark"] .callout-note .callout-title, :root[data-theme="dark"] .callout-info .callout-title { color: #8bb3d6; }

.footnotes { font-size: .88rem; color: var(--ink-soft); }
.fnref a { text-decoration: none; padding: 0 .12em; }

/* ===================================================================== rail */
.rail { position: sticky; top: 52px; max-height: calc(100dvh - 52px); overflow-y: auto; padding: 2.6rem 0 3rem; font-family: var(--sans); }
.rail-inline { display: none; margin-top: 2.5rem; border-top: 1px solid var(--rule); padding-top: 1.2rem; font-family: var(--sans); }
.rail-block + .rail-block { margin-top: 1.8rem; }
.rail-block h3 {
  font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
  margin: 0 0 .6rem; font-weight: 600; display: flex; align-items: center; gap: .4rem;
}
.pill { background: var(--bg-tint); border-radius: 99px; padding: 0 .4rem; font-size: .62rem; letter-spacing: 0; }
.toc, .backlinks { list-style: none; margin: 0; padding: 0; font-size: .78rem; }
.toc li a, .backlinks li a { display: block; padding: .18rem 0; color: var(--ink-soft); text-decoration: none; }
.toc li a:hover, .backlinks li a:hover { color: var(--accent-ink); }
.toc li.lvl-3 { padding-left: .8rem; font-size: .74rem; }
.toc li.active > a { color: var(--accent-ink); font-weight: 600; }
.backlinks li { padding: .3rem 0; border-bottom: 1px solid var(--rule-soft); }
.bl-sec { display: block; font-size: .66rem; color: var(--muted); }

/* ============================================================ garden front */
.front-head { margin-bottom: 2rem; }
.front-head h1 { font-size: clamp(2rem, 4.4vw, 2.8rem); line-height: 1.1; margin: 0 0 .6rem; letter-spacing: -.02em; font-weight: 600; }
.tagline { color: var(--ink-soft); font-size: 1.05rem; margin: 0 0 .7rem; }
.front-stats { font-family: var(--sans); font-size: .76rem; color: var(--muted); margin: 0; }
.sec-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .6rem; margin-bottom: 2.6rem; }
.sec-card {
  display: flex; flex-direction: column; gap: .15rem; padding: .75rem .85rem; text-decoration: none;
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); color: var(--ink);
}
.sec-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.sec-name { font-family: var(--sans); font-weight: 600; font-size: .85rem; }
.sec-count { font-family: var(--sans); font-size: .7rem; color: var(--muted); }

/* ================================================================= listings */
.note-list { list-style: none; margin: 0; padding: 0; }
.note-list li { border-top: 1px solid var(--rule-soft); }
.note-list li a { display: block; padding: .7rem .3rem; text-decoration: none; color: var(--ink); border-radius: 6px; }
.note-list li a:hover { background: var(--bg-tint); }
.nl-title { display: block; font-weight: 600; font-size: 1rem; }
.nl-ex, .nl-sec { display: block; font-family: var(--sans); font-size: .74rem; color: var(--muted); margin-top: .12rem; }
.note-list.compact li a { padding: .4rem .3rem; display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.note-list.compact .nl-title { font-weight: 500; font-size: .92rem; }
.note-list.compact .nl-sec { margin: 0; white-space: nowrap; }
.alpha h2 { font-family: var(--sans); font-size: .8rem; color: var(--accent-ink); margin: 1.8rem 0 .3rem; letter-spacing: .08em; }
.alpha-jump { display: flex; flex-wrap: wrap; gap: .25rem; margin: 1rem 0 .5rem; font-family: var(--sans); font-size: .74rem; }
.alpha-jump a { padding: .1rem .38rem; border-radius: 5px; text-decoration: none; color: var(--muted); border: 1px solid var(--rule-soft); }
.alpha-jump a:hover { color: var(--accent-ink); border-color: var(--accent); }

.year { margin-bottom: 2rem; }
.year-head { display: flex; align-items: baseline; gap: .6rem; font-family: var(--sans); font-size: .95rem; margin: 0 0 .3rem; padding-bottom: .25rem; border-bottom: 1px solid var(--rule); }
.year-head .count { font-size: .7rem; color: var(--muted); font-weight: 400; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { border-bottom: 1px solid var(--rule-soft); padding: .45rem 0; }
.timeline li.stub { opacity: .55; }
.timeline a { display: flex; gap: .8rem; align-items: baseline; text-decoration: none; color: var(--ink); }
.tl-date { font-family: var(--sans); font-size: .72rem; color: var(--muted); min-width: 8.4rem; }
.tl-title { font-weight: 600; font-size: .96rem; }
.timeline a:hover .tl-title { color: var(--accent-ink); }
.tl-ex { display: block; font-family: var(--sans); font-size: .73rem; color: var(--muted); margin-left: 9.2rem; margin-top: .1rem; }
.tl-flag { font-family: var(--sans); font-size: .66rem; color: var(--muted); margin-left: 9.2rem; }
@media (max-width: 620px) {
  .timeline a { flex-direction: column; gap: .1rem; }
  .tl-ex, .tl-flag { margin-left: 0; }
}

/* =================================================================== search */
.search-modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: start center; padding: 8vh 1rem 1rem; }
.search-modal[hidden] { display: none; }
.search-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--ink) 40%, transparent); backdrop-filter: blur(2px); }
.search-panel {
  position: relative; width: min(100%, 620px); background: var(--surface); border: 1px solid var(--rule);
  border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; font-family: var(--sans);
}
.search-input {
  width: 100%; border: 0; border-bottom: 1px solid var(--rule); background: none; color: var(--ink);
  font-family: var(--sans); font-size: 1rem; padding: .95rem 1.1rem; outline: none;
}
.search-results { max-height: min(58vh, 460px); overflow-y: auto; }
.search-results:empty { display: none; }
.sr-item { display: block; padding: .6rem 1.1rem; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--rule-soft); }
.sr-item:hover, .sr-item.active { background: var(--accent-wash); }
.sr-title { font-weight: 600; font-size: .9rem; }
.sr-sec { font-size: .68rem; color: var(--muted); margin-left: .5rem; }
.sr-ex { display: block; font-size: .76rem; color: var(--muted); margin-top: .1rem; line-height: 1.5; }
.sr-ex b { color: var(--accent-ink); font-weight: 600; }
.sr-empty { padding: 1.2rem; color: var(--muted); font-size: .85rem; }
.search-foot { display: flex; gap: .4rem; align-items: center; padding: .5rem 1.1rem; font-size: .68rem; color: var(--muted); border-top: 1px solid var(--rule-soft); background: var(--bg-tint); }

/* ==================================================================== graph */
.graph-content { max-width: none; }
.graph-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 1rem 0 .7rem; font-family: var(--sans); font-size: .78rem; }
.graph-filter { flex: 1 1 200px; max-width: 280px; padding: .35rem .7rem; border: 1px solid var(--rule); border-radius: 99px; background: var(--surface); color: var(--ink); font-family: var(--sans); font-size: .78rem; outline: none; }
.graph-filter:focus { border-color: var(--accent); }
.graph-check { color: var(--muted); display: flex; align-items: center; gap: .3rem; }
.graph-reset { font-family: var(--sans); font-size: .74rem; color: var(--muted); background: var(--surface); border: 1px solid var(--rule); border-radius: 99px; padding: .28rem .7rem; cursor: pointer; }
.graph-reset:hover { color: var(--ink); border-color: var(--muted); }
.graph-wrap { position: relative; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--surface); height: min(72vh, 720px); }
.graph-wrap canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.graph-wrap canvas:active { cursor: grabbing; }
.graph-legend { position: absolute; left: .7rem; bottom: .7rem; display: flex; flex-wrap: wrap; gap: .3rem .7rem; font-family: var(--sans); font-size: .68rem; color: var(--muted); background: color-mix(in srgb, var(--surface) 85%, transparent); padding: .4rem .6rem; border-radius: 8px; border: 1px solid var(--rule-soft); max-width: calc(100% - 1.4rem); }
.graph-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.graph-legend i { width: 8px; height: 8px; border-radius: 99px; display: inline-block; }
.graph-tip { position: absolute; pointer-events: none; font-family: var(--sans); font-size: .74rem; background: var(--ink); color: var(--bg); padding: .25rem .5rem; border-radius: 6px; transform: translate(-50%, -160%); white-space: nowrap; z-index: 5; }

/* ================================================================ tag cloud */
.tag-cloud { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.2rem; font-family: var(--sans); }
.tag-chip {
  display: inline-flex; align-items: baseline; gap: .35rem; text-decoration: none;
  border: 1px solid var(--rule); border-radius: 99px; padding: .25rem .7rem;
  color: var(--ink); background: var(--surface); line-height: 1.4;
}
.tag-chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.tag-chip span { font-size: .68rem; color: var(--muted); }
.tl-ex b { color: var(--ink-soft); font-weight: 600; }

/* ------------------------------------------------------- graph legend chips */
.graph-legend { gap: .25rem .4rem; }
.graph-legend .lg {
  display: inline-flex; align-items: center; gap: .3rem; font: inherit; color: var(--muted);
  background: none; border: 1px solid transparent; border-radius: 99px;
  padding: .1rem .4rem; cursor: pointer;
}
.graph-legend .lg:hover { border-color: var(--rule); color: var(--ink); }
.graph-legend .lg.off { opacity: .38; text-decoration: line-through; }
.graph-legend .lg i { width: 8px; height: 8px; border-radius: 99px; display: inline-block; flex: none; }
.lg-hint { opacity: .6; font-style: italic; padding-left: .2rem; }
.bl-more > summary { font-family: var(--sans); font-size: .72rem; color: var(--muted); cursor: pointer; padding: .35rem 0; list-style: none; }
.bl-more > summary::-webkit-details-marker { display: none; }
.bl-more > summary::before { content: "+ "; }
.bl-more[open] > summary::before { content: "− "; }
.bl-more > summary:hover { color: var(--accent-ink); }

/* ============================================================== responsive */
/* Kept at the end of the stylesheet on purpose: these override base rules of
   equal specificity, so they have to come last in the cascade. */
@media (max-width: 1180px) { .shell { grid-template-columns: var(--sidebar-w) minmax(0,1fr); } .rail { display: none; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0,1fr); gap: 0; padding: 0 1.1rem; }
  .nav-toggle { display: grid; }
  .sidebar {
    position: fixed; inset: 52px auto 0 0; width: min(84vw, 320px); z-index: 39;
    background: var(--bg); border-right: 1px solid var(--rule); padding: 1rem 1rem 3rem;
    transform: translateX(-101%); transition: transform .22s ease; overflow-y: auto; height: calc(100dvh - 52px);
  }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .rail-inline { display: block !important; }
}

@media (max-width: 620px) {
  .brand-garden { flex: 1 1 auto; min-width: 0; }
  .search-btn span, .search-btn kbd { display: none; }
  .search-btn { padding: .3rem .45rem; }
  .topbar { gap: .35rem; padding: 0 .5rem; }
}
