:root {
  --bg: #0d1117;
  --card: #161b22;
  --text: #e6edf3;
  --muted: #8b949e;
  --border: #30363d;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --green: #3fb950;
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.65rem 1rem;
}
.site-logo {
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  font-size: 1.05rem;
}
.site-logo:hover { color: var(--accent); }
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  cursor: pointer;
  color: var(--text);
}
.nav-toggle__icon {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}
.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 1rem 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}
.site-nav__link {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.92rem;
  border: 1px solid transparent;
}
.site-nav__link:hover { color: var(--accent); background: rgba(88,166,255,.1); border-color: rgba(88,166,255,.2); }
.site-nav__link[aria-current="page"] {
  color: var(--text);
  background: rgba(255,255,255,.06);
  border-color: var(--border);
}
.ad-slot {
  min-height: 0;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
}
.ad-slot--top { margin-top: 0.5rem; }
.ad-slot--sidebar { margin-top: 1rem; }
.ad-slot--inline { margin: 1rem 0; }
.site-shell {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding: 1rem;
}
@media (min-width: 900px) {
  .site-shell {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
  }
  .site-aside { position: sticky; top: 4.5rem; }
}
.site-main { min-width: 0; }
.site-article { max-width: 720px; }
.site-article h1 { margin-top: 0; font-size: clamp(1.35rem, 4vw, 1.75rem); }
.chapter-list { padding-left: 1.25rem; }
.chapter-list li { margin: 0.35rem 0; }
.beverly-export .beverly-block { margin-bottom: 1.5rem; }
.beverly-export .beverly-block__body { margin-top: 0.5rem; }
.beverly-export .beverly-block__body img { max-width: 100%; height: auto; border-radius: 8px; }
.beverly-export table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.beverly-export th, .beverly-export td { border: 1px solid var(--border); padding: 0.45rem 0.55rem; text-align: left; }
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1rem;
  margin-top: auto;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
.site-footer__note { margin: 0; }
.cookie-banner {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 100;
  padding: 1rem;
  background: rgba(13,17,23,.92);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.cookie-banner__inner {
  max-width: 640px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.15rem;
}
.cookie-banner__title { margin: 0 0 0.5rem; font-size: 1rem; }
.cookie-banner__text { margin: 0 0 0.75rem; color: var(--muted); font-size: 0.9rem; }
.cookie-banner__links { margin: 0 0 0.75rem; font-size: 0.88rem; }
.cookie-banner__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cookie-btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.08);
  color: var(--text);
}
.cookie-btn--primary {
  background: rgba(63,185,80,.2);
  border-color: rgba(63,185,80,.45);
  color: var(--green);
}
.cookie-btn--ghost { background: transparent; }
@media (max-width: 719px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    border-top: 1px solid var(--border);
  }
  .site-nav.is-open { display: block; }
  .site-nav__list {
    flex-direction: column;
    padding: 0.5rem 1rem 1rem;
  }
  .site-shell { grid-template-columns: 1fr; }
  .site-aside { order: 2; }
}