:root {
  --page-bg: #f8f9fa;
  --panel-bg: #ffffff;
  --line: #a2a9b1;
  --line-soft: #c8ccd1;
  --line-faint: #eaecf0;
  --text: #202122;
  --text-muted: #54595d;
  --link: #0645ad;
  --link-visited: #0b0080;
  --tab-bg: #f8fbff;
  --tab-border: #a7d7f9;
  --sidebar-text: #3366cc;
  --infobox-head: #d8e6f3;
  --infobox-row: #f8fbff;
  --notice-bg: #f8f9fa;
  --portal-bg: #f5faff;
  --portal-head: #f1f2ff;
  --green-line: #3ea572;
  --content-width: 1240px;
  --site-bg: linear-gradient(90deg, #f6f6f6 0, #f8f9fa 212px, #ffffff 212px, #ffffff 100%);
  --surface-bg: #ffffff;
  --surface-alt: #f8f9fa;
  --surface-soft: #eaecf0;
  --surface-muted: #f6f6f6;
  --topbar-bg: linear-gradient(#ffffff 0, #ffffff 45%, #f6f6f6 100%);
  --boot-bg: #f8f9fa;
  --boot-card-bg: #ffffff;
  --input-bg: #ffffff;
  --input-text: #202122;
  --input-placeholder: #72777d;
  --heading-text: #000000;
  --code-bg: #f8f9fa;
  --blockquote-bg: #f8f9fa;
  --table-head-bg: #eaecf0;
  --infobox-bg: #f8f9fa;
  --infobox-subtitle-bg: #eef3f8;
  --infobox-image-bg: #ffffff;
  --welcome-bg: #ffffff;
  --topic-bg: #ffffff;
  --topic-text: #202122;
  --image-day-bg: #fffaf0;
  --button-bg: #f8f9fa;
  --button-text: #202122;
  --primary-bg: #3366cc;
  --primary-border: #3366cc;
  --primary-text: #ffffff;
  --mark-bg: #fff3cd;
  --diff-old: #fff0f0;
  --diff-new: #f0fff4;
  --red-link: #ba0000;
  --serif: Georgia, 'Times New Roman', Times, serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}


html[data-font="mactype"] {
  --sans: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Lucida Grande', Arial, sans-serif;
  --serif: 'New York', 'Iowan Old Style', 'Apple Garamond', Baskerville, Georgia, 'Times New Roman', serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html[data-font="classic"] {
  --sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: Georgia, 'Times New Roman', Times, serif;
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
  text-rendering: auto;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #101418;
  --panel-bg: #101418;
  --line: #6b7785;
  --line-soft: #394450;
  --line-faint: #222b34;
  --text: #e6edf3;
  --text-muted: #a7b0ba;
  --link: #8cb8ff;
  --link-visited: #c0a8ff;
  --tab-bg: #151b22;
  --tab-border: #394b60;
  --sidebar-text: #8cb8ff;
  --infobox-head: #233447;
  --infobox-row: #151d26;
  --notice-bg: #151b22;
  --portal-bg: #111820;
  --portal-head: #171f2a;
  --site-bg: linear-gradient(90deg, #101418 0, #101418 212px, #101418 212px, #101418 100%);
  --surface-bg: #101418;
  --surface-alt: #151b22;
  --surface-soft: #1b232d;
  --surface-muted: #121820;
  --topbar-bg: linear-gradient(#101418 0, #101418 45%, #151b22 100%);
  --boot-bg: #101418;
  --boot-card-bg: #151b22;
  --input-bg: #0d1117;
  --input-text: #e6edf3;
  --input-placeholder: #9ba7b4;
  --heading-text: #f0f6fc;
  --code-bg: #151b22;
  --blockquote-bg: #151b22;
  --table-head-bg: #1b232d;
  --infobox-bg: #111820;
  --infobox-subtitle-bg: #151d26;
  --infobox-image-bg: #0d1117;
  --welcome-bg: #101418;
  --topic-bg: #101418;
  --topic-text: #e6edf3;
  --image-day-bg: #15120a;
  --button-bg: #151b22;
  --button-text: #e6edf3;
  --primary-bg: #3f7ee8;
  --primary-border: #3f7ee8;
  --primary-text: #ffffff;
  --mark-bg: #4b3b06;
  --diff-old: #3a171a;
  --diff-new: #0f2f1d;
  --red-link: #ff8f8f;
}

html[data-theme="oled"] {
  color-scheme: dark;
  --page-bg: #000000;
  --panel-bg: #000000;
  --line: #6b7785;
  --line-soft: #313942;
  --line-faint: #15191d;
  --text: #f2f5f7;
  --text-muted: #a7b0ba;
  --link: #8cb8ff;
  --link-visited: #c0a8ff;
  --tab-bg: #060606;
  --tab-border: #35465a;
  --sidebar-text: #8cb8ff;
  --infobox-head: #10243a;
  --infobox-row: #050505;
  --notice-bg: #050505;
  --portal-bg: #000000;
  --portal-head: #050505;
  --site-bg: #000000;
  --surface-bg: #000000;
  --surface-alt: #050505;
  --surface-soft: #0b0b0b;
  --surface-muted: #050505;
  --topbar-bg: linear-gradient(#000000 0, #000000 45%, #050505 100%);
  --boot-bg: #000000;
  --boot-card-bg: #050505;
  --input-bg: #000000;
  --input-text: #f2f5f7;
  --input-placeholder: #a7b0ba;
  --heading-text: #ffffff;
  --code-bg: #050505;
  --blockquote-bg: #050505;
  --table-head-bg: #0b0b0b;
  --infobox-bg: #000000;
  --infobox-subtitle-bg: #050505;
  --infobox-image-bg: #000000;
  --welcome-bg: #000000;
  --topic-bg: #000000;
  --topic-text: #f2f5f7;
  --image-day-bg: #050402;
  --button-bg: #050505;
  --button-text: #f2f5f7;
  --primary-bg: #3f7ee8;
  --primary-border: #3f7ee8;
  --primary-text: #ffffff;
  --mark-bg: #4b3b06;
  --diff-old: #2a0e10;
  --diff-new: #082414;
  --red-link: #ff8f8f;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background: var(--site-bg);
  font: 14px/1.6 var(--sans);
}

body.is-searching {
  cursor: progress;
}

html.is-booting .page-shell {
  visibility: hidden;
}

html.is-ready .boot-screen {
  display: none;
}

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  background: var(--boot-bg);
  color: var(--text);
}

.boot-card {
  display: grid;
  gap: 4px;
  min-width: min(360px, calc(100vw - 48px));
  padding: 18px 20px;
  border: 1px solid var(--line-soft);
  background: var(--boot-card-bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
  text-align: center;
}

.boot-card strong {
  font: 24px/1.1 var(--serif);
  font-variant: small-caps;
}

.boot-card span {
  color: var(--text-muted);
  font-size: 12px;
}


button,
input,
select,
textarea {
  font: inherit;
}

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

a:visited {
  color: var(--link-visited);
}

a:hover,
a:focus {
  text-decoration: underline;
}

.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;
}

.page-shell {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  min-height: 100vh;
}

.wiki-sidebar {
  padding: 14px 16px 32px;
  color: var(--text-muted);
}

.brand {
  display: grid;
  justify-items: center;
  gap: 3px;
  width: 100%;
  color: var(--text);
  text-align: center;
  text-decoration: none;
}

.brand:visited,
.brand:hover,
.brand:focus {
  color: var(--text);
  text-decoration: none;
}

.brand-globe {
  width: 138px;
  height: 106px;
  object-fit: contain;
  object-position: center;
}

.brand-wordmark {
  font-family: var(--serif);
  font-size: 25px;
  font-variant: small-caps;
  line-height: 1;
  letter-spacing: .02em;
  white-space: nowrap;
}

.brand-subtitle {
  max-width: 174px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.2;
}

.side-nav {
  margin-top: 26px;
  padding-top: 10px;
  background: linear-gradient(to right, transparent 0, var(--line-faint) 35%, var(--line-faint) 65%, transparent 100%) top / 100% 1px no-repeat;
}

.side-nav h2 {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
}

.side-nav a {
  display: block;
  margin: 2px 0;
  color: var(--sidebar-text);
  font-size: 12px;
  line-height: 1.35;
}

.wiki-main {
  min-width: 0;
  background: var(--panel-bg);
  border-left: 1px solid var(--tab-border);
}

.top-bar {
  position: static;
  z-index: 5;
  min-height: 77px;
  padding: 10px 18px 0 0;
  background: var(--topbar-bg);
}

.mobile-brand-row {
  display: none;
}

.mobile-brand {
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
}

.mobile-brand:visited,
.mobile-brand:hover,
.mobile-brand:focus {
  color: var(--text);
  text-decoration: none;
}

.mobile-brand-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.mobile-brand strong {
  display: block;
  font: 21px/1 var(--serif);
  font-variant: small-caps;
}

.mobile-brand small {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.15;
}

.personal-links {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  min-height: 24px;
  font-size: 12px;
}

.tabs-row {
  display: grid;
  grid-template-columns: auto 1fr minmax(220px, 360px);
  align-items: end;
  min-height: 43px;
  border-bottom: 1px solid var(--tab-border);
}

.namespace-tabs,
.view-tabs {
  display: flex;
  align-items: end;
  height: 43px;
}

.view-tabs {
  justify-content: flex-end;
}

.tab {
  display: inline-flex;
  align-items: center;
  min-height: 43px;
  padding: 0 12px;
  border-right: 1px solid var(--tab-border);
  background: linear-gradient(var(--surface-bg) 0, var(--tab-bg) 100%);
  color: var(--link);
  font-size: 13px;
}

.namespace-tabs .tab:first-child,
.view-tabs .tab:first-child {
  border-left: 1px solid var(--tab-border);
}

.tab.is-active {
  color: var(--text);
  background: var(--surface-bg);
  border-bottom: 1px solid var(--panel-bg);
  margin-bottom: -1px;
}

.search-box {
  display: flex;
  align-items: center;
  align-self: center;
  margin: 0 0 8px 12px;
  border: 1px solid var(--line);
  background: var(--input-bg);
}

.search-box input {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 0;
  padding: 0 8px;
  outline: 0;
}

.search-box button {
  width: 34px;
  height: 30px;
  border: 0;
  border-left: 1px solid var(--line-soft);
  background: var(--surface-alt);
  color: var(--text-muted);
  cursor: pointer;
}

.content-frame {
  width: min(100%, var(--content-width));
  padding: 28px 22px 48px;
}

.article-header {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.article-header h1 {
  margin: 0;
  color: var(--heading-text);
  font: 32px/1.25 var(--serif);
  font-weight: 400;
}

.article-subtitle {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.article-body {
  min-width: 0;
}

.article-body p {
  margin: 0 0 12px;
}

.article-body h2 {
  margin: 22px 0 10px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line);
  color: var(--heading-text);
  font: 23px/1.3 var(--serif);
  font-weight: 400;
}

.article-body h3 {
  margin: 16px 0 8px;
  font-size: 17px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 14px 24px;
  padding: 0;
}

.article-body blockquote {
  margin: 12px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--line-soft);
  background: var(--surface-alt);
  color: var(--text-muted);
}

.article-body code {
  padding: 1px 4px;
  border: 1px solid var(--line-faint);
  background: var(--surface-alt);
  border-radius: 2px;
}

.article-body table {
  width: 100%;
  margin: 12px 0;
  border-collapse: collapse;
  font-size: 13px;
}

.article-body th,
.article-body td {
  padding: 6px 8px;
  border: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.article-body th {
  background: var(--table-head-bg);
}

.infobox {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  font-size: 12px;
}

.infobox-title {
  padding: 7px 8px;
  background: var(--infobox-head);
  border-bottom: 1px solid var(--line);
  color: var(--heading-text);
  text-align: center;
  font-size: 15px;
  font-weight: 700;
}

.infobox-subtitle {
  padding: 3px 8px;
  background: var(--infobox-subtitle-bg);
  border-bottom: 1px solid var(--line-soft);
  text-align: center;
  font-style: italic;
}

.infobox-image {
  display: grid;
  place-items: center;
  padding: 8px;
  background: var(--surface-bg);
  border-bottom: 1px solid var(--line-soft);
}

.infobox-image img,
.infobox-image svg {
  width: 100%;
  max-height: 190px;
  object-fit: cover;
}

.infobox-caption {
  padding: 0 8px 8px;
  color: var(--text-muted);
  text-align: center;
  font-size: 11px;
}

.infobox-row {
  display: grid;
  grid-template-columns: 104px 1fr;
  border-top: 1px solid var(--line-soft);
}

.infobox-row b,
.infobox-row span {
  padding: 5px 7px;
}

.infobox-row b {
  background: var(--infobox-row);
}

.front-page {
  display: grid;
  gap: 16px;
}

.welcome-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 18px 24px;
  border: 1px solid var(--line-soft);
  background: var(--input-bg);
}

.welcome-box h1 {
  margin: 0;
  color: var(--text-muted);
  font: 34px/1.15 var(--serif);
  font-weight: 400;
  font-variant: small-caps;
  text-align: center;
}

.welcome-box p {
  margin: 2px 0 0;
  color: var(--text-muted);
  text-align: center;
}

.stats-box {
  min-width: 240px;
  padding-left: 20px;
  border-left: 1px solid var(--line-soft);
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
}

.stats-box strong {
  display: block;
  color: var(--text);
  font-size: 17px;
}

.topic-strip {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  border: 1px solid var(--line-soft);
  background: var(--input-bg);
}

.topic-strip a {
  display: block;
  padding: 6px 8px;
  border-top: 4px solid var(--green-line);
  border-right: 1px solid var(--line-soft);
  color: var(--topic-text);
  text-align: center;
  font-size: 12px;
}

.topic-strip a:nth-child(2) { border-top-color: #7fb069; }
.topic-strip a:nth-child(3) { border-top-color: #4b9cd3; }
.topic-strip a:nth-child(4) { border-top-color: #8b78c6; }
.topic-strip a:nth-child(5) { border-top-color: #c06c84; }
.topic-strip a:nth-child(6) { border-top-color: #e2a23a; }
.topic-strip a:nth-child(7) { border-top-color: #9a6a43; }
.topic-strip a:nth-child(8) { border-right: 0; border-top-color: #5fa8a8; }

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  border: 1px solid var(--line-soft);
  background: var(--line-soft);
}

.portal-card {
  min-height: 270px;
  background: var(--portal-bg);
}

.portal-card h2 {
  margin: 0;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--portal-head);
  color: var(--text-muted);
  font-size: 21px;
  font-weight: 400;
  font-variant: small-caps;
}

.portal-card-body {
  padding: 12px;
}

.featured-row {
  display: grid;
  grid-template-columns: 1fr 145px;
  gap: 12px;
}

.featured-img,
.day-img {
  width: 100%;
  border: 1px solid var(--line-soft);
  background: var(--input-bg);
}

.timeline-list,
.did-you-know-list {
  margin: 0;
  padding-left: 20px;
}

.timeline-list li,
.did-you-know-list li {
  margin-bottom: 6px;
}

.image-day {
  border: 1px solid var(--line-soft);
  background: var(--image-day-bg);
}

.image-day h2 {
  margin: 0;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-muted);
  font-size: 21px;
  font-weight: 400;
  font-variant: small-caps;
}

.image-day figure {
  display: grid;
  justify-items: center;
  margin: 0;
  padding: 28px 16px 18px;
}

.image-day img {
  width: min(100%, 520px);
  border: 1px solid var(--line-soft);
}

.image-day figcaption {
  max-width: 720px;
  margin-top: 10px;
  color: var(--text-muted);
  text-align: center;
  font-size: 12px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 2px;
  border: 1px solid var(--line-soft);
  background: var(--line-soft);
}

.about-grid section {
  padding: 12px;
  background: var(--input-bg);
}

.about-grid h2 {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 21px;
  font-weight: 400;
  font-variant: small-caps;
}

.sister-projects {
  padding: 14px;
  border: 1px solid var(--line-soft);
  background: var(--input-bg);
}

.sister-projects h2 {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 21px;
  font-weight: 400;
  font-variant: small-caps;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 12px;
}

.project-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 8px;
  align-items: center;
}

.project-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--green-line);
  font-weight: 700;
}

.project-item strong {
  display: block;
  line-height: 1.2;
}

.project-item span {
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
}

.categories {
  margin-top: 24px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 13px;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.history-table th,
.history-table td {
  padding: 8px;
  border: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.history-table th {
  background: var(--table-head-bg);
}

.editor-panel {
  display: grid;
  gap: 12px;
}

.editor-panel textarea {
  width: 100%;
  min-height: 380px;
  padding: 12px;
  border: 1px solid var(--line);
  font: 14px/1.55 ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
  resize: vertical;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.primary-button,
.secondary-button {
  border: 1px solid var(--line);
  padding: 7px 11px;
  background: var(--boot-bg);
  color: var(--text);
  cursor: pointer;
}

.primary-button {
  border-color: var(--primary-border);
  background: var(--primary-bg);
  color: var(--primary-text);
}

.editor-note,
.empty-state {
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  background: var(--notice-bg);
  color: var(--text-muted);
}

.search-results {
  display: grid;
  gap: 12px;
}

.search-result {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-faint);
}

.search-result h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 400;
}

.search-result p {
  margin: 3px 0 0;
}

.footer {
  margin-top: 32px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-muted);
  font-size: 11px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

@media (max-width: 980px) {
  body {
    background: var(--surface-bg);
  }

  .page-shell {
    grid-template-columns: 1fr;
  }

  .wiki-sidebar {
    display: none;
  }

  .wiki-main {
    border-left: 0;
  }

  .top-bar {
    min-height: 0;
    padding: 10px 12px 0;
  }

  .mobile-brand-row {
    display: flex;
    margin-bottom: 8px;
  }

  .mobile-brand {
    display: inline-flex;
  }

  .personal-links {
    justify-content: flex-start;
  }

  .tabs-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding-bottom: 8px;
  }

  .namespace-tabs,
  .view-tabs {
    height: auto;
    flex-wrap: wrap;
  }

  .tab {
    min-height: 34px;
  }

  .search-box {
    margin: 0;
  }

  .content-frame {
    width: 100%;
    padding: 20px 14px 36px;
  }

  .article-grid,
  .about-grid,
  .portal-grid,
  .welcome-box {
    grid-template-columns: 1fr !important;
  }

  .infobox {
    max-width: 420px;
  }

  .history-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .stats-box {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line-soft);
    padding-top: 12px;
  }

  .topic-strip,
  .project-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .tabs-row {
    align-items: stretch;
  }

  .namespace-tabs,
  .view-tabs {
    width: 100%;
  }

  .tab {
    flex: 1 1 auto;
    justify-content: center;
  }

  .topic-strip,
  .project-list,
  .featured-row {
    grid-template-columns: 1fr;
  }

  .article-header h1 {
    font-size: 28px;
  }

  .welcome-box h1 {
    font-size: 26px;
  }
}

.article--main-page .article-header h1 {
  color: var(--text-muted);
  font-variant: small-caps;
}

.article-body .infobox-inline {
  float: right;
  width: 320px;
  margin: 0 0 16px 24px;
}

.infobox-note {
  padding: 8px;
  border-top: 1px solid var(--line-soft);
  background: var(--input-bg);
}

.messagebox {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  margin: 14px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left-width: 8px;
  background: var(--surface-alt);
}

.messagebox strong {
  color: var(--heading-text);
}

.messagebox p:last-child {
  margin-bottom: 0;
}

.messagebox-info,
.messagebox-nota {
  border-left-color: #36c;
  background: var(--notice-bg);
}

.messagebox-warning,
.messagebox-aviso {
  border-left-color: #c8a400;
  background: var(--notice-bg);
}

.messagebox-error,
.messagebox-erro {
  border-left-color: #d33;
  background: var(--notice-bg);
}

.wiki-quote {
  margin: 18px 0;
  padding: 12px 16px;
  border-left: 4px solid var(--line-soft);
  background: var(--surface-alt);
}

.wiki-quote blockquote {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 18px/1.45 var(--serif);
}

.wiki-quote figcaption {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: right;
}

.wiki-panel {
  margin: 16px 0;
  border: 1px solid var(--line-soft);
  background: var(--input-bg);
}

.wiki-panel h2 {
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--portal-head);
  color: var(--text-muted);
  font: 21px/1.3 var(--sans);
  font-weight: 400;
  font-variant: small-caps;
}

.wiki-panel-body {
  padding: 12px;
}

.wiki-panel-body p:last-child,
.portal-card-body p:last-child {
  margin-bottom: 0;
}

.wiki-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  margin: 16px 0;
  border: 1px solid var(--line-soft);
  background: var(--line-soft);
}

.wiki-card-grid .portal-card {
  min-height: 0;
}

.wiki-card-grid-compacto,
.wiki-card-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.wiki-welcome {
  margin: 0 0 16px;
}

.wiki-welcome .stats-box {
  display: none;
}

.wiki-welcome h1 {
  text-align: center;
}

.wiki-welcome p {
  text-align: center;
}

.wiki-image-box {
  margin: 16px 0;
}

.markdown-image {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line-soft);
  background: var(--input-bg);
}

@media (max-width: 980px) {
  .article-body .infobox-inline {
    float: none;
    width: 100%;
    max-width: 420px;
    margin: 0 0 16px;
  }

  .wiki-card-grid {
    grid-template-columns: 1fr;
  }
}

.article-body pre {
  overflow-x: auto;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  background: var(--surface-alt);
  font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
}

.article-body pre code {
  padding: 0;
  border: 0;
  background: transparent;
}


[hidden] {
  display: none !important;
}

.account-user {
  color: var(--text-muted);
}

.proposal-list {
  display: grid;
  gap: 14px;
}

.proposal-card {
  padding: 12px;
  border: 1px solid var(--line-soft);
  background: var(--input-bg);
}

.proposal-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 400;
}

.proposal-card p {
  margin: 4px 0;
}

.proposal-card details {
  margin: 10px 0;
}

.proposal-card pre {
  max-height: 340px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line-soft);
  background: var(--surface-alt);
  white-space: pre-wrap;
}

