/* 5e Advanced — Offline Reader
   Keep it simple, readable, and mildly ominous. */

:root{
  --bg: #0b0f14;
  --panel: #0f1520;
  --panel2: #0c121b;
  --text: #e7eef7;
  --muted: rgba(231,238,247,.72);
  --faint: rgba(231,238,247,.14);
  --accent: #a7c5ff;
  --danger: #ff6b6b;

  --shadow: 0 14px 45px rgba(0,0,0,.55);
  --radius: 18px;

  --fontScale: 1;
  --lineHeight: 1.65;

  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --heading: "AniMeMatric", var(--mono);
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Noto Sans", "Helvetica Neue", Arial, "Apple Color Emoji","Segoe UI Emoji";
}

:root[data-theme="light"]{
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel2: #fbfcff;
  --text: #111827;
  --muted: rgba(17,24,39,.70);
  --faint: rgba(17,24,39,.12);
  --accent: #1f4fff;
  --danger: #b42318;
  --shadow: 0 14px 45px rgba(17,24,39,.18);
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  background: radial-gradient(1200px 800px at 15% 0%, rgba(167,197,255,.10), transparent 55%),
              radial-gradient(900px 600px at 80% 20%, rgba(255,107,107,.06), transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: var(--sans);
}

.app{
  height:100%;
  display:flex;
  flex-direction:column;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--faint);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0));
  backdrop-filter: blur(10px);
}

.brand{
  display:flex;
  gap:12px;
  align-items:center;
}
.brand__mark{
  width:36px; height:36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(167,197,255,.35), rgba(167,197,255,.05));
  border: 1px solid var(--faint);
  box-shadow: var(--shadow);
  display:flex; align-items:center; justify-content:center;
  font-family: var(--mono);
  color: var(--accent);
}
.brand__title{
  font-family: var(--mono);
  letter-spacing: .12em;
  font-size: 12px;
}
.brand__subtitle{
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.topbar__actions{ display:flex; gap:10px; align-items:center; }

.layout{
  display:grid;
  grid-template-columns: 340px 1fr;
  gap: 14px;
  padding: 14px;
  height: calc(100% - 68px);
  overflow:hidden;
}

.sidebar{
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0));
  border: 1px solid var(--faint);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.sidebar__inner{
  height:100%;
  display:flex;
  flex-direction:column;
}
.sidebar__search{
  padding: 14px 14px 8px 14px;
  border-bottom: 1px solid var(--faint);
}
.sidebar__footer{
  margin-top:auto;
  padding: 12px 14px 14px 14px;
  border-top: 1px solid var(--faint);
}

.searchResults{
  display: none;
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  overflow: hidden;
}

.search-hit{
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.search-hit:last-child{ border-bottom: 0; }

.search-hit-title{
  font-weight: 700;
  margin-bottom: 4px;
}

.search-hit-snippet{
  opacity: 0.85;
  font-size: 0.9em;
  line-height: 1.2em;
}

.search-empty{
  padding: 10px 12px;
  opacity: 0.85;
}

/* Mobile: hide sidebar by default */
@media (max-width: 900px){
  /* Sidebar: off-canvas by default */
  #sidebar{
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(340px, 86vw);
    transform: translateX(-110%) !important;
    transition: transform 180ms ease;
    z-index: 50;
  }

  /* When open */
  body.sidebar-open #sidebar{
    transform: translateX(0) !important;
  }

  /* Overlay */
  #sidebarOverlay{
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 40;
  }
  body.sidebar-open #sidebarOverlay{
    display: block;
  }
}

.reader{
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0));
  border: 1px solid var(--faint);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:auto;
}

.page{
  padding: 22px;
  max-width: 980px;
  margin: 0 auto;
  font-size: calc(16px * var(--fontScale));
  line-height: var(--lineHeight);
}

.page__header{ margin-bottom: 18px; }
.page__title{
  margin: 10px 0 6px 0;
  font-size: 28px;
  letter-spacing: .01em;
}
.page__meta{ color: var(--muted); font-size: 13px; }
.crumbs{ color: var(--muted); font-size: 12px; font-family: var(--mono); }

.page__content{
  padding: 18px 16px;
  background: var(--panel2);
  border: 1px solid var(--faint);
  border-radius: 14px;
}

