/* MMOE styles.
   Palette lifted from the MMB forum's pycode theme so this reads as part of the same
   site: page #202225, panels #42474F, text #dcdcdc/#C1C1C7, muted #93959d, accent #BC2A4D.
   The only value not taken directly from pycode is --link; adjust it here if the forum's
   link colour differs. */

:root {
  --bg:         #202225;
  --bg-alt:     #242629;
  --panel:      #42474F;
  --panel-dark: #2b2f34;
  --panel-head: #353940;
  --border:     #333a41;
  --text:       #dcdcdc;
  --text-soft:  #c1c1c7;
  --muted:      #93959d;
  --link:       #b9c7d6;
  --link-hover: #ffffff;
  --accent:     #bc2a4d;
  --ok:         #4f8a5b;
  --warn:       #8a7a3f;
  --bad:        #8a3f3f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
h1, h2, h3, h4 { color: var(--text-soft); margin: 0 0 .5rem; line-height: 1.25; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.12rem; }
h4 { font-size: .95rem; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }

/* ---------- chrome ---------- */

.topbar {
  display: flex; align-items: center; gap: 1.5rem;
  padding: .7rem 1.2rem;
  background: var(--panel-dark);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; letter-spacing: .02em; color: var(--text-soft); }
.brand:hover { text-decoration: none; color: #fff; }
.omnisearch { margin-left: auto; display: flex; gap: .4rem; }
.omnisearch input { min-width: 18rem; }

.realmtabs {
  background: var(--panel-dark);
  border-bottom: 1px solid var(--border);
  padding: .5rem 1.2rem .6rem;
}
.realmtitle { display: flex; align-items: center; gap: .5rem; margin-bottom: .45rem; }
.realmtabs ul { display: flex; flex-wrap: wrap; gap: .2rem; list-style: none; margin: 0; padding: 0; }
.realmtabs a {
  display: block; padding: .3rem .7rem; border-radius: 3px;
  color: var(--text-soft); font-size: .93rem;
}
.realmtabs a:hover { background: var(--panel); text-decoration: none; }
.realmtabs a.active { background: var(--accent); color: #fff; }

main { max-width: 1100px; margin: 0 auto; padding: 1.2rem; }

.sitefoot {
  max-width: 1100px; margin: 2rem auto 1rem; padding: 1rem 1.2rem 0;
  border-top: 1px solid var(--border);
  color: var(--muted); font-size: .82rem;
  display: flex; gap: 1rem; justify-content: space-between; flex-wrap: wrap;
}

/* ---------- panels ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.1rem;
}
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }

.hero { padding: .5rem 0 1rem; }
.hero h1 { font-size: 1.8rem; }
.lede { color: var(--text-soft); max-width: 70ch; }
.prose p { margin: .35rem 0; color: var(--text); }

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

table.grid { width: 100%; border-collapse: collapse; margin: .4rem 0; }
table.grid th, table.grid td {
  text-align: left; padding: .38rem .55rem;
  border-bottom: 1px solid var(--panel-dark);
  vertical-align: top;
}
table.grid thead th {
  color: var(--text-soft); font-size: .82rem; text-transform: uppercase;
  letter-spacing: .04em; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--panel);
}
table.grid tbody tr:hover { background: var(--panel-head); }
table.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid.sortable tbody tr td:first-child { white-space: nowrap; }

.pager { display: flex; align-items: center; gap: .8rem; margin-top: .8rem; }
.listhead { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.listhead h2 { margin: 0; }
.filter { margin-left: auto; display: flex; gap: .4rem; }

/* ---------- forms & buttons ---------- */

input[type="search"], input[type="text"], select {
  background: var(--bg-alt); color: var(--text);
  border: 1px solid var(--border); border-radius: 3px;
  padding: .35rem .5rem; font: inherit; font-size: .92rem;
}
input:focus { outline: 1px solid var(--accent); outline-offset: 0; }
button, .button {
  display: inline-block;
  background: var(--panel-head); color: var(--text-soft);
  border: 1px solid var(--border); border-radius: 3px;
  padding: .35rem .8rem; font: inherit; font-size: .92rem; cursor: pointer;
}
button:hover, .button:hover { background: var(--accent); color: #fff; text-decoration: none; }
.button.ghost { background: transparent; }

/* ---------- bits ---------- */

.tag {
  display: inline-block; padding: .05rem .45rem; border-radius: 3px;
  background: var(--panel-dark); color: var(--text-soft);
  font-size: .78rem; letter-spacing: .02em;
}
.tag.ok   { background: var(--ok);   color: #fff; }
.tag.warn { background: var(--warn); color: #fff; }
.tag.bad  { background: var(--bad);  color: #fff; }
.tag.muted{ background: transparent; border: 1px solid var(--border); color: var(--muted); }

.statgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .5rem; margin: .6rem 0; }
.stat { background: var(--panel-dark); border-radius: 3px; padding: .5rem .6rem; }
.stat .value { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.stat .label { color: var(--muted); font-size: .8rem; }

dl.facts { display: grid; grid-template-columns: minmax(9rem, max-content) 1fr; gap: .15rem .9rem; margin: .6rem 0 0; }
dl.facts dt { color: var(--muted); font-size: .88rem; }
dl.facts dd { margin: 0; }

.refcols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 720px) { .refcols { grid-template-columns: 1fr; } }
.refgroup { margin-bottom: .6rem; }
.refgroup strong { display: block; font-size: .85rem; color: var(--muted); font-weight: 600; }
.refgroup ul { list-style: none; margin: .15rem 0 .35rem; padding: 0; }
.refgroup li { padding: .05rem 0; }

pre.textblock {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 3px;
  padding: .7rem .8rem; white-space: pre-wrap; word-break: break-word;
  max-height: 32rem; overflow: auto; margin: .3rem 0 .8rem;
}

/* ---------- character paste ---------- */

.pasteform textarea {
  width: 100%;
  background: var(--bg-alt); color: var(--text);
  border: 1px solid var(--border); border-radius: 3px;
  padding: .6rem .7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .86rem; line-height: 1.45;
  resize: vertical;
}
.pasteform textarea:focus { outline: 1px solid var(--accent); }
.pasteform .actions { display: flex; align-items: center; gap: .8rem; margin-top: .5rem; }