.access-required-page .editor-actions,
.proposal-result-page .editor-actions {
  margin-top: 12px;
}

/* páginas estáticas de erro */
.error-booting .error-shell {
  visibility: hidden;
}

.error-ready .error-shell {
  visibility: visible;
}

.error-content {
  max-width: 1120px;
}

.system-error-page .article-header h1 {
  margin-bottom: 4px;
}

.error-actions {
  margin-top: 16px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin: 0 6px 8px 0;
  padding: 7px 12px;
  border: 1px solid var(--line-soft);
  background: var(--surface-alt);
  color: var(--link);
  text-decoration: none;
}

.button-link:visited {
  color: var(--link-visited);
}

.button-link:hover,
.button-link:focus {
  background: var(--surface-bg);
  text-decoration: none;
}

.button-link.is-primary {
  border-color: var(--primary-border);
  background: var(--primary-bg);
  color: var(--primary-text);
}

.button-link.is-primary:visited {
  color: var(--primary-text);
}

.wiki-messagebox-warning {
  border-left-color: #d33;
}


.editor-preview-slot {
  margin-top: 22px;
}

.editor-preview {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.editor-preview-header {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  background: var(--surface-alt);
}

.editor-preview-header h2 {
  margin: 0 0 4px;
  font-family: Georgia, 'Linux Libertine', 'Times New Roman', serif;
  font-size: 22px;
  font-weight: 400;
}

.editor-preview-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

/* alpha 4 */
a.red-link,
a.red-link:visited {
  color: var(--red-link);
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.history-actions button,
.revision-actions button {
  font: inherit;
}

.revision-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 14px 0 18px;
  border: 1px solid var(--line-soft);
  background: var(--surface-alt);
}

.revision-summary div {
  padding: 8px 10px;
  border-right: 1px solid var(--line-soft);
}

.revision-summary div:last-child {
  border-right: 0;
}

.revision-summary dt {
  color: var(--text-muted);
  font-size: 12px;
}

.revision-summary dd {
  margin: 2px 0 0;
}

.revision-current {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border: 1px solid var(--line-soft);
  background: var(--infobox-subtitle-bg);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.comparison-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.comparison-meta > div {
  border: 1px solid var(--line-soft);
  background: var(--surface-alt);
  padding: 10px 12px;
}

.comparison-meta h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.diff-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.diff-table th,
.diff-table td {
  padding: 6px;
  border: 1px solid var(--line-soft);
  vertical-align: top;
}

.diff-table th {
  background: var(--table-head-bg);
}

.diff-line-number {
  width: 52px;
  color: var(--text-muted);
  text-align: right;
}

.diff-table pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
}

.diff-row-changed td:nth-child(2) {
  background: var(--diff-old);
}

.diff-row-changed td:nth-child(3) {
  background: var(--diff-new);
}

@media (max-width: 760px) {
  .revision-summary,
  .comparison-meta {
    grid-template-columns: 1fr;
  }

  .revision-summary div {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .revision-summary div:last-child {
    border-bottom: 0;
  }
}

/* alpha 5 */
.article-aliases {
  margin-top: 18px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 12px;
}

.article-aliases p {
  margin: 2px 0;
}

.resolved-notice {
  margin: 0 0 14px;
}

.page-index-table td:first-child {
  min-width: 180px;
}

.search-result mark {
  padding: 0 .12em;
  background: var(--mark-bg);
  color: inherit;
}


.theme-setting {
  display: grid;
  gap: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.theme-setting select {
  width: 100%;
  min-height: 30px;
  padding: 4px 6px;
  border: 1px solid var(--line-soft);
  background: var(--input-bg);
  color: var(--input-text);
}

.theme-setting select:focus,
.editor-panel input:focus,
.editor-panel textarea:focus,
.search-box input:focus {
  outline: 2px solid var(--tab-border);
  outline-offset: 1px;
}

.editor-panel label {
  display: grid;
  gap: 4px;
  color: var(--text);
}

.editor-panel input,
.editor-panel textarea {
  width: 100%;
  max-width: 860px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--input-text);
}

.editor-panel input::placeholder,
.editor-panel textarea::placeholder,
.search-box input::placeholder {
  color: var(--input-placeholder);
  opacity: 1;
}

.editor-panel textarea {
  max-width: 100%;
}

.search-box input {
  background: var(--input-bg);
  color: var(--input-text);
}

.search-box button,
.secondary-button,
.button-link {
  background: var(--button-bg);
  color: var(--button-text);
}

.primary-button,
.button-link.is-primary {
  border-color: var(--primary-border);
  background: var(--primary-bg);
  color: var(--primary-text);
}

html[data-theme="dark"] img,
html[data-theme="oled"] img {
  color-scheme: normal;
}

html[data-theme="dark"] .brand-globe,
html[data-theme="dark"] .mobile-brand-icon,
html[data-theme="oled"] .brand-globe,
html[data-theme="oled"] .mobile-brand-icon {
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, .16));
}

