/* Colour tokens: light and dark */
:root {
  --bg: #fff; --bg-subtle: #f8f9fa; --bg-strong: #eaecf0;
  --text: #202122; --text-subtle: #54595d; --link: #36c;
  --border: #a2a9b1; --border-subtle: #c8ccd1;
  --ext-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 1h5v5L8.86 3.85 4.7 8 4 7.3l4.15-4.16zM2 3h2v1H2v6h6V8h1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1'/%3E%3C/svg%3E");
  color-scheme: light;
}
html.theme-dark {
  --bg: #101418; --bg-subtle: #202122; --bg-strong: #27292d;
  --text: #eaecf0; --text-subtle: #a2a9b1; --link: #88a3e8;
  --border: #72777d; --border-subtle: #54595d;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html.theme-os {
    --bg: #101418; --bg-subtle: #202122; --bg-strong: #27292d;
    --text: #eaecf0; --text-subtle: #a2a9b1; --link: #88a3e8;
    --border: #72777d; --border-subtle: #54595d;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { scroll-padding-top: 12px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:not([href]) { cursor: pointer; }
a.ext::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 3px; background: currentColor; -webkit-mask: var(--ext-icon) no-repeat center / contain; mask: var(--ext-icon) no-repeat center / contain; }
button { font: inherit; }
.page { max-width: 1596px; margin: 0 auto; padding: 0 24px; }
html.wide .page { max-width: none; }

/* Header */
.header { display: flex; align-items: center; gap: 12px; height: 56px; }
.icon-btn { width: 32px; height: 32px; border: 0; background: none; border-radius: 2px; display: grid; place-items: center; cursor: pointer; color: var(--text); }
.icon-btn:hover { background: var(--bg-strong); }
.logo { display: flex; align-items: center; gap: 8px; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-globe {
  width: 50px; height: 50px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0%, #e8e8e8 55%, #cfcfcf 100%);
  border: 1px solid #c8c8c8;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Linux Libertine', Georgia, serif; font-size: 26px; color: #54595d; flex: 0 0 auto;
}
.wordmark { font-family: 'Linux Libertine', Georgia, 'Times New Roman', serif; line-height: 1.15; }
.wordmark b { display: block; font-weight: normal; font-size: 20px; font-variant: small-caps; letter-spacing: .04em; }
.search { display: flex; flex: 0 1 460px; margin-left: 20px; }
.search label { flex: 1; display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 2px 0 0 2px; padding: 0 8px; height: 32px; }
.search input { background: none; color: var(--text); border: 0; outline: 0; width: 100%; font: inherit; font-size: 14px; }
.search button { border: 1px solid var(--border); border-left: 0; background: var(--bg-subtle); color: var(--text); font-weight: bold; font-size: 14px; padding: 0 12px; border-radius: 0 2px 2px 0; cursor: pointer; }
.user-links { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 14px; }

/* Three-column layout */
.layout { display: grid; grid-template-columns: 180px minmax(0, 1fr) 180px; column-gap: 28px; }
html.toc-hidden .layout { grid-template-columns: minmax(0, 1fr) 180px; }
html.toc-hidden .toc { display: none; }
html.appearance-hidden .layout { grid-template-columns: 180px minmax(0, 1fr); }
html.appearance-hidden .appearance { display: none; }
html.toc-hidden.appearance-hidden .layout { grid-template-columns: minmax(0, 1fr); }

/* Side panels */
.panel { position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; padding: 20px 0 20px; font-size: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-subtle); padding-bottom: 6px; margin-bottom: 8px; }
.panel-head b { font-size: 14px; }
.hide-btn { border: 1px solid var(--border); background: var(--bg-subtle); border-radius: 2px; padding: 1px 8px; font-size: 12px; cursor: pointer; color: var(--text); }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc ul ul { padding-left: 12px; }
.toc li a { display: block; padding: 4px 0; color: var(--link); line-height: 1.3; }
.toc li a.active { color: var(--text); font-weight: bold; }
.appearance fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.appearance legend { font-weight: bold; padding: 0; margin-bottom: 4px; }
.appearance label { display: flex; align-items: center; gap: 6px; padding: 2px 0; cursor: pointer; }
.appearance input { margin: 0; accent-color: var(--link); }

/* Title bar and tabs */
.main { padding-top: 20px; min-width: 0; }
h1.firstHeading {
  font-family: 'Linux Libertine', Georgia, 'Times New Roman', serif;
  font-weight: normal; font-size: 28.8px; line-height: 1.375;
  margin: 0; padding-bottom: 2px;
}
.titlebar { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; border-bottom: 1px solid var(--border); }