/* Big headings use the display font */
.page__title,
.page__content h1,
.page__content h2{
  font-family: var(--heading);
  letter-spacing: .04em;
}

/* Markdown content styling */
.page__content h1, .page__content h2, .page__content h3{
  margin-top: 22px;
  margin-bottom: 10px;
  clear: both;
}
.page__content h2{
  border-top: 1px dashed var(--faint);
  padding-top: 16px;
}
.page__content p{ margin-bottom: 1.6em; margin-top: 0.6em }
.page__content code{
  font-family: var(--mono);
  font-size: .95em;
  background: rgba(167,197,255,.10);
  border: 1px solid var(--faint);
  padding: 2px 6px;
  border-radius: 4px;
}
.page__content pre{
  overflow:auto;
  padding: 12px 12px;
  border-radius: 12px;
  background: #070a0f;
  border: 1px solid var(--faint);
}
:root[data-theme="light"] .page__content pre{ background: #0b1020; color: #e7eef7; }

/* Collapsible H2 */
.page__content h2 {
  cursor: pointer;
  position: relative;
  padding-left: 1.2em;
}

/* Collapsible H2 */
.page__content h2 {
  cursor: pointer;
  position: relative;
  padding-left: 1.2em;
}

/* Disclosure triangle — OPEN by default */
.page__content h2::before {
  content: "▸";
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0.7;
  transition: transform 0.15s ease;

  /* default = open */
  transform: rotate(90deg);
}

/* When collapsed, point right */
.page__content h2:not(.is-open)::before {
  transform: rotate(0deg);
}

/* Section body */
.h2-section {
  margin-left: 0.25em;
}

.h2-section.is-collapsed {
  display: none;
}

.page__content blockquote{
  margin: 14px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: rgba(167,197,255,.07);
  border-radius: 10px;
  color: var(--text);
}

.page__content .log,
.page__content .alert,
.page__content .procedure,
.page__content .directive,
.page__content .classified,
.page__content .epigraph{
  margin: 1.6em;
}

.page__content .alert{
  border: 1px solid rgba(255,107,107,.30);
  background: rgba(255,107,107,.08);
  padding: 10px 12px;
  border-radius: 12px;
}
.page__content .log{
  border: 1px solid var(--faint);
  background: #070a0f;
  padding: 10px 12px;
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: rgba(231,238,247,.88);
}

.page__content .epigraph{
  border: 1px dashed var(--faint);
  background: rgba(255,255,255,.03);
  padding: 12px 12px;
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(231,238,247,.80);
  overflow: auto;
}
.page__content .epigraph em{
  color: var(--muted);
}

.page__content .procedure{	
  border: 1px solid rgba(167,197,255,.28);
  background: rgba(167,197,255,.07);
  padding: 12px 12px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.page__content .procedure strong{
  font-family: var(--mono);
  letter-spacing: .06em;
}

.page__content .directive{
  border: 1px solid rgba(231,238,247,.22);
  background: rgba(255,255,255,.04);
  padding: 12px 12px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.page__content .directive::before{
  content: "DIRECTIVE";
  position: absolute;
  top: 10px;
  right: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--muted);
}

.page__content .approved{
  border: 1px solid rgba(120,255,185,.22);
  background: rgba(120,255,185,.06);
  padding: 12px 12px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.page__content .approved::before{
  content: "APPROVED";
  position: absolute;
  top: 10px;
  right: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--muted);
}

.page__content .classified{
  border: 1px dashed rgba(255,107,107,.45);
  background: rgba(255,107,107,.08);
  padding: 12px 12px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.page__content .classified::before{
  content: "CLASSIFIED";
  position: absolute;
  top: 10px;
  left: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  color: rgba(255,107,107,.85);
}

.page__content .classified::after{
  content:"";
  position:absolute;
  inset:0;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(0,0,0,.0),
      rgba(0,0,0,.0) 6px,
      rgba(0,0,0,.06) 6px,
      rgba(0,0,0,.06) 9px
    );
  opacity: .35;
  pointer-events:none;
}

/* Whiteout-flavored callouts */
.page__content .callout{
  margin: 1.6em;
  border-radius: 12px;
  border: 1px solid var(--faint);
  background: rgba(255,255,255,.03);
  overflow: hidden;
}

.page__content .callout__hdr{
  border-bottom: 1px solid var(--faint);
  background: rgba(0,0,0,.18);
  font-family: var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 11px;
  padding: 10px 12px;
  color: rgba(231,238,247,.86);
}

.page__content .callout__body{
  padding: 12px 12px;
  color: rgba(231,238,247,.82);
}

/* Kind accents that match palette language */
.page__content .callout[data-kind="note"]{
  border-color: rgba(167,197,255,.22);
  background: rgba(167,197,255,.06);
}
.page__content .callout[data-kind="note"] .callout__hdr{
  border-bottom-color: rgba(167,197,255,.22);
  font-size: 14px;
}

.page__content .callout[data-kind="tip"]{
  border-color: rgba(120,255,185,.22);
  background: rgba(120,255,185,.06);
}
.page__content .callout[data-kind="tip"] .callout__hdr{
  border-bottom-color: rgba(120,255,185,.22);
  font-size: 14px;
}

.page__content .callout[data-kind="warning"]{
  border-color: rgba(255,107,107,.30);
  background: rgba(255,107,107,.08);
}
.page__content .callout[data-kind="warning"] .callout__hdr{
  border-bottom-color: rgba(255,107,107,.30);
  font-size: 14px;
}

/* Dark "log" callout */
.page__content .callout[data-kind="log"]{
  border: 1px solid var(--faint);
  background: #070a0f;
}

.page__content .callout[data-kind="log"] .callout__hdr{
  border-bottom: 1px solid var(--faint);
  background: rgba(255,255,255,.03);
  text-transform: uppercase;
  font-size: 14px;
  color: rgba(231,238,247,.88);
}

.page__content .callout[data-kind="log"] .callout__body{
  color: rgba(231,238,247,.88);
}

.page__content table{
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
}

.page__content th,
.page__content td{
  border: 1px solid var(--faint);
  padding: 8px 10px;
}

.page__content th{
  background: rgba(255,255,255,.06);
  font-family: var(--mono);
}

.page__content img.inline-left{
  float: left;
  margin: 0 16px 12px 0;
  max-width: 45%;
}

.page__content h2, .page__content h3{
  clear: both;
}

.page__content hr{
  border: 0;
  border-top: 1px solid var(--faint);
  margin: 20px 0;
  opacity: .8;
}

.toc{
  padding: 10px 10px 12px 10px;
  overflow:auto;
}
.toc__group{
  margin: 10px 0 12px 0;
}
.toc__groupTitle{
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: .14em;
  color: var(--muted);
  padding: 10px 10px 6px 10px;
}
.toc__item{
  display:flex;
  gap:10px;
  padding: 10px 10px;
  border-radius: 12px;
  cursor:pointer;
  border: 1px solid transparent;
}
.toc__item:hover{
  background: rgba(167,197,255,.06);
  border-color: var(--faint);
}
.toc__item.is-active{
  background: rgba(167,197,255,.10);
  border-color: rgba(167,197,255,.26);
}
.toc__itemTitle{
  font-size: 14px;
}
.toc__itemMeta{
  font-size: 12px;
  color: var(--muted);
}

.toc__pills{
margin-top: 6px;
display: flex;
flex-wrap: wrap;
gap: 6px;
}


.pill{
display: inline-block;
font-size: 10px;
font-family: var(--mono);
letter-spacing: .08em;
padding: 2px 6px;
border-radius: 999px;
border: 1px solid var(--faint);
opacity: .75;
}


.pill--rules{
  color: #a7c5ff;
  border-color: rgba(167,197,255,.35);
  background: rgba(167,197,255,.12);
}

.pill--lore{
  color: #9fd4a9;
  border-color: rgba(159,212,169,.35);
  background: rgba(159,212,169,.12);
}

.pill--classified{
  color: #ff9b9b;
  border-color: rgba(255,155,155,.40);
  background: rgba(255,155,155,.14);
}

.pill--gamemaster{
  color: #e6d6a8;
  border-color: rgba(230,214,168,.35);
  background: rgba(230,214,168,.14);
}

.pill--wip{
color: rgba(231,238,247,.55);
border-color: rgba(0,0,0,.45);
background: rgba(0,0,0,.35);
}

.pill--character{
color: rgba(231,238,247,.65);
border-color: rgba(231,238,247,.25);
background: rgba(231,238,247,.16);
}

.pill--hybrid{
color: #c2a8ff;
border-color: rgba(194,168,255,.35);
background: rgba(194,168,255,.14);
}

.pill--advanced{
color: #ffcc88;
border-color: rgba(255,204,136,.35);
background: rgba(255,204,136,.14);
}

.pill--optional{
color: #8fd3c8;
border-color: rgba(143,211,200,.35);
background: rgba(143,211,200,.14);
}

.input{
  width:100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--faint);
  background: var(--panel);
  color: var(--text);
  outline:none;
}
.input:focus{
  border-color: rgba(167,197,255,.40);
  box-shadow: 0 0 0 4px rgba(167,197,255,.10);
}

.btn{
  border: 1px solid var(--faint);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-family: var(--mono);
  letter-spacing:.04em;
}
.btn:hover{
  border-color: rgba(167,197,255,.35);
  background: rgba(167,197,255,.06);
}
.btn--ghost{
  background: transparent;
}
.btn__label{ font-size: 12px; }

.page__nav{
  display:flex;
  justify-content:space-between;
  margin-top: 16px;
  padding-bottom: 18px;
}

.small{ font-size: 12px; }
.muted{ color: var(--muted); }
kbd{
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--faint);
  border-radius: 8px;
  background: rgba(255,255,255,.04);
}