.mobile-settings-row {
  display: none;
}

.mobile-theme-setting {
  max-width: 220px;
}

@media (max-width: 980px) {
  .mobile-settings-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 8px;
  }

  .mobile-settings-row .theme-setting {
    width: min(220px, 100%);
  }
}

/* alpha 6 */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: -4px 0 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.breadcrumbs span:last-child {
  color: var(--text-muted);
}

.article-toc {
  width: min(100%, 360px);
  margin: 12px 0 18px;
  border: 1px solid var(--line-soft);
  background: var(--surface-alt);
  font-size: 13px;
}

.article-toc h2 {
  margin: 0;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--table-head-bg);
  color: var(--heading-text);
  font-size: 14px;
}

.article-toc ol {
  margin: 0;
  padding: 8px 10px 10px 28px;
}

.article-toc li {
  margin: 2px 0;
}

.article-toc .toc-level-3 {
  margin-left: 16px;
}

.article-toc .toc-level-4 {
  margin-left: 32px;
}

.section-anchor {
  float: left;
  margin-left: -18px;
  padding-right: 4px;
  opacity: 0;
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 13px;
  text-decoration: none;
}

.article-body h2:hover .section-anchor,
.article-body h3:hover .section-anchor,
.article-body h4:hover .section-anchor,
.section-anchor:focus {
  opacity: 1;
}

