:root {
  color-scheme: light;
  --page: #ffffff;
  --text: #202122;
  --muted: #54595d;
  --border: #a2a9b1;
  --border-soft: #eaecf0;
  --link: #0645ad;
  --chrome: #f8f9fa;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
}

button,
select {
  font: inherit;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 170px minmax(220px, 480px) max-content;
  align-items: center;
  gap: 18px;
  min-height: 58px;
  padding: 10px 44px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.wordmark {
  display: grid;
  color: #000000;
  line-height: 1;
  text-decoration: none;
}

.wordmark-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-variant: small-caps;
  letter-spacing: 0.04em;
}

.wordmark-subtitle {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.search-box select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: #ffffff;
  color: var(--text);
  padding: 0 10px;
}

button {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--chrome);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  padding: 0 12px;
}

button:hover,
button:focus-visible {
  border-color: #72777d;
  background: #ffffff;
}

.article-tabs .view-button {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--link);
  font-weight: 400;
  padding: 0 0 8px;
}

.article-tabs .view-button:hover,
.article-tabs .view-button:focus-visible {
  background: transparent;
  text-decoration: underline;
}

.article-tabs .view-button[aria-pressed="true"] {
  color: var(--text);
}

.page-shell {
  display: grid;
  justify-content: center;
  padding: 26px 24px 56px;
}

.reader-card {
  width: min(1380px, calc(100vw - 48px));
}

.article-tabs {
  display: flex;
  align-items: end;
  gap: 18px;
  min-height: 33px;
  border-bottom: 1px solid var(--border);
  color: var(--link);
  font-size: 14px;
}

.article-tabs span {
  padding: 0 0 8px;
}

.article-tabs .active-tab {
  border-bottom: 2px solid #202122;
  color: var(--text);
}

.tab-spacer {
  flex: 1;
}

.article-origin {
  margin: 10px 0 22px;
  font-size: 14px;
}

.reader-views {
  display: grid;
  grid-template-columns: repeat(var(--visible-view-count, 1), minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.reader-views[data-visible-count="1"] {
  --visible-view-count: 1;
}

.reader-views[data-visible-count="2"] {
  --visible-view-count: 2;
}

.reader-views[data-visible-count="3"] {
  --visible-view-count: 3;
}

.reader-pane {
  min-width: 0;
}

.pane-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.reader-preview .render-document {
  display: block !important;
}

.reader-preview .render-sheet {
  width: auto !important;
  min-height: 0 !important;
  height: auto !important;
  aspect-ratio: auto !important;
  overflow: visible !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.reader-preview .sheet-body {
  position: static !important;
}

.reader-preview .role-block[data-role="ArticleTitle"] {
  margin-top: 0 !important;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.reader-preview .role-block[data-role="SectionHeading"] h2 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 3px;
}

.reader-preview .role-block[data-role="SectionHeading"] h3,
.reader-preview .role-block[data-role="SectionHeading"] h4,
.reader-preview .role-block[data-role="SectionHeading"] h5,
.reader-preview .role-block[data-role="SectionHeading"] h6 {
  font-family: sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.reader-preview .role-block[data-role="Body"]:first-of-type {
  font-size: 17px;
}

.reader-preview a {
  color: var(--link);
}

.reader-preview .citation-markers {
  margin-left: 2px;
  font-size: 12px;
  line-height: 1;
  vertical-align: super;
}

.reader-preview .citation-marker {
  padding: 0 1px;
}

.reader-preview .role-block[data-role="CitationList"] {
  font-size: 13px;
  line-height: 1.45;
}

.reader-preview .citation-list {
  word-break: break-word;
}

.reader-preview .citation-item {
  margin-bottom: 7px;
}

.reader-preview .citation-backrefs {
  white-space: nowrap;
}

.reader-preview .citation-backref {
  margin-left: 4px;
}

.reader-preview .citation-missing {
  color: var(--muted);
}

@media (max-width: 760px) {
  .reader-preview .role-block[data-role="Figure"] {
    float: none;
    clear: none;
    width: auto;
    margin-right: 0 !important;
  }
}

.markdown-source {
  min-height: 70vh;
  max-height: calc(100vh - 180px);
  margin: 0;
  overflow: auto;
  border: 1px solid var(--border-soft);
  background: #f8f9fa;
  color: #202122;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  padding: 14px;
  white-space: pre-wrap;
}

.reference-preview {
  min-height: 70vh;
  max-height: calc(100vh - 180px);
  overflow: auto;
  border-left: 1px solid var(--border-soft);
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.55;
}

.reference-preview h1,
.reference-preview .mw-heading1 {
  display: none;
}

.reference-preview h2 {
  margin: 22px 0 8px;
  border-bottom: 1px solid var(--border);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 400;
}

.reference-preview h3,
.reference-preview h4 {
  margin: 16px 0 6px;
  font-size: 17px;
}

.reference-preview p {
  margin: 0 0 12px;
}

.reference-preview img {
  max-width: 100%;
  height: auto;
}

.reference-preview table,
.reference-preview .infobox {
  max-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.reference-preview .infobox {
  float: right;
  width: min(260px, 45%);
  margin: 0 0 12px 16px;
  border: 1px solid var(--border);
  background: #f8f9fa;
}

.reference-preview th,
.reference-preview td {
  border: 1px solid var(--border-soft);
  padding: 4px 6px;
  vertical-align: top;
}

.reference-loading {
  color: var(--muted);
}

.reader-status {
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.profile-dialog {
  width: min(780px, calc(100vw - 28px));
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0;
}

.profile-dialog::backdrop {
  background: rgba(32, 33, 34, 0.28);
}

.profile-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
}

.profile-dialog-header h2 {
  margin: 0;
  font-size: 18px;
}

.profile-source {
  max-height: min(70vh, 720px);
  margin: 0;
  overflow: auto;
  padding: 14px;
  background: #f8f9fa;
  font-size: 13px;
  line-height: 1.45;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

@media (max-width: 720px) {
  .site-header {
    grid-template-columns: 1fr;
    padding: 12px 18px;
  }

  .page-shell {
    padding: 18px 16px 44px;
  }

  .reader-card {
    width: 100%;
  }

  .article-tabs {
    gap: 12px;
    overflow-x: auto;
    white-space: nowrap;
  }

  .reader-views,
  .reader-views[data-visible-count="2"],
  .reader-views[data-visible-count="3"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .reference-preview,
  .markdown-source {
    max-height: none;
  }
}