/* Ryonpedia: a classic-encyclopedia skin. Sidebar on the left, tabs on top, white page with a blue edge. */

:root {
  --rp-bg: #f6f6f6;
  --rp-page: #ffffff;
  --rp-text: #202122;
  --rp-muted: #54595d;
  --rp-link: #0645ad;
  --rp-visited: #0b0080;
  --rp-new: #d33;
  --rp-edge: #a7d7f9;
  --rp-border: #a2a9b1;
  --rp-rule: #c8ccd1;
  --rp-box: #f8f9fa;
  --rp-tab: linear-gradient(to top, #77c1f6 0, #e8f2f8 1px, #fff 100%);
  --rp-tab-sel: #fff;
  --rp-mainhead-a: #cef2e0; --rp-mainbox-a: #f5fffa; --rp-mainline-a: #a3bfb1;
  --rp-mainhead-b: #cedff2; --rp-mainbox-b: #f5faff; --rp-mainline-b: #a3b0bf;
  --rp-welcome: #f8f9fa;
  --rp-serif: "Linux Libertine", "Georgia", "Times", "Times New Roman", serif;
  --rp-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Lato", "Helvetica Neue", "Arial", sans-serif;

  /* rad lib chip colors */
  --ry: #c2410c; --ry-bg: #fde2d2;
  --ryon: #5b3cc4; --ryon-bg: #e6defb;
  --laine: #b5176b; --laine-bg: #fbdcea;
  --ryond: #0d7468; --ryond-bg: #d3f0eb;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --rp-bg: #101418;
    --rp-page: #16191d;
    --rp-text: #eaecf0;
    --rp-muted: #a2a9b1;
    --rp-link: #88a3e8;
    --rp-visited: #a799cd;
    --rp-new: #fd7865;
    --rp-edge: #3e5b77;
    --rp-border: #54595d;
    --rp-rule: #3a3f45;
    --rp-box: #1f2328;
    --rp-tab: linear-gradient(to top, #3e5b77 0, #1d2733 1px, #16191d 100%);
    --rp-tab-sel: #16191d;
    --rp-mainhead-a: #1c3a2b; --rp-mainbox-a: #141f1a; --rp-mainline-a: #2f5443;
    --rp-mainhead-b: #1c2b3a; --rp-mainbox-b: #141a20; --rp-mainline-b: #2f4254;
    --rp-welcome: #1b1f24;
    --ry: #ff9a66; --ry-bg: #45230f;
    --ryon: #b3a0ff; --ryon-bg: #2c2350;
    --laine: #ff8cc6; --laine-bg: #4a1531;
    --ryond: #6fdccb; --ryond-bg: #123c37;
    color-scheme: dark;
  }
  .rp-logo img { filter: brightness(0.92); }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body.rp {
  margin: 0;
  background: var(--rp-bg);
  color: var(--rp-text);
  font-family: var(--rp-sans);
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--rp-link); text-decoration: none; }
a:visited { color: var(--rp-visited); }
a:hover { text-decoration: underline; }
a.new, a.new:visited { color: var(--rp-new); }
a.external::after { content: "↗"; font-size: 0.7em; margin-left: 0.15em; vertical-align: super; color: var(--rp-muted); }

.rp-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rp-skip { position: absolute; left: -999px; top: 0; z-index: 10; padding: 0.5rem 1rem; background: var(--rp-page); }
.rp-skip:focus { left: 0.5rem; }

/* ---- frame ---- */

.rp-page {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  grid-template-areas:
    "logo top"
    "panel content"
    "panel footer";
  /* the logo is taller than the top bar and hangs down over the sidebar, like the classic skin */
  grid-template-rows: 5.25rem 1fr auto;
  max-width: 100rem;
  min-height: 100vh;
}
.rp-header { display: contents; }

.rp-logo {
  grid-area: logo;
  align-self: start;
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  padding: 0.75rem 0.5rem 0.5rem;
  color: var(--rp-text) !important;
  text-decoration: none !important;
  text-align: center;
}
.rp-logo img { width: 84px; height: 84px; }
.rp-wordmark { font-family: var(--rp-serif); font-size: 1.35rem; letter-spacing: 0.04em; font-variant: small-caps; line-height: 1.1; margin-top: 0.3rem; }
.rp-motto { font-family: var(--rp-serif); font-size: 0.75rem; color: var(--rp-muted); }

.rp-menu-btn { display: none; }

.rp-search {
  grid-area: top;
  justify-self: end;
  align-self: end;
  position: relative;
  display: flex;
  margin: 0 1rem 0.45rem 0;
  width: min(22rem, 45%);
  z-index: 3;
}
.rp-search input {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--rp-border);
  border-radius: 2px 0 0 2px;
  background: var(--rp-page);
  color: var(--rp-text);
  font: inherit;
  font-size: 0.875rem;
}
.rp-search input:focus { outline: 2px solid #36c; outline-offset: -1px; border-color: #36c; }
.rp-search button {
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--rp-border);
  border-left: 0;
  border-radius: 0 2px 2px 0;
  background: var(--rp-box);
  color: var(--rp-text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.rp-search button:hover { background: var(--rp-page); }
.rp-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--rp-page);
  border: 1px solid var(--rp-border);
  border-top: 0;
  box-shadow: 0 4px 10px rgb(0 0 0 / 0.15);
}
.rp-suggest a { display: block; padding: 0.4rem 0.6rem; color: var(--rp-text); text-decoration: none; line-height: 1.3; }
.rp-suggest a b { display: block; font-weight: 600; }
.rp-suggest a span { display: block; font-size: 0.8rem; color: var(--rp-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-suggest a[aria-selected="true"], .rp-suggest a:hover { background: var(--rp-box); }
.rp-suggest .rp-suggest-all a { font-size: 0.8rem; color: var(--rp-link); border-top: 1px solid var(--rp-rule); }

.rp-personal {
  grid-area: top;
  justify-self: end;
  align-self: start;
  margin: 0.4rem 1rem 0 0;
  font-size: 0.75rem;
  color: var(--rp-muted);
}
.rp-personal > * { margin-left: 0.75rem; }

.rp-panel { grid-area: panel; padding: 5.25rem 0.5rem 2rem 0.75rem; font-size: 0.8rem; }
.rp-portal { margin: 0 0 1rem; }
.rp-portal h3 {
  margin: 0 0 0.3rem 0.35rem;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid var(--rp-rule);
  color: var(--rp-muted);
  font-size: 0.75rem;
  font-weight: 400;
}
.rp-portal ul { margin: 0; padding: 0 0 0 0.35rem; list-style: none; }
.rp-portal li { padding: 0.15rem 0; line-height: 1.25; }

/* ---- tabs + content ---- */

.rp-content { grid-area: content; display: flex; flex-direction: column; min-width: 0; }

.rp-tabs { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; padding-left: 1px; }
.rp-tabs ul { display: flex; margin: 0; padding: 0; list-style: none; }
.rp-tabs li { background: var(--rp-tab); margin-left: 1px; }
.rp-tabs a { display: block; padding: 1.15rem 0.6rem 0.3rem; font-size: 0.8rem; line-height: 1; }
.rp-tabs li.selected { background: var(--rp-tab-sel); }
.rp-tabs li.selected a { color: var(--rp-text); }
.rp-tabs-right { margin-right: 0.5rem !important; }

.rp-article {
  flex: 1;
  padding: 1.25rem 1.5rem 1.5rem;
  background: var(--rp-page);
  border: 1px solid var(--rp-edge);
  border-right: 0;
}

.rp-title {
  margin: 0 0 0.25rem;
  padding-bottom: 0.1rem;
  border-bottom: 1px solid var(--rp-border);
  font-family: var(--rp-serif);
  font-weight: 400;
  font-size: 1.8rem;
  line-height: 1.3;
}
.rp-tagline { margin: 0.1rem 0 0.75rem; color: var(--rp-muted); font-size: 0.85rem; }

.rp-body-content { font-size: 0.9375rem; line-height: 1.6; }
.rp-body-content::after { content: ""; display: block; clear: both; }
.rp-body-content p { margin: 0.5rem 0 0.75rem; }
.rp-body-content h2 {
  clear: both;
  margin: 1.2rem 0 0.5rem;
  padding-bottom: 0.1rem;
  border-bottom: 1px solid var(--rp-border);
  font-family: var(--rp-serif);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.3;
}
.rp-body-content h3 { margin: 1rem 0 0.3rem; font-size: 1.1rem; font-weight: 700; line-height: 1.4; }
.rp-body-content h4 { margin: 0.8rem 0 0.2rem; font-size: 1rem; }
.rp-body-content h2 + h3 { margin-top: 0.5rem; }
.rp-body-content ul, .rp-body-content ol { margin: 0.3rem 0 0.75rem 1.6em; padding: 0; }
.rp-body-content li { margin-bottom: 0.15rem; }
.rp-body-content blockquote { margin: 1rem 2rem; padding: 0 0 0 1rem; border-left: 3px solid var(--rp-rule); font-family: var(--rp-serif); font-size: 1.05rem; }
.rp-body-content code { padding: 0.05em 0.3em; border: 1px solid var(--rp-rule); border-radius: 2px; background: var(--rp-box); font-size: 0.9em; }
.rp-body-content pre { padding: 0.8rem 1rem; border: 1px solid var(--rp-rule); background: var(--rp-box); overflow-x: auto; line-height: 1.4; white-space: pre-wrap; }
.rp-body-content pre code { padding: 0; border: 0; background: none; }
.rp-body-content hr { border: 0; border-top: 1px solid var(--rp-border); }
.rp-body-content img { max-width: 100%; }
.rp-body-content dl dt { font-weight: 700; margin-top: 0.4rem; }
.rp-body-content dl dd { margin: 0 0 0.3rem 1.6em; }

.hatnote, .rp-body-content .hatnote { margin: 0 0 0.6rem; padding-left: 1.6em; font-style: italic; font-size: 0.9rem; color: var(--rp-text); }
.rp-cn { white-space: nowrap; font-size: 0.75em; }
.rp-cn a { color: var(--rp-link); }

/* ---- infobox ---- */

.infobox {
  float: right;
  clear: right;
  width: 22em;
  margin: 0.2rem 0 1rem 1.2rem;
  padding: 0.2em;
  border: 1px solid var(--rp-border);
  border-spacing: 0.2rem;
  background: var(--rp-box);
  color: var(--rp-text);
  font-size: 0.85rem;
  line-height: 1.5;
}
.infobox .infobox-title { padding: 0.2em; font-size: 1.25em; font-weight: 700; text-align: center; }
.infobox th, .infobox td { padding: 0.2em 0.35em; vertical-align: top; text-align: left; }
.infobox th[scope="row"] { width: 40%; }
.infobox-header { text-align: center !important; background: var(--rp-mainhead-b); }
.infobox-image { text-align: center !important; padding: 0.4em 0.2em !important; }
.infobox-image img { max-width: 220px; height: auto; }
.infobox-caption { padding-top: 0.25rem; font-size: 0.9em; line-height: 1.4; }
.infobox-prism { border-image: linear-gradient(115deg, #ff3f8e, #ffb347, #fff36b, #5dff9e, #41e2ff, #9a6bff) 1; }
.infobox-chip { font-size: 2.6rem !important; padding: 0.15em 0.6em !important; margin: 0.5rem 0; }
canvas.rp-card { display: block; margin: 0 auto; width: 220px; max-width: 100%; height: auto; aspect-ratio: 2 / 3; border-radius: 8px; background: #150f30; }

.chip { display: inline-block; padding: 0.05em 0.5em; border-radius: 999px; font-family: Georgia, serif; font-weight: 600; font-size: 0.95em; line-height: 1.4; }
.chip-ry { background: var(--ry-bg); color: var(--ry); }
.chip-ryon { background: var(--ryon-bg); color: var(--ryon); }
.chip-laine { background: var(--laine-bg); color: var(--laine); }
.chip-ryond { background: var(--ryond-bg); color: var(--ryond); }

/* ---- thumbnails ---- */

.thumb { clear: right; float: right; margin: 0.4rem 0 1rem 1.2rem; padding: 3px; border: 1px solid var(--rp-rule); background: var(--rp-box); font-size: 0.8rem; line-height: 1.4; }
.thumb.tleft { float: left; clear: left; margin: 0.4rem 1.2rem 1rem 0; }
.thumb canvas.rp-card { width: 160px; }
.thumb figcaption { padding: 0.3rem 0.2rem 0.1rem; max-width: 160px; }
.gallery { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0.5rem 0 1rem; padding: 0; list-style: none; }
.gallery li { margin: 0; padding: 3px; border: 1px solid var(--rp-rule); background: var(--rp-box); font-size: 0.8rem; text-align: center; width: 132px; line-height: 1.3; }
.gallery canvas.rp-card { width: 124px; }
.gallery span { display: block; padding: 0.3rem 0.1rem 0.15rem; }

/* ---- table of contents ---- */

.toc {
  display: table;
  margin: 0.5rem 0 1rem;
  padding: 0.4rem 0.9rem 0.6rem;
  border: 1px solid var(--rp-border);
  background: var(--rp-box);
  font-size: 0.85rem;
}
.toc-title { display: flex; gap: 0.6rem; align-items: baseline; justify-content: center; }
.toc-title h2 { margin: 0; padding: 0; border: 0; font-family: var(--rp-sans); font-size: 0.95rem; font-weight: 700; }
.toc-toggle { padding: 0; border: 0; background: none; color: var(--rp-link); font: inherit; font-size: 0.85rem; cursor: pointer; }
.toc ol { margin: 0.3rem 0 0 !important; padding: 0; list-style: none; counter-reset: toc; }
.toc ol ol { margin: 0 0 0 1.6em !important; }
.toc li { margin: 0.05rem 0 !important; counter-increment: toc; }
.toc li > a::before { content: counters(toc, ".") " "; color: var(--rp-text); padding-right: 0.4em; }
.toc.collapsed ol { display: none; }

/* ---- tables ---- */

.wikitable { margin: 0.75rem 0 1rem; border: 1px solid var(--rp-border); border-collapse: collapse; background: var(--rp-box); color: var(--rp-text); font-size: 0.875rem; }
.wikitable th, .wikitable td { padding: 0.25em 0.5em; border: 1px solid var(--rp-border); vertical-align: middle; }
.wikitable th { background: var(--rp-rule); text-align: center; }
@media (prefers-color-scheme: dark) { .wikitable th { background: #27292d; } }
.wikitable td.num { text-align: right; font-variant-numeric: tabular-nums; }
.wikitable canvas.rp-card { width: 52px; border-radius: 4px; }
.table-scroll { overflow-x: auto; max-width: 100%; }
.sortable th.sortable-th { cursor: pointer; padding-right: 1.3em; position: relative; white-space: nowrap; }
.sortable th.sortable-th::after { content: "⇅"; position: absolute; right: 0.3em; color: var(--rp-muted); font-size: 0.8em; }
.sortable th[aria-sort="ascending"]::after { content: "▲"; }
.sortable th[aria-sort="descending"]::after { content: "▼"; }
.rar { font-weight: 700; padding: 0 0.35em; border-radius: 3px; color: #fff; white-space: nowrap; }
.rar-N { background: #6d7489; } .rar-R { background: #3a7fd5; } .rar-SR { background: #20a072; } .rar-SSR { background: #8b4fd8; }
.rar-UR { background: #d4512f; } .rar-LR { background: #b47f00; }
.rar-RR { background: linear-gradient(115deg, #ff3f8e, #ffb347, #5dff9e, #41e2ff, #9a6bff); text-shadow: 0 1px 1px rgb(0 0 0 / 0.6); }

/* ---- notices ---- */

.rp-stub, .ambox {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  clear: both;
  margin: 1.25rem 0 0.75rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--rp-border);
  border-left: 10px solid #36c;
  background: var(--rp-box);
  font-size: 0.85rem;
}
.ambox { border-left-color: #fc3; }
.rp-stub p, .ambox p { margin: 0 !important; font-style: italic; }
.rp-stub-icon, .ambox-icon { font-size: 1.6rem; line-height: 1; font-style: normal; }

/* ---- references (kramdown footnotes) ---- */

.footnotes { font-size: 0.85rem; }
.footnotes ol { margin-left: 2em; }
.footnotes .reversefootnote { margin-left: 0.3em; }
sup[role="doc-noteref"], sup.reference { line-height: 1; font-size: 0.75em; }
a.footnote::before { content: "["; }
a.footnote::after { content: "]"; }

/* ---- categories ---- */

.rp-catlinks { clear: both; margin-top: 1.5rem; padding: 0.4rem 0.6rem; border: 1px solid var(--rp-border); background: var(--rp-box); font-size: 0.85rem; }
.rp-catlinks ul { display: inline; margin: 0; padding: 0; list-style: none; }
.rp-catlinks li { display: inline; padding: 0 0.5em; border-left: 1px solid var(--rp-rule); }
.rp-catlinks li:first-child { padding-left: 0.25em; border-left: 0; }

/* ---- footer ---- */

.rp-footer { grid-area: footer; padding: 1rem 1.5rem 2rem; font-size: 0.75rem; color: var(--rp-text); }
.rp-footer p { margin: 0 0 0.5rem; }
.rp-footer ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0.5rem 0; padding: 0; list-style: none; }
.rp-powered span { display: inline-block; padding: 0.25rem 0.6rem; border: 1px solid var(--rp-border); border-radius: 3px; background: var(--rp-box); font-weight: 700; font-size: 0.7rem; letter-spacing: 0.04em; }

/* ---- main page ---- */

.mp-welcome { margin: 0 0 1rem; padding: 0.8rem 1rem; border: 1px solid var(--rp-rule); background: var(--rp-welcome); text-align: center; }
.mp-welcome h2 { margin: 0; padding: 0; border: 0; font-family: var(--rp-serif); font-size: 1.7rem; font-weight: 400; }
.mp-welcome p { margin: 0.2rem 0 0 !important; font-size: 0.9rem; }
.mp-cols { display: grid; grid-template-columns: minmax(0, 55fr) minmax(0, 45fr); gap: 1rem; }
.mp-box { margin-bottom: 1rem; border: 1px solid var(--mp-line); background: var(--mp-bg); }
.mp-box h2 { margin: 0; padding: 0.2rem 0.6rem; border: 1px solid var(--mp-line); border-width: 0 0 1px; background: var(--mp-head); font-family: var(--rp-sans); font-size: 1rem; font-weight: 700; line-height: 1.5; }
.mp-box > div { padding: 0.4rem 0.75rem 0.6rem; }
.mp-box > div::after { content: ""; display: block; clear: both; }
.mp-a { --mp-line: var(--rp-mainline-a); --mp-bg: var(--rp-mainbox-a); --mp-head: var(--rp-mainhead-a); }
.mp-b { --mp-line: var(--rp-mainline-b); --mp-bg: var(--rp-mainbox-b); --mp-head: var(--rp-mainhead-b); }
.mp-box ul { margin-left: 1.2em; }
.mp-more { text-align: right; font-size: 0.85rem; margin: 0.25rem 0 0 !important; }
.mp-thumb { float: left; margin: 0.25rem 0.9rem 0.3rem 0; }
.mp-thumb canvas.rp-card { width: 110px; }
.mp-thumb.right { float: right; margin: 0.25rem 0 0.3rem 0.9rem; }
.mp-picture { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; align-items: center; }
.mp-picture canvas.rp-card { width: 170px; }
.mp-other { columns: 2 14rem; font-size: 0.9rem; }

/* ---- special pages ---- */

.allpages-cat { break-inside: avoid; margin-bottom: 1rem; }
.allpages-cat ul { columns: 2 14rem; }
.search-results { list-style: none; margin: 0.5rem 0 0 !important; }
.search-results li { margin-bottom: 1rem !important; }
.search-results a { font-size: 1.05rem; }
.search-results .snippet { margin: 0.1rem 0 0; font-size: 0.875rem; }
.search-results .meta { color: var(--rp-muted); font-size: 0.8rem; }
.search-results mark { background: none; font-weight: 700; color: inherit; }
.search-big { display: flex; max-width: 36rem; margin: 0.5rem 0 1rem; }
.search-big input { flex: 1; min-width: 0; padding: 0.45rem 0.6rem; border: 1px solid var(--rp-border); border-radius: 2px 0 0 2px; background: var(--rp-page); color: var(--rp-text); font: inherit; }
.search-big button { padding: 0.45rem 1rem; border: 0; border-radius: 0 2px 2px 0; background: #36c; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }

/* ---- small screens: the sidebar folds into a menu ---- */

@media (max-width: 760px) {
  .rp-page {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "logo" "search" "panel" "content" "footer";
    grid-template-rows: auto;
  }
  .rp-header { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--rp-rule); background: var(--rp-page); grid-area: logo; }
  .rp-logo { display: flex; align-items: center; align-self: center; gap: 0.5rem; padding: 0; text-align: left; flex: 1; min-width: 0; }
  .rp-logo img { width: 38px; height: 38px; }
  .rp-wordmark { margin: 0; font-size: 1.2rem; }
  .rp-motto { display: none; }
  .rp-menu-btn { display: block; order: 2; padding: 0.3rem 0.7rem; border: 1px solid var(--rp-border); border-radius: 2px; background: var(--rp-box); color: var(--rp-text); font: inherit; font-size: 0.85rem; cursor: pointer; }
  .rp-search { order: 3; width: 100%; margin: 0; justify-self: stretch; }
  .rp-personal { display: none; }
  .rp-panel { display: none; padding: 0.75rem 1rem; background: var(--rp-page); border-bottom: 1px solid var(--rp-rule); columns: 2 9rem; font-size: 0.9rem; }
  .rp-panel.open { display: block; }
  .rp-portal { break-inside: avoid; }
  .rp-content { margin-top: 0.5rem; }
  .rp-tabs { padding: 0 0.5rem; overflow-x: auto; }
  .rp-tabs a { padding: 0.6rem 0.6rem 0.35rem; }
  .rp-article { padding: 0.9rem 1rem 1.25rem; border-right: 1px solid var(--rp-edge); border-left: 0; border-right: 0; }
  .infobox { float: none; width: 100%; margin: 0.5rem 0 1rem; }
  .thumb, .thumb.tleft { float: none; display: table; margin: 0.5rem auto 1rem; }
  .mp-cols { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .mp-picture { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .rp-body-content blockquote { margin: 1rem 0.5rem; }
  .rp-footer { padding: 1rem; }
}

@media print {
  .rp-panel, .rp-tabs, .rp-search, .rp-personal, .rp-menu-btn, .noprint { display: none !important; }
  .rp-page { display: block; }
}