.template-box {
  margin: 12px 0;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--line);
  background: var(--surface-alt);
  color: var(--text-muted);
}

.template-main,
.template-seealso {
  border-left-color: var(--primary-border);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.category-card {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  background: var(--surface-alt);
  text-decoration: none;
}

.category-card:hover,
.category-card:focus {
  background: var(--surface-bg);
  text-decoration: none;
}

.category-card strong {
  color: var(--link);
}

.category-card span {
  color: var(--text-muted);
  font-size: 12px;
}

@media (max-width: 760px) {
  .article-toc {
    width: 100%;
  }

  .section-anchor {
    float: none;
    margin-left: 0;
    opacity: .55;
  }
}

.upload-panel {
  display: grid;
  gap: 10px;
  max-width: 860px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  background: var(--surface-alt);
}

.upload-panel h2 {
  margin: 0;
  color: var(--heading-text);
  font-size: 18px;
  font-weight: 400;
}

.upload-panel p {
  margin: 0;
  color: var(--text-muted);
}

.upload-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.upload-note {
  min-height: 22px;
  margin: 0;
  color: var(--text-muted);
}

.file-preview {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 12px 0 18px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  background: var(--surface-alt);
}

.file-preview img {
  max-width: min(100%, 780px);
  max-height: 70vh;
  border: 1px solid var(--line-soft);
  background: var(--surface-bg);
  object-fit: contain;
}

.file-preview figcaption {
  max-width: 760px;
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
}

.file-meta-table th {
  width: 160px;
}

.file-meta-table code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.file-usage-box {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  background: var(--surface-alt);
}

.file-usage-box h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
}

