:root {
  --ink: #17202a;
  --muted: #5d6a75;
  --line: #d9e1e8;
  --panel: #f7fafc;
  --paper: #ffffff;
  --accent: #0b6b78;
  --accent-strong: #084c56;
  --gold: #9b741d;
  --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 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 190px);
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: end;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 4rem) 1.5rem;
  background: linear-gradient(180deg, #f8fbfd 0%, #eef3f6 100%);
}
.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
}
.hero h1 { margin: 0 0 0.75rem; font-size: clamp(2rem, 5vw, 4.35rem); line-height: 1.02; letter-spacing: 0; }
.hero p:not(.eyebrow) { max-width: 54rem; margin: 0; color: var(--muted); font-size: 1.08rem; }
.hero-cover {
  justify-self: end;
  width: min(100%, 168px);
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: var(--shadow);
  background: #d8e2e8;
}
.main-grid {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
  padding: 1.5rem clamp(1rem, 4vw, 4rem) 3rem;
}
.sidebar {
  align-self: start;
  position: sticky;
  top: 5.4rem;
  max-height: calc(100vh - 6.2rem);
  overflow: auto;
  padding-right: 0.25rem;
}
.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;
}
.alpha-nav a:hover,
.alpha-nav a:focus,
.entry-list a:hover,
.entry-list a:focus { background: #deedf1; color: var(--accent-strong); }
.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.9rem;
}
.content {
  min-width: 0;
  counter-reset: citation;
}
.group { scroll-margin-top: 6rem; margin-bottom: 2rem; }
.group h2 {
  margin: 0 0 0.75rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.35rem;
  font-size: 1.55rem;
}
.citation-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.citation-item {
  counter-increment: citation;
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr);
  gap: 0.85rem;
  padding: 0.62rem 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 6rem;
}
.citation-item:target {
  margin: -0.25rem -0.65rem 0;
  padding: 0.62rem 0.65rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 0 0 3px rgba(11, 107, 120, 0.12);
}
.citation-number::before {
  content: "[" counter(citation) "]";
  display: inline-flex;
  justify-content: flex-end;
  width: 100%;
  color: var(--accent-strong);
  font-weight: 700;
}
.citation-body { min-width: 0; }
.citation-body p {
  margin: 0;
  max-width: 74rem;
}
.no-results { display: none; color: var(--muted); margin: 1rem 0; }
body.has-filter .citation-item[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 { grid-template-columns: 1fr; align-items: start; }
  .hero-cover { justify-self: start; width: 142px; }
  .main-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; padding-right: 0; }
  .site-header { align-items: flex-start; }
}
@media (max-width: 560px) {
  .site-header { min-height: 0; flex-direction: column; gap: 0.9rem; }
  .site-header nav { justify-content: flex-start; }
  .citation-item { grid-template-columns: 2.6rem minmax(0, 1fr); gap: 0.6rem; padding: 0.58rem 0; }
}

.site-masthead {
  background: linear-gradient(rgba(248, 251, 252, .90), rgba(248, 251, 252, .90)), url("cog.png") 0 0 / 25px 25px repeat;
  border-bottom: 1px solid var(--line);
}
.site-masthead-inner {
  align-items: center;
  display: flex;
  gap: 28px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1220px;
  min-height: 112px;
  padding: 22px 32px;
}
.brand-lockup {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.logo {
  align-items: center;
  display: inline-flex;
  text-decoration: none;
}
.logo img {
  display: block;
  height: auto;
  width: clamp(154px, 16vw, 218px);
}
.logo-sub {
  color: var(--accent-strong);
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  margin-left: 4px;
  text-transform: uppercase;
}
.site-nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 15px;
  gap: 18px;
  justify-content: flex-end;
}
.site-nav a,
.site-nav button {
  color: var(--ink);
  font: inherit;
}
.site-nav a {
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a:focus,
.site-nav a.active {
  color: var(--accent-strong);
}
.site-nav a.active {
  font-weight: 700;
}
.site-nav button {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
}
.course-link {
  background: var(--accent);
  border-radius: 999px;
  color: #fff !important;
  font-weight: 700;
  padding: 12px 18px;
}
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem 1rem;
  text-align: center;
}
.site-footer p {
  margin: 0;
}
@media (max-width: 860px) {
  .site-masthead-inner {
    align-items: flex-start;
    flex-direction: column;
  }
  .site-nav {
    justify-content: flex-start;
    gap: 12px;
  }
}

.ad-slot {
  margin: 28px auto;
  padding: 0;
  width: min(100%, 728px);
  min-height: 90px;
}
.ad-slot ins {
  display: block;
}
@media (max-width: 760px) {
  .ad-slot {
    width: min(100%, 336px);
    min-height: 280px;
  }
}

.acronym-term,
.reference-term {
  position: relative;
  border-bottom: 1px dotted currentColor;
  cursor: help;
  text-decoration: none;
}
.acronym-term:focus,
.reference-term:focus {
  outline: 2px solid rgba(31, 111, 139, 0.28);
  outline-offset: 2px;
}
.acronym-term::after,
.reference-term::after {
  position: absolute;
  left: 50%;
  bottom: 1.55em;
  transform: translateX(-50%);
  z-index: 40;
  width: min(360px, 78vw);
  padding: 0.75rem 0.85rem;
  border: 1px solid #d7e3e8;
  border-radius: 8px;
  background: #ffffff;
  color: #17242b;
  box-shadow: 0 14px 32px rgba(23, 36, 43, 0.18);
  font-size: 0.86rem;
  font-weight: 400;
  line-height: 1.38;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
}
.acronym-term::after {
  content: attr(data-definition);
}
.reference-term::after {
  content: attr(data-reference-preview);
}
.acronym-term:hover::after,
.acronym-term:focus::after,
.reference-term:hover::after,
.reference-term:focus::after {
  opacity: 1;
}
@media (max-width: 760px) {
  .acronym-term::after,
  .reference-term::after {
    position: fixed;
    right: 20px;
    bottom: 20px;
    left: 20px;
    width: auto;
    max-width: none;
    transform: none;
  }
  .acronym-term:hover::after,
  .acronym-term:focus::after,
  .reference-term:hover::after,
  .reference-term:focus::after {
    transform: none;
  }
}