/* Language menu */
.lang { position: relative; font-size: 14px; margin-bottom: 4px; flex: 0 0 auto; }
.lang summary { list-style: none; display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 2px; color: var(--link); font-weight: bold; cursor: pointer; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover { background: var(--bg-strong); }
.lang summary::after { content: ""; border: 4px solid transparent; border-top-color: currentColor; margin-top: 4px; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 2px); z-index: 10; min-width: 200px; margin: 0; padding: 6px 0; list-style: none; background: var(--bg); border: 1px solid var(--border); border-radius: 2px; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.lang-menu a { display: block; padding: 6px 14px; }
.toolbar { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; }
.toolbar ul { list-style: none; display: flex; margin: 0; padding: 0; }
.toolbar li a { display: block; padding: 10px 8px 6px; border-bottom: 2px solid transparent; }
.toolbar li:first-child a { padding-left: 0; }
.toolbar li.selected a { color: var(--text); border-bottom-color: var(--text); }
.toolbar li.selected a:hover { text-decoration: none; }
.caret::after { content: ""; display: inline-block; margin-left: 4px; border: 4px solid transparent; border-top-color: currentColor; vertical-align: -1px; }

/* Article body */
.content { font-size: 16px; line-height: 1.6; }
html.text-small .content { font-size: 14px; }
html.text-large .content { font-size: 20px; }
.content p { margin: .5em 0 1em; }
.content ul { margin: .3em 0 0 1.6em; padding: 0; }
.content ul li { margin-bottom: .1em; }
.mw-heading { display: flex; align-items: baseline; gap: 8px; }
.mw-heading2 { border-bottom: 1px solid var(--border); margin: 1em 0 .25em; overflow: hidden; }
.mw-heading3, .mw-heading4 { margin: .3em 0 0; padding-top: .5em; overflow: hidden; }
.mw-heading h2 { font-family: 'Linux Libertine', Georgia, 'Times New Roman', serif; font-weight: normal; font-size: 1.5em; line-height: 1.375; margin: 0; }
.mw-heading h3 { font-size: 1.2em; font-weight: bold; margin: 0; line-height: 1.6; }
.mw-heading h4 { font-size: 1em; font-weight: bold; margin: 0; line-height: 1.6; }
.editsection { font-size: 14px; color: var(--text-subtle); white-space: nowrap; user-select: none; }
.editsection a { margin: 0 .25em; }
sup.reference { font-size: .75em; line-height: 1; font-weight: normal; }
sup.reference a { white-space: nowrap; }

/* Infobox */
table.infobox {
  float: right; clear: right; width: 22em; margin: .5em 0 1em 1em; padding: .2em;
  border: 1px solid var(--border); background: var(--bg-subtle); color: var(--text);
  font-size: 88%; line-height: 1.5em; border-spacing: 3px;
}
.infobox-above { font-size: 125%; font-weight: bold; text-align: center; padding: .2em; }
.infobox-image { text-align: center; padding: .2em; }
.infobox-image img { width: 220px; max-width: 100%; height: auto; vertical-align: middle; }
.infobox-caption { font-size: 95%; padding: .2em 0; }
.infobox th { text-align: left; vertical-align: top; padding: .2em .6em .2em .2em; white-space: nowrap; }
.infobox td { vertical-align: top; padding: .2em; }

/* Images */
img { background: var(--bg-strong); }
figure.thumb {
  float: right; clear: right; width: 302px; margin: .5em 0 1.3em 1.4em;
  border: 1px solid var(--border-subtle); background: var(--bg-subtle); padding: 3px;
}
figure.thumb img { width: 100%; height: auto; display: block; border: 1px solid var(--border-subtle); }
/* A main heading never starts beside a photo from the previous section */
figure.thumb ~ .mw-heading2 { clear: right; }
figure.thumb figcaption { font-size: 14px; line-height: 1.4; padding: 6px 4px 4px; }

/* Tables, references, categories */
table.wikitable { border-collapse: collapse; background: var(--bg-subtle); border: 1px solid var(--border); margin: 1em 0; font-size: 14px; }
table.wikitable th, table.wikitable td { border: 1px solid var(--border); padding: .2em .4em; text-align: left; vertical-align: top; }
table.wikitable th { background: var(--bg-strong); text-align: center; }
.reflist { font-size: 90%; columns: 30em; margin-bottom: .5em; }
.reflist ol { margin: .3em 0 0 3.2em; padding: 0; }
.reflist li { margin-bottom: .1em; break-inside: avoid; }
.catlinks { clear: both; border: 1px solid var(--border); background: var(--bg-subtle); padding: 5px; margin: 1.5em 0 1em; font-size: 14px; line-height: 1.6; }
.catlinks ul { display: inline; list-style: none; margin: 0; padding: 0; }
.catlinks li { display: inline-block; border-left: 1px solid var(--border); padding: 0 .5em; line-height: 1.25; margin: .125em 0; }
.catlinks li:first-child { border-left: 0; padding-left: .25em; }
.footer { border-top: 1px solid var(--border); margin-top: 16px; padding: 12px 0 32px; font-size: 12.5px; }

/* Narrower screens drop the side panels */
@media (max-width: 1119px) {
  .layout, html.toc-hidden .layout, html.appearance-hidden .layout { grid-template-columns: 180px minmax(0, 1fr); }
  .appearance { display: none; }
}
@media (max-width: 799px) {
  .page { padding: 0 16px; }
  .layout, html.toc-hidden .layout, html.appearance-hidden .layout { grid-template-columns: minmax(0, 1fr); }
  .toc, .search, .user-links { display: none; }
  .toolbar ul:last-child li:not(:first-child) { display: none; }
  table.infobox, figure.thumb { float: none; width: 100%; margin: 0 0 1em; }
  table.wikitable { display: block; overflow-x: auto; }
}