.file-usage-box p {
  margin: 0;
}

.file-usage-box pre {
  margin: 0;
  white-space: pre-wrap;
}

@media (max-width: 720px) {
  .upload-grid {
    grid-template-columns: 1fr;
  }

  .file-meta-table th {
    width: auto;
  }
}

.danger-button {
  border: 1px solid #a33a3a;
  padding: 7px 11px;
  background: #fff5f5;
  color: #8a1111;
  cursor: pointer;
}

html[data-theme="dark"] .danger-button,
html[data-theme="oled"] .danger-button {
  border-color: #9f4a4a;
  background: #2a1114;
  color: #ffb3b3;
}

.wiki-media-figure img,
.wiki-media-figure video,
.file-preview img,
.file-preview video,
.infobox-image img,
.markdown-image {
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}

.wiki-media-figure video,
.file-preview video {
  max-width: min(100%, 780px);
  max-height: 70vh;
  border: 1px solid var(--line-soft);
  background: #000;
}

html.media-viewer-open,
html.media-viewer-open body {
  overflow: hidden;
}

.media-viewer-shell {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  background: rgba(0, 0, 0, 0.92);
  color: #ffffff;
}

.media-viewer-stage {
  position: absolute;
  inset: 0;
  cursor: zoom-out;
}

.media-viewer-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 100vh;
}

