body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: #f8f9fa;
  color: #202122;
  font-size: 14px;
}

a {
  color: #0645ad;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page-shell {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  min-height: 100vh;
  max-width: 1600px;
  margin: 0 auto;
}

.sidebar {
  background: #f8f9fa;
  padding: 0 12px 24px 10px;
}

.wordmark {
  display: block;
  margin: 8px 0 18px;
  color: #202122;
}

.wordmark-full {
  display: block;
  width: 135px;
  height: auto;
  margin: 0 auto;
}

.portal-nav h2 {
  margin: 18px 0 4px;
  padding-bottom: 2px;
  border-bottom: 1px solid #eaecf0;
  font-size: 0.75rem;
  font-weight: 400;
  color: #54595d;
}

.portal-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.portal-nav li {
  margin: 4px 0;
  font-size: 0.75rem;
}

.content {
  min-width: 0;
  background: linear-gradient(to bottom, #ffffff 0, #ffffff 160px, #f8f9fa 160px);
}

.personal-bar {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  padding: 6px 24px 4px;
  font-size: 0.82rem;
  color: #54595d;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 0 24px;
  border-bottom: 1px solid #a2a9b1;
  background: linear-gradient(to bottom, #ffffff 0%, #ffffff 78%, #eaecf0 100%);
}

.top-tabs,
.page-actions {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}

.top-tabs a,
.page-actions a {
  display: inline-block;
  padding: 10px 10px 8px;
  border: 1px solid transparent;
  border-bottom: 0;
  font-size: 0.82rem;
}

.top-tabs a.active,
.page-actions a.active {
  background: #fff;
  border-color: #a2a9b1;
  color: #202122;
}

.search-box {
  margin-left: 8px;
}

.search-box input {
  width: 260px;
  padding: 6px 8px;
  border: 1px solid #a2a9b1;
  font-size: 0.82rem;
  background: #fff;
}

.article {
  max-width: 1100px;
  padding: 20px 24px 32px;
  background: #fff;
  min-height: calc(100vh - 120px);
  border-left: 1px solid #a2a9b1;
}

#firstHeading {
  margin: 0;
  border-bottom: 1px solid #a2a9b1;
  font-family: "Linux Libertine", Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1.3;
}

.site-subtitle {
  margin: 6px 0 18px;
  color: #54595d;
  font-size: 0.78rem;
}

.article-tools {
  margin-bottom: 14px;
  font-size: 0.82rem;
}

.article-tools a + a::before {
  content: " | ";
  color: #72777d;
}

.infobox {
  float: right;
  width: 325px;
  margin: 0 0 18px 24px;
  border: 1px solid #a2a9b1;
  background: #f8f9fa;
  font-size: 0.82rem;
}

.infobox-header {
  padding: 8px 10px;
  background: #eaecf0;
  text-align: center;
  font-weight: 700;
}

.infobox-figure,
.wide-figure,
.inline-figure {
  margin: 0;
}

.infobox img,
.wide-figure img,
.inline-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.infobox figcaption,
.wide-figure figcaption,
.inline-figure figcaption {
  padding: 8px 10px;
  font-size: 0.8rem;
  color: #54595d;
}

.infobox table {
  width: 100%;
  border-collapse: collapse;
}

.infobox th,
.infobox td {
  padding: 7px 10px;
  border-top: 1px solid #eaecf0;
  vertical-align: top;
}

.infobox th {
  width: 34%;
  text-align: left;
}

p,
li {
  line-height: 1.6;
}

.toc {
  display: inline-block;
  min-width: 280px;
  margin: 8px 0 18px;
  padding: 8px 12px;
  border: 1px solid #a2a9b1;
  background: #f8f9fa;
  font-size: 0.9rem;
}

.toc-title {
  margin-bottom: 8px;
  font-weight: 700;
  text-align: center;
}

.toc ol {
  margin: 0;
  padding-left: 22px;
}

h2 {
  margin-top: 26px;
  padding-bottom: 3px;
  border-bottom: 1px solid #a2a9b1;
  font-family: "Linux Libertine", Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 400;
}

.wide-figure,
.inline-figure {
  width: min(720px, 100%);
  margin: 18px auto;
  border: 1px solid #c8ccd1;
  background: #f8f9fa;
}

.references-list {
  padding-left: 22px;
}

.catlinks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
  padding: 10px 12px;
  border: 1px solid #c8ccd1;
  background: #f8f9fa;
  font-size: 0.88rem;
}

.footer {
  padding: 14px 24px 28px;
  font-size: 0.8rem;
  color: #54595d;
  border-left: 1px solid #a2a9b1;
}

.footer nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

sup {
  font-size: 0.75em;
}

@media (max-width: 980px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-bottom: 1px solid #a2a9b1;
  }

  .personal-bar {
    padding-top: 10px;
  }

  .topbar {
    padding-top: 8px;
    align-items: stretch;
    flex-direction: column;
  }

  .search-box input {
    width: min(100%, 320px);
  }

  .infobox {
    float: none;
    width: 100%;
    margin: 0 0 20px;
  }

  .article,
  .footer {
    border-left: 0;
  }
}

@media (max-width: 640px) {
  .article,
  .footer,
  .topbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .toc {
    display: block;
    min-width: 0;
  }
}