.toast{
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.65);
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  padding: 10px 12px;
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 12px;
  opacity: 0;
  pointer-events:none;
  transition: opacity .18s ease;
}
.toast.is-show{ opacity: 1; }

/* Responsive */
@media (max-width: 980px){
  .layout{
    grid-template-columns: 1fr;
  }
  .sidebar{
    max-height: 44vh;
  }
}

/* Splash / Integrity Check */
.splash{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(1100px 800px at 20% 0%, rgba(167,197,255,.14), transparent 55%),
    radial-gradient(900px 600px at 80% 30%, rgba(255,107,107,.10), transparent 55%),
    var(--bg);
  transition: opacity .25s ease, transform .25s ease;
}

.splash__panel{
  width: min(1000px, 100%);
  min-height: 60vh;
  max-height: 32vh;
  border-radius: 22px;
  border: 1px solid var(--faint);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0));
  box-shadow: var(--shadow);
  padding: 22px 20px 18px 20px;
  position: relative;
  overflow: hidden;
}

.splash__panel::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255,255,255,.06),
      rgba(255,255,255,.06) 1px,
      transparent 1px,
      transparent 6px
    );
  opacity: .08;
  pointer-events:none;
}

.splash__panel::after{
  content:"";
  position:absolute;
  inset:0;
  background: radial-gradient(800px 240px at 50% -10%, rgba(167,197,255,.18), transparent 60%);
  opacity: .55;
  pointer-events:none;
}