.media-viewer-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  color: #d8dee9;
  font: 16px/1.2 var(--sans);
}

.media-viewer-icon-button {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  width: 42px;
  height: 42px;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.media-viewer-body {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 0 52px 18px;
  cursor: zoom-out;
}

.media-viewer-body img,
.media-viewer-body video {
  max-width: 100%;
  max-height: calc(100vh - 170px);
  object-fit: contain;
  background: #000000;
  cursor: default;
  user-select: none;
}

.media-viewer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.78);
  font: 16px/1.45 var(--sans);
}

.media-viewer-caption {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.media-viewer-caption strong,
.media-viewer-caption span {
  overflow-wrap: anywhere;
}

.media-viewer-caption span:empty {
  display: none;
}

.media-viewer-details {
  flex: none;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .media-viewer-body {
    padding: 0 12px 12px;
  }

  .media-viewer-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .media-viewer-details {
    text-align: center;
  }
}

.media-viewer-shell[hidden] {
  display: none !important;
}

.media-viewer-shell.is-open {
  display: grid !important;
}

.wiki-thumb {
  display: block;
  width: min(var(--thumb-width, 260px), 45%);
  margin: 4px 0 14px 18px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.wiki-thumb-right {
  float: right;
  clear: right;
}

.wiki-thumb-left {
  float: left;
  clear: left;
  margin: 4px 18px 14px 0;
}

.wiki-thumb-center {
  float: none;
  width: min(var(--thumb-width, 260px), 100%);
  margin: 14px auto;
}

.wiki-thumb-media {
  display: grid;
  place-items: center;
  cursor: zoom-in;
}

.wiki-thumb img,
.wiki-thumb video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line-soft);
  background: var(--surface-bg);
  object-fit: contain;
}

