:root {
  --ink: #17202a;
  --muted: #5d6a75;
  --line: #d9e1e8;
  --panel: #f7fafc;
  --paper: #ffffff;
  --accent: #0b6b78;
  --accent-strong: #084c56;
  --amber: #b55e00;
  --shadow: 0 10px 30px rgba(23, 32, 42, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #eef3f6;
  line-height: 1.55;
}
a { color: var(--accent); }
a:hover, a:focus { color: var(--accent-strong); }
.site-shell { min-height: 100vh; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 92px;
  padding: 18px clamp(18px, 3vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);
}
.brand { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { display: block; width: 174px; height: auto; }
.site-header nav { display: flex; gap: clamp(14px, 2vw, 30px); align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.site-header a { color: var(--ink); text-decoration: none; font-weight: 700; }
.site-header nav a { color: var(--muted); font-size: 0.95rem; }
.site-header nav a:hover, .site-header nav a:focus { color: var(--accent-strong); }
.hero {
  box-sizing: border-box;
  min-height: 154px;
  border-bottom: 1px solid #d7e3e8;
  background: linear-gradient(90deg, #eef7f9, #fff 74%);
}
.hero-inner {
  box-sizing: border-box;
  width: 100%;
  max-width: 1220px;
  min-height: 154px;
  margin: 0 auto;
  padding: 22px 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px;
}
.hero h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 3.5vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
}
.hero .hero-author { margin-top: 8px; font-weight: 700; color: var(--accent-strong); }
.hero .hero-author + p { margin-top: 4px; }
.hero p {
  max-width: 760px;
  margin: 10px 0 0;
  color: #263841;
  font-size: 18px;
  line-height: 1.3;
}
.hero-cover {
  justify-self: end;
  width: auto;
  height: 110px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: var(--shadow);
  background: #d8e2e8;
}
.main-grid {
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
  padding: 1.5rem clamp(1rem, 4vw, 4rem) 3rem;
}
.sidebar {
  align-self: start;
  position: sticky;
  top: 4.5rem;
  max-height: calc(100vh - 5.5rem);
  overflow: auto;
  padding-right: 0.25rem;
}
.entry-grid { grid-template-areas: "sidebar content"; }
.entry-grid > .sidebar { grid-area: sidebar; }
.entry-grid > .content { grid-area: content; }
.sidebar-browser > summary { display: none; }
.sidebar-browser:not([open]) > .sidebar-browser-content { display: block; }
.search-box {
  width: 100%;
  min-height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  font: inherit;
  background: var(--paper);
}
.alpha-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.9rem 0;
}
.alpha-nav a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  text-decoration: none;
  font-weight: 700;
}
.entry-list {
  display: grid;
  gap: 0.28rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.entry-list a {
  display: block;
  padding: 0.38rem 0.45rem;
  border-radius: 5px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.92rem;
}
.entry-list a:hover,
.entry-list a:focus,
.entry-list a[aria-current="page"] { background: #deedf1; color: var(--accent-strong); }
.content { min-width: 0; }
.group { scroll-margin-top: 5rem; margin-bottom: 2rem; }
.group h2 { margin: 0 0 0.75rem; border-bottom: 1px solid var(--line); padding-bottom: 0.35rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.75rem; }
.entry-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 8rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 3px 10px rgba(23, 32, 42, 0.04);
}
.entry-card-link {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.45rem;
  color: var(--ink);
  text-decoration: none;
}
.entry-card-title { font-weight: 700; }
.entry-card-link:hover .entry-card-title,
.entry-card-link:focus .entry-card-title { color: var(--accent); text-decoration: underline; }
.entry-card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 3px; }
.entry-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.article-shell {
  max-width: 900px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(1rem, 3vw, 2rem);
}
.breadcrumbs { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; }
.breadcrumbs a { text-decoration: none; }
.entry-title { margin: 0 0 0.65rem; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.1; letter-spacing: 0; }
.entry-meta { display: grid; gap: 0.45rem; margin-bottom: 1.5rem; color: var(--muted); font-size: 0.92rem; }
.entry-body p { margin: 0 0 1rem; }
.entry-body ul { margin: 0 0 1rem 1.25rem; padding: 0; }
.entry-body li { margin: 0.35rem 0; }
.see-also {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.see-also h2, .footnotes h2 { font-size: 1.05rem; margin: 0 0 0.65rem; }
.see-also ul { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0; list-style: none; }
.see-also a {
  display: inline-flex;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  text-decoration: none;
}
.prev-next {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.prev-next a { max-width: 48%; text-decoration: none; }
.prev-next span { display: block; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; }
.footnotes {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}
.footnotes ol { padding-left: 1.25rem; }
.ad-slot {
  margin: 2rem 0;
  padding: 1.25rem;
  min-height: 120px;
  border: 1px dashed #b8c4cc;
  background: #fafbfc;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}
.ad-slot ins { display: block; }
.footnotes li { margin-bottom: 0.6rem; }
.footnote-ref { text-decoration: none; font-weight: 700; }
.acronym-term {
  border-bottom: 1px dotted var(--amber);
  cursor: help;
  text-decoration: none;
}
.reference-term,
.glossary-term {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
}
.reference-term { color: #6b4b00; }
.no-results { display: none; color: var(--muted); margin: 1rem 0; }
body.has-filter .entry-card[hidden],
body.has-filter .entry-list li[hidden],
body.has-filter .group[hidden] { display: none; }
body.no-results .no-results { display: block; }
@media (max-width: 860px) {
  .hero-inner { min-height: 154px; padding: 20px; gap: 18px; }
  .hero h1 { font-size: clamp(28px, 8vw, 36px); }
  .hero .hero-author { margin-top: 8px; font-weight: 700; color: var(--accent-strong); }
.hero .hero-author + p { margin-top: 4px; }
.hero p { font-size: 16px; }
  .hero-cover { height: 90px; }
  .main-grid { grid-template-columns: 1fr; }
  .entry-grid { grid-template-areas: "content" "sidebar"; }
  .sidebar { position: static; max-height: none; padding-right: 0; }
  .sidebar--entry { margin-top: 0.25rem; }
  .sidebar-browser > summary {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper);
    color: var(--accent-strong);
    cursor: pointer;
    font-weight: 700;
  }
  .sidebar-browser[open] > summary { margin-bottom: 0.85rem; }
  .sidebar-browser:not([open]) > .sidebar-browser-content { display: none; }
  .site-header { align-items: flex-start; }
}
.glossary-hero-inner{grid-template-columns:minmax(0,1fr)}
.hero .hero-author{margin-top:8px;font-weight:700;color:var(--accent-strong)}
.hero .hero-author + p{margin-top:4px}
.entry-references{margin-top:2rem;padding-top:1rem;border-top:1px solid var(--line)}
.entry-references h2{font-size:1.2rem}
.entry-references ul{padding-left:1.25rem}
.entry-references li+li{margin-top:.65rem}
