:root {
  color-scheme: dark;
  --bg: #262626;
  --bg-soft: #2d2d2d;
  --panel: #303030;
  --panel-hover: #383838;
  --line: #555;
  --line-soft: #444;
  --text: #ededed;
  --muted: #c4c4c4;
  --faint: #a2a2a2;
  --link: #75b5f5;
  --link-hover: #a0ceff;
  --body-font: Georgia, "Times New Roman", serif;
  --reading-font: Georgia, "Times New Roman", serif;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f4f4;
  --bg-soft: #ededed;
  --panel: #fff;
  --panel-hover: #e8e8e8;
  --line: #aaa;
  --line-soft: #d0d0d0;
  --text: #202122;
  --muted: #54595d;
  --faint: #72777d;
  --link: #0645ad;
  --link-hover: #0b0080;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; color: var(--text); background: var(--bg); font: 15px/1.6 var(--body-font); }
button, input, select { font: inherit; }
a { color: var(--link); text-decoration: none; text-underline-offset: .16em; }
a:hover { color: var(--link-hover); text-decoration: underline; }
button { color: inherit; }
::selection { color: #fff; background: #555; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.topbar { position: sticky; z-index: 50; top: 0; display: grid; grid-template-columns: 220px minmax(220px, 640px) 1fr; gap: 24px; align-items: center; min-height: 64px; padding: 0 28px; border-bottom: 1px solid var(--line); background: var(--bg); }
.brand { color: var(--link); font-size: 16px; font-weight: 650; }
.search-wrap { position: relative; }
.search-wrap input { width: 100%; height: 40px; padding: 0 60px 0 12px; border: 1px solid var(--line); border-radius: 3px; outline: none; color: var(--text); background: var(--panel); }
.search-wrap input:focus { border-color: #888; }
.search-wrap kbd { position: absolute; top: 9px; right: 10px; padding: 1px 5px; border: 1px solid var(--line); border-radius: 3px; color: var(--faint); background: var(--bg-soft); font: 11px var(--body-font); }
.search-results { position: absolute; z-index: 60; top: calc(100% + 5px); right: 0; left: 0; display: none; max-height: min(70vh, 520px); overflow: auto; padding: 5px; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 5px 16px #0008; }
.search-results.open { display: block; }
.search-result { display: block; padding: 9px 10px; border-left: 3px solid transparent; color: var(--text); }
.search-result:hover, .search-result:focus { outline: none; background: var(--panel-hover); text-decoration: none; }
.search-result.active { background: var(--panel-hover); }
.search-result.exact-match { border-left-color: #858585; background: #3a3a3a; }
.search-result strong { display: inline-block; margin-right: 8px; color: var(--link); font-size: 14px; }
.search-result small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.search-result p { margin: 4px 0 0; color: var(--faint); font-size: 12px; line-height: 1.45; }
.match-badge { display: inline-block; padding: 1px 5px; border: 1px solid #666; border-radius: 2px; color: var(--text); font-size: 10px; }
.search-empty { padding: 14px; color: var(--muted); font-size: 13px; }
.top-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.theme-toggle { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); background: var(--panel); cursor: pointer; }
.theme-toggle:hover { background: var(--panel-hover); }
.language-select { display: flex; align-items: center; gap: 7px; color: var(--faint); font-size: 11px; }
.language-select select { max-width: 125px; padding: 6px 8px; border: 1px solid var(--line); color: var(--text); background: var(--panel); font-size: 12px; }
.mobile-nav-toggle { display: none; }
.page-shell { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; max-width: 1540px; min-height: calc(100vh - 64px); margin: 0 auto; padding: 24px 28px 56px; }
.page-shell.with-toc { grid-template-columns: 200px minmax(0, 1fr) 190px; }
.left-rail { position: sticky; top: 88px; align-self: start; min-height: calc(100vh - 110px); padding: 5px 10px 14px 0; }
.rail-label { margin: 17px 0 8px 10px; color: var(--faint); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.primary-nav { display: grid; gap: 2px; }
.primary-nav a, .rail-action { display: flex; align-items: center; width: 100%; min-height: 34px; padding: 6px 10px; border: 0; color: var(--muted); background: transparent; text-align: left; font-size: 13px; cursor: pointer; }
.primary-nav a::before { width: 16px; margin-right: 5px; color: var(--muted); content: "•"; font-size: 13px; }
.primary-nav a:hover, .rail-action:hover { color: var(--link); background: var(--panel); text-decoration: none; }
.primary-nav .home-link { color: var(--text); }
.rail-divider { height: 1px; margin: 14px 8px; background: var(--line-soft); }
.rail-action { display: block; min-height: 32px; color: var(--muted); font-size: 12px; }
.main-column { min-width: 0; max-width: 1080px; }
.right-rail { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; padding-top: 45px; }
.rail-card { padding: 12px; border-left: 1px solid var(--line); }
.rail-card h2 { margin: 0 0 9px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.toc { display: grid; gap: 3px; }
.toc a { display: block; padding: 3px 0; font-size: 11px; line-height: 1.4; }
.toc .toc-level-3 { padding-left: 10px; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; margin: 3px 0 17px; color: var(--faint); font-size: 11px; }
.breadcrumbs a { color: var(--link); }
.article-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 28px; margin-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.page-type { color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; }
.toolbar-links { display: flex; gap: 14px; }
.toolbar-links a { font-size: 11px; }
.muted { color: var(--muted); }
.article-content { min-width: 0; }
.article-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 5px 0 14px; border-bottom: 1px solid var(--line); }
.article-heading h1, .index-intro h1 { margin: 0; color: var(--text); font: 500 clamp(30px, 4vw, 42px)/1.16 var(--reading-font); }
.source-badge { flex: 0 0 auto; margin-top: 6px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.article-text { min-width: 0; padding: 8px 0 28px; color: var(--text); font: 17px/1.75 var(--reading-font); }
.article-text h2, .article-text h3, .article-text h4 { scroll-margin-top: 88px; color: var(--text); font-family: var(--body-font); font-weight: 650; line-height: 1.3; }
.article-text h2 { margin: 2em 0 .65em; padding-bottom: .35em; border-bottom: 1px solid var(--line-soft); font-size: 22px; }
.article-text h3 { margin: 1.65em 0 .5em; font-size: 18px; }
.article-text h4 { margin: 1.4em 0 .5em; font-size: 15px; }
.article-text p { margin: .8em 0; }
.article-text ul, .article-text ol { padding-left: 1.5em; }
.article-text li { padding-left: .15em; margin: .25em 0; }
.article-text blockquote { margin: 1em 0; padding: .1em 1em; border-left: 2px solid #777; color: var(--muted); }
.article-text table { width: 100%; margin: 1em 0; border-collapse: collapse; font: 13px/1.5 var(--body-font); }
.article-text th, .article-text td { padding: 7px 9px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.article-text th { background: var(--bg-soft); font-weight: 650; }
.article-text hr { border: 0; border-top: 1px solid var(--line); }
.article-text code { padding: .1em .28em; border: 1px solid var(--line); background: var(--bg-soft); font-size: .86em; }
.article-text sup { line-height: 0; }
.article-text sup a { font: 12px var(--body-font); }
.embedded-image { max-width: 100%; margin: .7em auto; text-align: center; }
.embedded-image img { display: block; max-width: 100%; max-height: 480px; margin: 0 auto; object-fit: contain; }
.article-infobox { float: right; width: min(320px, 42%); margin: 12px 0 18px 22px; padding: 10px; border: 1px solid var(--line); background: var(--bg-soft); }
.variant-section-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 230px); gap: 16px; align-items: start; margin: .5em 0 1.5em; }
.variant-section-layout .variant-copy { min-width: 0; }
.variant-section-layout .variant-copy > :first-child { margin-top: 0; }
.variant-infobox { float: none; width: auto; min-width: 0; margin: 0; padding: 8px; }
.variant-infobox figure.embedded-image { margin: 0; }
.variant-infobox .embedded-image img { width: 100%; max-height: 190px; }
.variant-infobox .variant-image-source { margin: 7px 0 0; color: var(--muted); font: italic 11px/1.45 var(--body-font); }
.article-infobox > h2 { margin: 0 0 8px; padding: 0 0 6px; border-bottom: 1px solid var(--line); color: var(--text); font: 650 16px/1.3 var(--body-font); }
.infobox-image figure { margin: 0; }
.infobox-image img { display: block; width: 100%; max-height: 250px; object-fit: contain; }
.infobox-image p { margin: 7px 0; color: var(--muted); font: italic 11px/1.45 var(--body-font); }
.infobox-table table { width: 100%; margin: 8px 0 0; border-collapse: collapse; font: 12px/1.45 var(--body-font); }
.infobox-table th, .infobox-table td { display: block; padding: 5px 6px; border: 0; border-top: 1px solid var(--line-soft); }
.infobox-table th { padding-bottom: 0; background: transparent; color: var(--muted); font-size: 11px; }
.infobox-table td { padding-top: 2px; }
.backlinks { clear: both; margin: 22px 0; padding: 14px 0; border-top: 1px solid var(--line); }
.backlinks h2 { margin: 0 0 8px; font-size: 14px; }
.backlink-list { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; }
.site-footer { display: flex; justify-content: space-between; gap: 12px; padding: 18px 0 0; border-top: 1px solid var(--line-soft); color: var(--faint); font-size: 10px; }
.home-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 8px 0 18px; border-bottom: 1px solid var(--line); }
.home-header h1 { margin: 0; font: 500 clamp(30px, 4vw, 42px)/1.15 var(--reading-font); }
.home-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.button { min-height: 36px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 3px; color: var(--text); background: var(--panel); cursor: pointer; font-size: 12px; }
.button:hover { background: var(--panel-hover); }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); margin: 18px 0 28px; border: 1px solid var(--line); }
.stats-row > div { display: flex; align-items: baseline; gap: 9px; padding: 10px 13px; border-right: 1px solid var(--line); }
.stats-row > div:last-child { border: 0; }
.stats-row strong { color: var(--text); font-size: 20px; font-weight: 600; }
.stats-row span { color: var(--muted); font-size: 12px; }
.featured-gem { margin: 0 0 30px; padding: 16px; border: 1px solid var(--line); background: var(--panel); }
.featured-gem-content { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 18px; align-items: center; }
.section-label { margin: 0 0 5px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.featured-gem h2 { margin: 0; font: 500 24px/1.3 var(--reading-font); }
.featured-description { max-width: 850px; margin: 8px 0 0; color: var(--muted); font: 16px/1.6 var(--reading-font); }
.featured-image-link { display: grid; min-height: 160px; place-items: center; border: 1px solid var(--line-soft); background: var(--bg-soft); }
.featured-image-link img { display: block; width: 100%; height: 180px; object-fit: contain; }
.home-section { margin: 28px 0; }
.home-section > h2 { margin: 0 0 10px; font-size: 19px; }
.common-gems-section { margin: 30px 0; }
.common-gems-section > h2 { margin: 0 0 12px; font-size: 19px; }
.common-gem-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.common-gem-card { display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 5px; aspect-ratio: 1 / 1; min-width: 0; overflow: hidden; padding: 8px; border: 1px solid var(--line); color: var(--text); background: var(--panel); }
.common-gem-card:hover { background: var(--panel-hover); text-decoration: none; }
.common-gem-image { display: grid; min-height: 0; place-items: center; overflow: hidden; background: var(--bg-soft); }
.common-gem-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.common-gem-no-image { color: var(--faint); font-size: 11px; }
.common-gem-card strong { display: block; overflow: hidden; color: var(--link); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.common-gem-snippet { display: -webkit-box; overflow: hidden; color: var(--muted); font: 12px/1.4 var(--reading-font); -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.load-more-button { display: block; min-width: 110px; margin: 16px auto 0; }
.browse-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.browse-card { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; border: 1px solid var(--line); color: var(--link); background: var(--panel); }
.browse-card:hover { background: var(--panel-hover); text-decoration: none; }
.browse-card span { color: var(--muted); font-size: 12px; }
.index-intro { margin: 0 0 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.index-intro h1 { font-size: clamp(32px, 4vw, 44px); }
.index-intro > p:not(.eyebrow) { max-width: 780px; color: var(--muted); }
.index-intro .eyebrow { color: var(--muted); font-size: 11px; }
.letter-nav { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 14px; }
.letter-nav a { display: grid; min-width: 27px; height: 27px; place-items: center; border: 1px solid var(--line); color: var(--link); background: var(--panel); font-size: 11px; }
.alpha-group { margin: 22px 0; scroll-margin-top: 88px; }
.alpha-group h2 { margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--text); font: 500 21px var(--reading-font); }
.index-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.index-card { display: block; min-width: 0; padding: 9px 10px; border: 1px solid var(--line-soft); color: var(--text); background: var(--panel); }
.index-card:hover { background: var(--panel-hover); text-decoration: none; }
.index-card-title { display: block; color: var(--link); font-size: 13px; font-weight: 650; }
.index-card-summary { display: -webkit-box; overflow: hidden; margin-top: 3px; color: var(--muted); font: 12px/1.45 var(--reading-font); -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.index-card small { display: inline-block; margin-top: 5px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.credits-table { font-size: 12px !important; }
@media (max-width: 1150px) {
  .page-shell, .page-shell.with-toc { grid-template-columns: 185px minmax(0, 1fr); gap: 24px; }
  .right-rail { display: none; }
}
@media (max-width: 780px) {
  .topbar { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; min-height: 60px; padding: 0 12px; }
  .mobile-nav-toggle { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid var(--line); color: var(--muted); background: var(--panel); cursor: pointer; }
  .search-wrap { grid-column: 1 / -1; grid-row: 2; margin: -1px 0 9px; }
  .topbar { grid-template-rows: 44px auto; }
  .top-actions { grid-column: 3; grid-row: 1; }
  .language-select > span { display: none; }
  .language-select select { width: 64px; padding: 6px 2px; }
  .page-shell, .page-shell.with-toc { display: block; padding: 15px 15px 38px; }
  .left-rail { position: fixed; z-index: 45; top: 60px; bottom: 0; left: 0; display: none; width: min(270px, 86vw); min-height: 0; overflow: auto; padding: 16px; border-right: 1px solid var(--line); background: var(--bg); }
  .left-rail.open { display: block; }
  .breadcrumbs { margin-top: 1px; }
  .home-header { align-items: flex-start; flex-direction: column; }
  .featured-gem-content { grid-template-columns: minmax(0, 1fr) 180px; }
  .common-gem-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .article-infobox { width: min(300px, 45%); }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .stats-row > div:nth-child(2) { border-right: 0; }
  .stats-row > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .article-toolbar { align-items: flex-start; gap: 6px; flex-direction: column; padding: 5px 0 7px; }
  .article-infobox { float: none; width: 100%; margin: 12px 0; }
  .variant-section-layout { grid-template-columns: minmax(0, 1fr) minmax(120px, 38%); gap: 10px; }
  .variant-infobox { width: auto; margin: 0; }
  .infobox-image img { max-height: 300px; }
  .browse-grid, .index-grid { grid-template-columns: 1fr; }
  .featured-gem-content { grid-template-columns: 1fr; }
  .featured-image-link { grid-row: 1; }
  .common-gem-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer { flex-direction: column; }
}
.article-notices { display: grid; gap: 10px; margin: 0 0 16px; }
.article-notice { padding: 11px 14px; border: 1px solid; border-radius: 2px; }
.article-notice h2 { margin: 0 0 4px; font: 650 16px/1.35 var(--body-font); }
.article-notice p { margin: 0; font: 14px/1.5 var(--body-font); }
.article-notice--stub { border-color: #b18e00; color: #202122; background: rgba(255, 232, 99, .5); }
.article-notice--warning { border-color: #b51e2e; color: #fff; background: rgba(190, 30, 45, .5); }
html[data-theme="light"] .article-notice--warning { color: #202122; background: rgba(220, 53, 69, .5); }



.cross-reference { font-size: .8em; font-style: italic; }

/* Force the homepage title typeface across content, controls, and generated UI. */
html, html *, html *::before, html *::after { font-family: Georgia, 'Times New Roman', serif !important; }

.article-content img { cursor: zoom-in; }
.image-lightbox[hidden] { display: none; }
.image-lightbox { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 3vh 3vw; background: rgba(0, 0, 0, .5); }
.image-lightbox-panel { position: relative; display: grid; gap: 8px; max-width: 94vw; max-height: 94vh; overflow: auto; padding: 38px 14px 12px; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 8px 30px rgba(0, 0, 0, .35); }
.image-lightbox-image { display: block; max-width: 90vw; max-height: 78vh; margin: 0 auto; object-fit: contain; }
.image-lightbox-caption { max-width: 90vw; max-height: 10vh; overflow: auto; color: var(--muted); font: italic 12px/1.45 var(--body-font); }
.image-lightbox-caption:empty { display: none; }
.image-lightbox-caption p { margin: 0; }
.image-lightbox-close { position: absolute; top: 5px; right: 6px; display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--line); color: var(--text); background: var(--bg-soft); cursor: pointer; font: 24px/1 var(--body-font); }
.image-lightbox-close:hover { background: var(--panel-hover); }
body.image-lightbox-open { overflow: hidden; }