.wiki-thumb video {
  max-height: 55vh;
  background: #000;
}

.wiki-thumb figcaption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: start;
  padding: 5px 2px 2px;
  color: var(--text-muted);
}

.wiki-thumb figcaption p {
  margin: 0;
}

.wiki-thumb-detail {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line-soft);
  background: var(--surface-bg);
  color: var(--link);
  text-decoration: none;
  line-height: 1;
}

@media (max-width: 720px) {
  .wiki-thumb,
  .wiki-thumb-left,
  .wiki-thumb-right,
  .wiki-thumb-center {
    float: none;
    width: 100%;
    max-width: 360px;
    margin: 14px auto;
  }
}

.editor-content-label,
.editor-content-field {
  display: grid;
  gap: 6px;
}


.editor-panel .editor-content-textarea {
  min-height: 520px;
  height: min(64vh, 760px);
  max-width: 100%;
  font: 14px/1.55 ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
}

.editor-content-field > label {
  color: var(--text);
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line-soft);
  background: var(--surface-alt);
}

.editor-toolbar button {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 30px;
  border: 1px solid var(--line-soft);
  background: var(--surface-bg);
  color: var(--text-main);
  font: 13px/1 var(--sans);
  cursor: pointer;
}

.editor-toolbar button:hover,
.editor-toolbar button:focus-visible {
  border-color: var(--link);
  color: var(--link);
}

.upload-grid-wide {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(150px, .7fr) minmax(110px, .45fr);
}

.wiki-media-figure,
.wiki-media-figure img,
.wiki-media-figure video,
.wiki-thumb-media,
.wiki-thumb-media img,
.wiki-thumb-media video,
.wiki-gallery-media,
.wiki-gallery-media img,
.wiki-gallery-media video,
.file-preview img,
.file-preview video,
.markdown-image,
.infobox-image img {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  touch-action: manipulation;
}

[data-media-viewer] {
  cursor: zoom-in;
}

.wiki-gallery {
  clear: both;
  margin: 16px 0;
  padding: 8px;
  border: 1px solid var(--line-soft);
  background: var(--surface-alt);
}

.wiki-gallery h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 400;
  color: var(--heading-text);
}

.wiki-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.wiki-gallery-item {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line-soft);
  background: var(--surface-bg);
  font-size: 12px;
  color: var(--text-muted);
}

.wiki-gallery-media {
  display: grid;
  place-items: center;
  min-height: 108px;
  cursor: zoom-in;
}

.wiki-gallery-media img,
.wiki-gallery-media video {
  display: block;
  max-width: 100%;
  max-height: 160px;
  object-fit: contain;
  background: var(--surface-bg);
}

.wiki-gallery-item figcaption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  align-items: start;
  overflow-wrap: anywhere;
}

.wiki-gallery-item figcaption p {
  margin: 0;
}

.wiki-gallery-detail {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line-soft);
  background: var(--surface-alt);
  color: var(--link);
  text-decoration: none;
  line-height: 1;
}

@media (max-width: 900px) {
  .upload-grid-wide {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .upload-grid-wide {
    grid-template-columns: 1fr;
  }

  .editor-toolbar {
    position: sticky;
    top: 0;
    z-index: 3;
  }
}

.wiki-media-figure [data-media-viewer],
.wiki-thumb [data-media-viewer],
.wiki-gallery [data-media-viewer],
.file-preview [data-media-viewer] {
  pointer-events: auto;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
  padding: 10px;
  border: 1px solid var(--line-soft);
  background: var(--surface-alt);
}

.admin-section {
  margin: 24px 0;
}

.admin-table td,
.admin-table th {
  vertical-align: top;
}

.admin-actions-cell {
  min-width: 260px;
}

.compact-button {
  display: inline-block;
  margin: 2px 3px 2px 0;
  padding: 5px 8px;
  font-size: 0.92rem;
}

.admin-import-form textarea {
  width: 100%;
  min-height: 220px;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.muted-text {
  opacity: 0.7;
}

.admin-nav .is-active {
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid currentColor;
}

.admin-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.admin-card {
  display: block;
  padding: 14px;
  border: 1px solid var(--line-soft);
  background: var(--surface-alt);
  text-decoration: none;
}

.admin-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
}

.admin-card span {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 760px) {
  .editor-panel .editor-content-textarea {
    min-height: 360px;
    height: 56vh;
  }
}

.media-panel {
  gap: 12px;
}

.media-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--line-soft);
}

.media-tabs button {
  margin-bottom: -1px;
  padding: 7px 12px;
  border: 1px solid var(--line-soft);
  border-bottom-color: transparent;
  background: var(--surface-bg);
  color: var(--text-main);
  cursor: pointer;
}

.media-tabs button.is-active {
  background: var(--surface-alt);
  color: var(--link);
  border-top-color: var(--link);
}

.media-tab-panel {
  display: grid;
  gap: 12px;
}

.media-library-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, .55fr) minmax(130px, .45fr) minmax(110px, .35fr) auto;
  gap: 10px;
  align-items: end;
}

.media-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.media-library-card {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  background: var(--surface-bg);
}

.media-library-preview {
  display: grid;
  place-items: center;
  min-height: 118px;
  border: 1px solid var(--line-faint);
  background: var(--surface-alt);
  cursor: pointer;
}

.media-library-preview img {
  max-width: 100%;
  max-height: 150px;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.media-library-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.media-library-meta strong {
  overflow: hidden;
  color: var(--text-main);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-library-meta code {
  overflow-wrap: anywhere;
  white-space: normal;
}

.editor-toolbar code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

@media (max-width: 860px) {
  .media-library-controls,
  .upload-grid-wide {
    grid-template-columns: 1fr;
  }
}

.admin-inline-form,
.admin-ip-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, .45fr) minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 12px 0 16px;
}

