:root {
  color-scheme: light;
  --blue: #36c;
  --blue-hover: #2a4b8d;
  --text: #202122;
  --muted: #54595d;
  --line: #a2a9b1;
  --soft-line: #c8ccd1;
  --page: #f8f9fa;
  --panel: #fff;
  --notice: #f8f4e8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Lato, Arial, sans-serif;
  color: var(--text);
  background: var(--page);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-size: 15px; line-height: 1.6; background: var(--page); }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); text-decoration: underline; }
a:visited { color: #5a3696; }
button, input { font: inherit; }
.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; }

.mw-header {
  min-height: 64px;
  padding: 8px max(20px, calc((100vw - 1440px) / 2));
  display: flex;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--soft-line);
  background: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 220px; color: var(--text) !important; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #eaecf0; border-radius: 50%; font-family: Georgia, serif; font-size: 23px; color: #54595d; }
.brand strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 19px; font-weight: 400; line-height: 1.15; }
.mw-search { position: relative; display: flex; flex: 1; max-width: 560px; height: 34px; }
.mw-search input { width: 100%; min-width: 0; padding: 5px 9px; border: 1px solid var(--line); border-right: 0; border-radius: 2px 0 0 2px; background: #fff; font-size: 14px; }
.mw-search input:focus { z-index: 1; outline: 1px solid var(--blue); outline-offset: -1px; }
.mw-search button { padding: 0 13px; border: 1px solid var(--line); border-radius: 0 2px 2px 0; background: #f8f9fa; color: var(--text); font-size: 13px; cursor: pointer; }
.mw-search button:hover { background: #fff; }
.search-results { position: absolute; z-index: 5; top: 56px; left: max(270px, calc((100vw - 1440px) / 2 + 248px)); width: min(560px, calc(100vw - 32px)); max-height: 65vh; overflow: auto; border: 1px solid var(--line); background: #fff; box-shadow: 0 2px 6px #0002; }
.search-results[hidden] { display: none; }
.search-results a { display: block; padding: 8px 11px; color: var(--text); border-bottom: 1px solid #eaecf0; }
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover, .search-results a[aria-selected="true"] { background: #f1f4f8; text-decoration: none; }
.search-results strong { color: var(--blue); font-weight: 500; }
.search-results small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.search-empty { padding: 10px 12px; color: var(--muted); font-size: 13px; }

.page-layout { display: flex; max-width: 1440px; margin: 0 auto; align-items: stretch; }
.mw-sidebar { flex: 0 0 205px; padding: 24px 18px 30px 22px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.mw-sidebar h2 { margin: 10px 0 7px; padding-bottom: 3px; border-bottom: 1px solid var(--soft-line); color: var(--muted); font-size: 12px; font-weight: 600; }
.mw-sidebar ul { margin: 0; padding: 0; list-style: none; }
.mw-sidebar li { margin: 4px 0; }
.mw-sidebar a { color: var(--blue); }
.mw-sidebar a.current { color: var(--text); font-weight: 700; }

.mw-content { flex: 1; min-width: 0; max-width: 1150px; min-height: calc(100vh - 64px); padding: 0 40px 36px; border-left: 1px solid var(--soft-line); background: var(--panel); }
.article-header h1 { margin: 20px 0 8px; padding: 0 0 7px; border-bottom: 1px solid var(--line); font-family: Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 400; line-height: 1.25; }
.article-tabs { display: flex; gap: 2px; margin: 0 0 10px; border-bottom: 1px solid var(--soft-line); }
.article-tab { padding: 6px 12px 7px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--blue); font-size: 13px; cursor: pointer; }
.article-tab:hover { background: #f8f9fa; }
.article-tab.active { border-bottom-color: var(--blue); color: var(--text); font-weight: 600; }
.wiki-auth { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--muted); font-size: 12px; }
.wiki-auth-button { padding: 4px 0; border: 0; background: transparent; color: var(--blue); font: inherit; cursor: pointer; }
.wiki-auth-button:hover { text-decoration: underline; }
.wiki-auth [hidden] { display: none; }
.article-edit-notice { margin: 6px 0 10px; padding: 6px 9px; border-left: 3px solid #14866d; background: #f2faf7; color: #315b4e; font-size: 12px; }
.article-edit-notice[hidden] { display: none; }
.article-edit-notice.local-edit-notice { border-left-color: #72777d; background: #f8f9fa; color: var(--muted); }
.wiki-editor, .wiki-history { margin: 12px 0 18px; padding: 14px 16px; border: 1px solid var(--soft-line); background: #f8f9fa; }
.wiki-editor[hidden], .wiki-history[hidden] { display: none; }
.wiki-editor h2, .wiki-history h2 { margin: 0 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 21px; font-weight: 400; }
.editor-mode-note { margin: 8px 0; padding: 8px 10px; border-left: 3px solid #72777d; background: #fff; color: var(--muted); font-size: 13px; }
.editor-mode-note.shared { border-color: #14866d; }
.editor-help { margin: 8px 0 12px; color: var(--muted); font-size: 12px; }
.editor-help code { padding: 1px 4px; background: #eaecf0; color: var(--text); }
.wiki-editor form { display: grid; gap: 9px; }
.wiki-editor label { display: grid; gap: 3px; font-size: 12px; font-weight: 600; }
.wiki-editor input, .wiki-editor textarea { width: 100%; min-width: 0; padding: 7px 8px; border: 1px solid var(--line); border-radius: 2px; background: #fff; color: var(--text); font-size: 14px; font-weight: 400; line-height: 1.5; }
.wiki-editor textarea[name="body"] { min-height: 330px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.wiki-editor textarea:focus, .wiki-editor input:focus { outline: 2px solid #36c5f0; outline-offset: 0; }
.editor-subtle { color: var(--muted); font-weight: 400; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.editor-actions button, .wiki-history button { padding: 6px 10px; border: 1px solid var(--line); border-radius: 2px; background: #fff; color: var(--text); font-size: 13px; cursor: pointer; }
.editor-actions button:hover, .wiki-history button:hover { background: #f1f4f8; }
.editor-actions button.primary-action { border-color: #36c; background: #36c; color: #fff; }
.editor-actions button.primary-action:hover { background: #2a4b8d; }
.editor-actions button:disabled { opacity: .6; cursor: wait; }
.editor-status { min-height: 1.4em; margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.editor-status.error { color: #b32424; }
.wiki-history ol { margin: 8px 0 0; padding-left: 25px; }
.wiki-history li { margin: 7px 0; }
.wiki-history small { display: block; color: var(--muted); }
.wiki-history button { margin-top: 4px; padding: 3px 8px; }
.date-notice { display: inline-block; margin: 7px 0 12px; padding: 3px 8px; border: 1px solid #c8ccd1; background: var(--notice); color: var(--muted); font-size: 11px; line-height: 1.4; }
.lead { margin: 12px 0 14px; font-size: 15px; line-height: 1.65; }
article p { margin: 0.5em 0 0.8em; }
article section { clear: both; }
article h2 { margin: 1.2em 0 0.45em; padding-bottom: 2px; border-bottom: 1px solid var(--soft-line); font-family: Georgia, "Times New Roman", serif; font-size: 21px; font-weight: 400; line-height: 1.3; }
article h3 { margin: 1em 0 0.35em; font-size: 16px; font-weight: 600; }
.reference { padding-left: 2px; font-size: 11px; line-height: 0; vertical-align: super; }
.article-list, .related ul { padding-left: 24px; }
.article-list li, .related li { margin: 4px 0; }

.wikitable-scroll { max-width: 100%; margin: 0.9em 0 1.1em; overflow-x: auto; clear: both; }
.wikitable { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; line-height: 1.5; }
.wikitable caption { padding: 0 0 5px; color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; }
.wikitable th, .wikitable td { min-width: 110px; padding: 6px 8px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.wikitable th { background: #eaecf0; font-weight: 600; }
.wikitable tbody tr:nth-child(even) { background: #f8f9fa; }
.wikitable td p { margin: 0.25em 0; }

.toc { display: table; min-width: 220px; max-width: 100%; margin: 15px 0 20px; padding: 8px 14px 10px; border: 1px solid var(--soft-line); background: #f8f9fa; font-size: 13px; line-height: 1.55; }
.toc-title { margin-bottom: 4px; font-weight: 700; }
.toc ol { margin: 0; padding-left: 22px; }
.toc ol ol { margin: 0; padding-left: 22px; list-style-type: lower-alpha; }
.toc li { margin: 1px 0; }
.infobox { float: right; clear: right; width: 270px; max-width: 44%; margin: 5px 0 16px 22px; border: 1px solid var(--line); background: #f8f9fa; font-size: 12px; line-height: 1.45; }
.infobox-title { padding: 7px 9px; background: #eaecf0; text-align: center; font-weight: 700; }
.infobox-image { margin: 0; padding: 7px; background: #fff; text-align: center; }
.infobox-image img { display: block; width: 100%; height: auto; max-height: 300px; object-fit: contain; }
.infobox-image figcaption { padding: 5px 2px 0; color: var(--muted); font-size: 11px; }
.article-figure { float: right; width: 250px; margin: 4px 0 14px 18px; padding: 6px; border: 1px solid var(--soft-line); background: #fff; text-align: center; }
.article-figure img { display: block; width: 100%; height: auto; }
.article-figure figcaption { padding: 5px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.infobox dl { display: grid; grid-template-columns: 88px 1fr; margin: 0; }
.infobox dt, .infobox dd { margin: 0; padding: 5px 7px; border-top: 1px solid #eaecf0; overflow-wrap: anywhere; }
.infobox dt { color: var(--muted); font-weight: 600; }
.references { clear: both; margin-top: 1.4em; font-size: 12px; }
.references h2, .related h2 { font-size: 18px; }
.references ol { padding-left: 28px; }
.references li { padding: 2px 0 3px 3px; }
.related ul { columns: 2; }
.home-content { max-width: 1150px; }
.featured-panel { margin: 14px 0 22px; }
.home-panel { border: 1px solid var(--soft-line); background: #fff; }
.home-panel > h2 { margin: 0; padding: 6px 10px; border-bottom: 1px solid var(--soft-line); background: #eaecf0; font-family: inherit; font-size: 15px; font-weight: 600; }
.community-list { margin: 0; padding: 0; list-style: none; }
.community-list li { display: inline-block; margin: 4px 9px; }
.community-list li:last-child { border-bottom: 0; }
.community-list a { font-weight: 600; }
.all-articles { clear: both; }
.all-articles > h2 { margin-top: 18px; }
.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 28px; }
.article-category h3 { margin: 0 0 4px; padding-bottom: 2px; border-bottom: 1px solid var(--soft-line); font-size: 14px; }
.article-category ul { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 16px; font-size: 13px; }
.article-category li { padding: 2px 0; break-inside: avoid; }

@media (max-width: 850px) {
  .mw-header { gap: 12px; padding: 8px 12px; flex-wrap: wrap; }
  .brand { min-width: 0; flex: 1; }
  .mw-search { order: 2; max-width: none; flex: 1 1 100%; }
  .search-results { top: 100px; left: 12px; }
  .page-layout { display: block; }
  .mw-sidebar { display: none; }
  .mw-content { max-width: none; min-height: calc(100vh - 110px); padding: 0 18px 28px; border-left: 0; }
}
@media (max-width: 620px) {
  .article-header h1 { font-size: 25px; }
  .article-tabs { flex-wrap: wrap; }
  .wiki-auth { width: 100%; justify-content: flex-end; padding: 4px 8px; }
  .wiki-editor, .wiki-history { margin-right: -4px; margin-left: -4px; padding: 11px; }
  .wiki-editor textarea[name="body"] { min-height: 260px; }
  .infobox { float: none; clear: both; width: 100%; max-width: 100%; margin: 4px 0 16px; }
  .infobox-image img { max-height: 360px; }
  .article-figure { float: none; width: min(100%, 340px); margin: 10px 0 14px; }
  .category-grid { grid-template-columns: 1fr; }
  .article-category ul { columns: 1; }
  .related ul { columns: 1; }
}