.splash__mark{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--faint);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  color: var(--accent);
  background: rgba(167,197,255,.10);
  margin-bottom: 12px;
}

.splash__title{
  font-family: var(--mono);
  letter-spacing: .16em;
  font-size: 14px;
  margin-bottom: 6px;
}

.splash__subtitle{
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

.splash__log{
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(231,238,247,.85);
  border: 1px solid var(--faint);
  background: rgba(0,0,0,.20);
  border-radius: 14px;
  padding: 12px 12px;
  max-height: 190px;
  overflow: hidden;
  position: relative;
}

.splash__line{
  padding: 3px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.splash__scanline{
  position:absolute;
  left:0;
  right:0;
  top:-30%;
  height: 40%;
  background: linear-gradient(180deg, transparent, rgba(167,197,255,.10), transparent);
  opacity: .35;
  animation: splashScan 1.6s linear infinite;
  pointer-events:none;
}

@keyframes splashScan{
  0%{ transform: translateY(0); }
  100%{ transform: translateY(220%); }
}

.splash__bar{
  margin-top: 14px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--faint);
  background: rgba(255,255,255,.03);
  overflow: hidden;
}

.splash__barFill{
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(167,197,255,.20), rgba(167,197,255,.65));
  transition: width .18s ease;
}

.splash__hint{
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

/* Hide animation */
.splash.is-hide{
  opacity: 0;
  transform: scale(.98);
  pointer-events:none;
}


/* Sidebar toggle button (matches the dossier UI) */
.sidebar-toggle{
  border: 1px solid var(--faint);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-family: var(--mono);
  letter-spacing:.04em;
}
.sidebar-toggle:hover{
  border-color: rgba(167,197,255,.35);
  background: rgba(167,197,255,.06);
}

@media (max-width: 900px){
  .sidebar{ max-height: none; }
}


mark.search-hit-mark{
  background: rgba(255, 60, 60, .22);
  color: inherit;
  padding: 0 .12em;
  border-radius: .22em;
  box-shadow: inset 0 -1px 0 rgba(255, 60, 60, .30);
}

mark.search-hit-mark.flash{
  animation: whiteoutHitFlash 1.6s ease-out;
}

@keyframes whiteoutHitFlash{
  0%{
    background: rgba(255, 30, 30, .70);
    box-shadow: 0 0 0.9em rgba(255, 30, 30, .35), inset 0 -1px 0 rgba(255, 30, 30, .55);
  }
  100%{
    background: rgba(255, 60, 60, .22);
    box-shadow: inset 0 -1px 0 rgba(255, 60, 60, .30);
  }
}


/* Fade-out after flash */
@keyframes whiteoutFadeOut {
  from { background: rgba(200, 40, 40, 0.45); }
  to { background: transparent; }
}

mark.search-hit-mark.fadeout{
  animation: whiteoutFadeOut 600ms ease forwards;
}

@keyframes whiteoutFadeOut{
  from { background: rgba(200, 40, 40, 0.45); }
  to   { background: transparent; }
}

/* Ensure sidebar panel is never transparent (mobile + desktop safe) */
#sidebar{
  background: var(--panel, var(--bg, #0b0f14));
}

#sidebar .sidebar__inner{
  background: inherit;
}

.sheet{
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto; /* nice spacing + centered */
}

/* Jump-to mini TOC */
.jump{
  margin: 10px 0 14px;
  padding: 8px 10px;
  border: 1px solid var(--faint);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.jump__label{
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .10em;
  color: var(--muted);
  white-space: nowrap;
  margin-top: 2px;
}

.jump__links{
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  min-width: 0;
}

.jump__link{
  font-size: 12px;
  color: rgba(231,238,247,.95);
  text-decoration: none;
  border: 1px solid var(--faint);
  border-radius: 999px;
  padding: 2px 8px;
  opacity: .85;
}

.jump__link:hover{
color: #ffffff;
}

.jump__link:focus-visible{
outline: 1px dashed var(--faint);
outline-offset: 2px;
}

.jump__link:hover{ opacity: .95; }

/* Optional: make H3 links slightly “lighter” */
.jump__link--h3{
  opacity: .70;
  font-size: 11px;
}

.jump-hit{
outline: 1px solid rgba(167,197,255,.35);
border-radius: 10px;
background: rgba(167,197,255,.08);
transition: background .6s ease;
}

.backtotop{
margin: 18px 0 6px;
display: flex;
justify-content: flex-end;
}


.backtotop__link{
font-size: 12px;
text-decoration: none;
border: 1px solid var(--faint);
border-radius: 999px;
padding: 3px 10px;
background: rgba(255,255,255,.03);
color: rgba(231,238,247,.92);
opacity: .85;
}


.backtotop__link:hover{
opacity: .95;
color: #fff;
}

.collapsectl{
  margin: 10px 0 14px;
}

.collapsectl__btn{
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--faint);
  background: rgba(255,255,255,.04);
  color: rgba(231,238,247,.90);
  cursor: pointer;
  opacity: .85;
}

.collapsectl__btn:hover{
  opacity: 1;
}

/* H1 with inline control */
.h1--with-control{
  display: flex;
  align-items: baseline;
  gap: 12px;
}

/* Keep H1 text pure */
.h1__text{
  flex: 1;
}

/* Collapse button — explicitly NOT H1-styled */
.collapsectl{
  margin: 0;
}

.collapsectl__btn{
  all: unset; /* 🔥 nukes inherited h1 styles */
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--faint);
  background: rgba(255,255,255,.05);
  color: rgba(231,238,247,.9);
  cursor: pointer;
  opacity: .8;
  white-space: nowrap;
}

.collapsectl__btn:hover{
  opacity: 1;
}