.admin-inline-form {
  grid-template-columns: minmax(260px, 1fr) auto;
}

.compact-table {
  max-width: 520px;
}

@media (max-width: 800px) {
  .admin-inline-form,
  .admin-ip-form {
    grid-template-columns: 1fr;
  }
}

/* alpha 8.5 */
.admin-table-controls,
.admin-table-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.admin-table-controls label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-table-controls select {
  min-width: 72px;
}

.admin-sortable-heading {
  cursor: pointer;
  user-select: none;
}

.admin-sortable-heading::after {
  content: '↕';
  display: inline-block;
  margin-left: 6px;
  color: var(--text-muted);
  font-size: 11px;
}

.admin-sortable-heading[data-sort-direction='asc']::after {
  content: '↑';
}

.admin-sortable-heading[data-sort-direction='desc']::after {
  content: '↓';
}

.admin-table-pager [disabled] {
  opacity: 0.45;
  cursor: default;
}

.admin-table details pre {
  max-width: min(860px, 70vw);
}

.theme-setting + .theme-setting {
  margin-top: 8px;
}

.mobile-settings-row .theme-setting + .theme-setting {
  margin-top: 0;
}

.core-version {
  color: var(--muted-text);
  font-size: 0.92em;
  white-space: nowrap;
}

.compact-control {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.86rem;
}

.compact-control select {
  max-width: 8.5rem;
  padding: 0.2rem 0.35rem;
}

.admin-actions-cell .compact-control {
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

/* beta 1 */
html[data-text-size="small"] {
  --body-font-size: 13px;
  --article-font-size: 14px;
  --article-line-height: 1.62;
}

html[data-text-size="normal"] {
  --body-font-size: 14px;
  --article-font-size: 15px;
  --article-line-height: 1.68;
}

html[data-text-size="large"] {
  --body-font-size: 16px;
  --article-font-size: 17px;
  --article-line-height: 1.75;
}

body {
  font-size: var(--body-font-size, 14px);
}

.article-body,
.wiki-article .article-subtitle,
.editor-preview .article-body {
  font-size: var(--article-font-size, 15px);
  line-height: var(--article-line-height, 1.68);
}

textarea,
input,
select,
button {
  font: inherit;
}

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

.editor-content-textarea {
  min-height: 560px;
}

.admin-section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 10px;
}

@media (max-width: 980px) {
  body {
    background: var(--page-bg);
  }

  .page-shell {
    display: block;
  }

  .wiki-sidebar {
    display: none;
  }

  .wiki-main {
    width: 100%;
    min-width: 0;
  }

  .top-bar {
    position: static;
    padding: 10px 12px 0;
  }

  .mobile-brand-row,
  .mobile-settings-row {
    display: flex;
  }

  .mobile-settings-row {
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
  }

  .tabs-row {
    display: grid;
    gap: 8px;
  }

  .namespace-tabs,
  .view-tabs {
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
  }

  .search-box {
    width: 100%;
  }

  .content-frame {
    width: 100%;
    min-width: 0;
    padding: 12px;
  }

  .wiki-article,
  .admin-page,
  .special-page,
  .history-page,
  .not-found-page {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .article-grid {
    display: block !important;
  }

  .infobox,
  .wiki-thumb {
    float: none !important;
    width: min(100%, var(--thumb-width, 320px));
    margin: 12px auto;
  }

  .history-table,
  .admin-table,
  .diff-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .editor-panel,
  .admin-section,
  .media-panel {
    max-width: 100%;
  }

  .editor-toolbar {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .editor-toolbar button {
    flex: 0 0 auto;
  }
}

@media (max-width: 560px) {
  .content-frame {
    padding: 8px;
  }

  .article-header h1 {
    font-size: clamp(1.6rem, 8vw, 2.1rem);
  }

  .personal-links,
  .view-tabs,
  .namespace-tabs {
    font-size: 0.94rem;
  }

  .editor-actions,
  .admin-actions-cell {
    display: grid;
    grid-template-columns: 1fr;
  }

  .editor-actions > *,
  .admin-actions-cell > * {
    width: 100%;
  }

  .media-library-grid {
    grid-template-columns: 1fr;
  }

  .editor-content-textarea {
    min-height: 68vh;
  }
}

.template-gallery-panel {
  margin: 1rem 0;
}

.template-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
  margin-top: .75rem;
}

.template-gallery-card {
  border: 1px solid var(--border-color, #a2a9b1);
  border-radius: .45rem;
  background: var(--surface-color, #fff);
  padding: .75rem;
  display: grid;
  gap: .55rem;
}

.template-gallery-card span,
.template-gallery-card small {
  display: block;
  color: var(--muted-text, #54595d);
}

.template-gallery-card pre,
.template-admin-table pre {
  max-height: 9rem;
  overflow: auto;
  white-space: pre-wrap;
  margin: 0;
}

.template-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .75rem;
}

.template-builder-form textarea {
  min-height: 16rem;
  font-family: ui-monospace, sfmono-regular, consolas, monospace;
}

.wiki-background-box {
  background: var(--wiki-box-bg, rgba(248, 249, 250, .88));
  background-image: var(--wiki-box-image, none), var(--wiki-box-bg, none);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border-color, #a2a9b1);
  border-radius: .6rem;
  padding: 1rem;
  margin: 1rem 0;
  overflow: hidden;
}

.wiki-background-box h2 {
  margin-top: 0;
}
