/* Earthora Wiki – shares the look of store.earthora.net and tiers.earthora.net */
:root {
  --bg: #061024;
  --bg-2: #081631;
  --panel: #0b1d3d;
  --panel-2: #10284f;
  --edge: #1d4c94;
  --edge-lo: #132f5e;
  --edge-hi: #2f6fd6;
  --blue: #2f7bff;
  --blue-dk: #1b56c7;
  --sky: #6fb2ff;
  --ink: #eef4ff;
  --ink-2: #a9bfe2;
  --ink-3: #6f87b0;
  --t1: #ffc83d; --t1-dk: #a8790a;
  --t2: #cfd9ea; --t2-dk: #7d8aa1;
  --t3: #ee8c4c; --t3-dk: #9a4b1b;
  --t4: #a08cff; --t4-dk: #5a45bf;
  --t5: #7f93b8; --t5-dk: #46587a;
  --up: #4ade80;
  --down: #ff6b78;
  --r: 14px;
  --r-sm: 9px;
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Lilita One", "Montserrat", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 500 15px/1.5 var(--font); color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
/* Background: Minecraft night screenshot (Mojang, "Amplified Village Night"), toned into the navy palette */
body::before{content:""; position:fixed; inset:0; z-index:-1; pointer-events:none;
  background:linear-gradient(180deg,rgba(6,16,36,.1) 0%,rgba(6,16,36,.35) 35%,rgba(6,16,36,.85) 75%,#061024 100%),#061024 url(/bg-2400.webp) center 35%/cover no-repeat;
  filter:saturate(1.15) brightness(1.15)}
@media (max-width:900px){body::before{background-image:linear-gradient(180deg,rgba(6,16,36,.15) 0%,rgba(6,16,36,.45) 35%,rgba(6,16,36,.88) 75%,#061024 100%),url(/bg-1200.webp)}}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { image-rendering: pixelated; }
h1, h2, h3 { margin: 0; line-height: 1.12; font-weight: 900; letter-spacing: -.01em; }
.wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.num { font-family: var(--display); font-weight: 400; letter-spacing: .02em; }

/* ── header ── */
.top { position: sticky; top: 0; z-index: 30; background: rgba(6, 16, 36, .92); backdrop-filter: blur(10px); border-bottom: 2px solid var(--edge-lo); }
.top-in { display: flex; align-items: center; gap: 22px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.wm { font: 400 30px/1 var(--display); letter-spacing: .02em; transform: rotate(-2deg); display: inline-block; }
.wm span { -webkit-text-stroke: 2px #04102a; paint-order: stroke fill; }
.wm-a { color: #e9f1ff; text-shadow: 0 3px 0 #8aa6cf, 0 5px 0 #04102a; }
.wm-b { color: var(--sky); text-shadow: 0 3px 0 var(--blue-dk), 0 5px 0 #04102a; }
.brand-tag { font: 800 11px var(--font); text-transform: uppercase; letter-spacing: .12em; color: #fff; background: var(--blue); padding: 4px 8px 3px; border-radius: 6px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .22); }
.nav { display: flex; gap: 2px; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 700; font-size: 14px; transition: color .15s, background .15s; }
.nav a:hover { color: #fff; }
.nav a.on { color: #fff; background: var(--panel-2); box-shadow: inset 0 -2px 0 var(--blue); }
.search { position: relative; margin-left: auto; display: flex; align-items: center; gap: 8px; width: 250px; padding: 0 10px; border-radius: var(--r-sm); background: var(--bg-2); border: 2px solid var(--edge-lo); color: var(--ink-3); transition: border-color .15s; }
.search:focus-within { border-color: var(--sky); }
.search input { flex: 1; min-width: 0; height: 38px; border: 0; outline: 0; background: none; color: var(--ink); font: 600 14px var(--font); }
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { font: 700 11px var(--font); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--edge); color: var(--ink-3); }
.suggest { position: absolute; top: calc(100% + 8px); left: -2px; right: -2px; padding: 6px; border-radius: 12px; background: var(--panel); border: 2px solid var(--edge); box-shadow: 0 20px 40px rgba(0, 0, 0, .45); }
.suggest a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--ink); font-weight: 700; font-size: 14px; }
.suggest a.on, .suggest a:hover { background: var(--panel-2); }
.suggest .empty { padding: 10px; color: var(--ink-2); font-size: 13px; }
.menu-btn { display: none; padding: 6px; border: 0; background: none; }

/* ── generic ── */
main { flex: 1; padding-top: 30px; padding-bottom: 64px; }
.panel { background: var(--panel); border: 2px solid var(--edge-lo); border-radius: var(--r); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; white-space: nowrap;
  border: 0; border-radius: var(--r-sm); background: var(--panel-2); color: #cfe1ff; font: 800 14px var(--font);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .2); transition: background .15s, transform .15s;
}
.btn:hover { background: #16346a; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dk); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2); }
.btn svg { width: 18px; height: 18px; }
.h-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; font-size: 20px; font-weight: 900; text-transform: uppercase; letter-spacing: .01em; }
.h-title small { font-size: 13px; font-weight: 700; color: var(--ink-3); text-transform: none; letter-spacing: 0; }
.loading { display: grid; place-items: center; min-height: 40vh; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--edge-lo); border-top-color: var(--sky); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── banner (same as the store) ── */
.banner {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) auto; align-items: center; gap: 28px;
  padding: 34px 38px; margin-bottom: 30px; border-radius: var(--r); overflow: hidden;
  background: linear-gradient(180deg, #3d8bff, #1e5fd8 75%, #174bb0);
  border-bottom: 6px solid #133f97;
  box-shadow: 0 20px 40px rgba(20, 70, 170, .3);
}
.banner > * { position: relative; }
.banner h1 { margin-bottom: 10px; font-size: 34px; text-transform: uppercase; }
.banner p { max-width: 520px; margin: 0 0 20px; color: #e3eeff; font-size: 14px; font-weight: 600; line-height: 1.6; }
.banner-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.banner .btn { background: rgba(6, 16, 36, .35); color: #fff; }
.banner .btn:hover { background: rgba(6, 16, 36, .55); }
.banner .btn.white { background: #fff; color: #133f97; }
.banner .btn.white:hover { background: #e3eeff; }
.ip-btn { font-family: var(--font); letter-spacing: .01em; }
.ip-btn small { padding: 2px 7px; border-radius: 5px; background: rgba(255, 255, 255, .16); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 10px; }
.stat { padding: 14px 18px; border-radius: 11px; background: rgba(6, 16, 36, .28); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .14); }
.stat b { display: block; font: 400 30px/1 var(--display); color: #fff; }
.stat span { display: block; margin-top: 6px; color: #cfe0ff; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }

/* ── wiki: base additions ── */
.ic { width: 18px; height: 18px; flex-shrink: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 60; padding: 8px 14px; border-radius: 8px; background: var(--blue); color: #fff; font-weight: 800; }
.skip:focus { left: 12px; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.small { font-size: 13px; }
.pad { padding: 14px 18px; margin: 0; }
.full { width: 100%; }
.btn.danger { background: #3a1830; color: #ffb3bd; }
.btn.danger:hover { background: #57203f; color: #fff; }
.btn.discord { background: #5865f2; color: #fff; }
.btn.discord:hover { background: #4752c4; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.nav a { white-space: nowrap; }
@media (max-width: 1180px) and (min-width: 901px) { .search { width: 190px; } .nav a { padding: 8px 9px; } }
.nav a.ext::after { content: "\2197"; margin-left: 4px; font-size: 11px; color: var(--ink-3); }
.signin { flex-shrink: 0; }
.page-h { margin: 0 0 16px; font-size: 30px; }
.toolbar .page-h { margin: 0; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; background: var(--bg-2); border: 1px solid var(--edge-lo); color: var(--ink-2); font-size: 11px; font-weight: 800; vertical-align: 2px; }
.tag.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.lvl { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; background: var(--bg-2); color: var(--ink-2); border: 1px solid var(--edge-lo); }
.lvl.l1 { background: rgba(47, 123, 255, .18); border-color: var(--blue); color: var(--sky); }
.lvl.l2 { background: rgba(255, 200, 61, .14); border-color: var(--t1-dk); color: var(--t1); }
.center { justify-content: center; }

/* account menu */
.me { position: relative; flex-shrink: 0; }
.me-btn { display: block; padding: 0; border: 2px solid var(--edge); border-radius: 10px; background: var(--panel-2); overflow: hidden; }
.me-btn img { display: block; width: 34px; height: 34px; image-rendering: auto; }
.me-menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 40; width: 240px; padding: 6px; border-radius: 12px; background: var(--panel); border: 2px solid var(--edge); box-shadow: 0 20px 40px rgba(0, 0, 0, .45); }
.me-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 10px; border-bottom: 2px solid var(--bg-2); margin-bottom: 4px; }
.me-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-menu a, .me-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font-weight: 700; font-size: 14px; text-align: left; }
.me-menu a:hover, .me-menu button:hover { background: var(--panel-2); }
.me-menu .ic { color: var(--sky); }
.me-note { margin: 4px 10px 8px; color: var(--ink-3); font-size: 12px; }
.suggest a { justify-content: space-between; }
.suggest a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest a small { flex-shrink: 0; color: var(--ink-3); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.suggest .all { justify-content: center; color: var(--sky); font-size: 13px; }

/* hero search */
.hero-search { display: flex; align-items: center; gap: 10px; max-width: 560px; margin-bottom: 16px; padding: 6px 6px 6px 14px; border-radius: 12px; background: #fff; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12), 0 10px 24px rgba(4, 16, 42, .25); color: #5a6f95; }
.hero-search input { flex: 1; min-width: 0; height: 40px; border: 0; outline: 0; background: none; color: #0b1d3d; font: 700 15px var(--font); }
.hero-search input::placeholder { color: #7d8fb0; }
.hero-search .btn.white { background: var(--blue); color: #fff; }
.hero-search .btn.white:hover { background: var(--blue-dk); }
.page-search { max-width: none; background: var(--panel); border: 2px solid var(--edge-lo); box-shadow: none; color: var(--ink-3); }
.page-search:focus-within { border-color: var(--sky); }
.page-search input { color: var(--ink); }

/* breadcrumbs + notices */
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 16px; padding: 0; list-style: none; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.crumbs li { display: flex; align-items: center; gap: 4px; min-width: 0; }
.crumbs a { color: var(--ink-2); }
.crumbs a:hover { color: #fff; }
.crumbs li[aria-current] { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.crumbs .ic { width: 14px; height: 14px; color: var(--ink-3); }
.notice { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; padding: 12px 16px; border-radius: var(--r-sm); background: rgba(47, 123, 255, .12); border: 2px solid var(--edge); color: var(--ink-2); font-size: 14px; font-weight: 600; }
.notice > span { flex: 1; min-width: 200px; }
.notice .ic { color: var(--sky); }
.notice.warn { background: rgba(255, 200, 61, .09); border-color: var(--t1-dk); }
.notice.warn .ic { color: var(--t1); }
.notice a { color: var(--sky); font-weight: 800; }

/* categories */
.cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 34px; }
.cat { --c: var(--blue); position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 16px; border-radius: var(--r); background: var(--panel); border: 2px solid var(--edge-lo); border-bottom: 5px solid color-mix(in srgb, var(--c) 55%, #061024); transition: transform .15s, border-color .15s; }
.cat:hover { transform: translateY(-3px); border-color: var(--c); }
.cat-ic { --c: var(--blue); display: grid; place-items: center; flex-shrink: 0; width: 42px; height: 42px; border-radius: 10px; background: var(--c); color: #061024; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .22); }
.cat-ic .ic { width: 22px; height: 22px; }
.cat-ic.big { width: 58px; height: 58px; border-radius: 14px; }
.cat-ic.big .ic { width: 30px; height: 30px; }
.cat .cat-ic, .cat-head .cat-ic { background: var(--c); }
.cat-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-right: 26px; }
.cat-main b { font-size: 16px; font-weight: 900; }
.cat-main span { color: var(--ink-2); font-size: 13px; font-weight: 600; line-height: 1.4; }
.cat-n { position: absolute; top: 12px; right: 12px; min-width: 26px; padding: 1px 7px; border-radius: 6px; background: var(--bg-2); color: var(--ink-3); font: 400 14px/1.4 var(--display); text-align: center; }
.cat-head { --c: var(--blue); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.cat-head > div { flex: 1; min-width: 220px; }
.cat-head h1 { font-size: 30px; margin-bottom: 4px; }
.cat-head p { margin: 0; }

/* lists */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .h-title { margin: 0; }
.toolbar .grow { flex: 1; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 10px; background: var(--bg); border: 2px solid var(--edge-lo); }
.seg button { height: 30px; padding: 0 11px; border: 0; border-radius: 7px; background: none; color: var(--ink-3); font-size: 12px; font-weight: 800; }
.seg button:hover { color: #fff; }
.seg button.on { background: var(--panel-2); color: #fff; box-shadow: inset 0 -2px 0 var(--blue); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.side { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.side .panel { padding: 16px 18px; }
.side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--sky); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.side-head a { color: var(--ink-3); }
.side-head a:hover { color: #fff; }
.side-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.join .btn { margin-top: 8px; }
.join p { margin: 0 0 4px; }
.list { overflow: hidden; }
.pr { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 2px solid var(--bg-2); transition: background .12s; }
.pr:last-child { border-bottom: 0; }
.pr:hover { background: var(--panel-2); }
.pr-ic { --c: var(--blue); display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 9px; background: var(--bg-2); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.pr-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.pr-main b { font-size: 15px; font-weight: 800; }
.pr-main span { color: var(--ink-2); font-size: 13px; font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pr-meta { flex-shrink: 0; color: var(--ink-3); font-size: 12px; font-weight: 700; }
.snip mark, .md mark { background: rgba(255, 200, 61, .22); color: var(--t1); border-radius: 3px; padding: 0 2px; }
.ch { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 2px solid var(--bg-2); }
.ch:last-child { border-bottom: 0; }
.ch > img { width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; image-rendering: auto; background: var(--panel-2); }
.ch-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ch-main a:hover b { color: var(--sky); }
.ch-side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* news */
.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.post { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: var(--r); background: var(--panel); border: 2px solid var(--edge-lo); border-top: 5px solid var(--blue); transition: transform .15s, border-color .15s; }
.post:hover { transform: translateY(-3px); border-color: var(--edge-hi); }
.post b { font-size: 17px; font-weight: 900; line-height: 1.25; }
.post-date { color: var(--sky); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.post-sum { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.post-by { display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 6px; color: var(--ink-3); font-size: 12px; font-weight: 700; }
.post-by img { width: 20px; height: 20px; border-radius: 5px; image-rendering: auto; }
.posts-mini { display: flex; flex-direction: column; gap: 10px; }
.posts-mini .post { padding: 12px 14px; border-top-width: 4px; background: var(--bg-2); }
.posts-mini .post b { font-size: 15px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 20px; }

/* article */
.article { padding: 28px 34px 26px; min-width: 0; }
.art-head { margin-bottom: 20px; padding-bottom: 18px; border-bottom: 2px solid var(--bg-2); }
.kicker { --c: var(--sky); display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--c); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.kicker .ic { width: 16px; height: 16px; }
.art-head h1 { font-size: 36px; margin-bottom: 8px; overflow-wrap: anywhere; }
.lead { margin: 0 0 14px; color: var(--ink-2); font-size: 17px; font-weight: 600; line-height: 1.55; }
.art-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.by { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.by b { color: var(--ink-2); }
.by img { width: 24px; height: 24px; border-radius: 6px; image-rendering: auto; }
.art-actions { display: flex; gap: 8px; }
.art-foot { margin-top: 30px; padding-top: 16px; border-top: 2px solid var(--bg-2); font-size: 13px; }
.art-foot a { color: var(--sky); font-weight: 700; }
.toc ol, .toc-m ol { margin: 0; padding: 0; list-style: none; }
.toc { max-height: calc(100vh - 220px); overflow: auto; }
.toc li a, .toc-m li a { display: block; padding: 5px 8px; border-radius: 7px; border-left: 2px solid transparent; color: var(--ink-2); font-size: 14px; font-weight: 700; }
.toc li.t3 a, .toc-m li.t3 a { padding-left: 22px; font-size: 13px; font-weight: 600; }
.toc li a:hover, .toc-m li a:hover { background: var(--panel-2); color: #fff; }
.toc li a.on { color: #fff; background: var(--panel-2); border-left-color: var(--blue); }
.toc-m { display: none; margin: -6px 0 18px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--bg-2); border: 2px solid var(--edge-lo); }
.toc-m summary { cursor: pointer; color: var(--sky); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.toc-m ol { margin-top: 8px; }
.rel { display: flex; flex-direction: column; }
.rel a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; color: var(--ink); font-size: 14px; font-weight: 700; }
.rel a:hover { background: var(--panel-2); }
.rel .ic { width: 16px; height: 16px; color: var(--sky); }

/* markdown content */
.md { font-size: 16px; line-height: 1.7; color: #dbe6fb; overflow-wrap: break-word; }
.md > :first-child { margin-top: 0; }
.md h2, .md h3, .md h4 { position: relative; scroll-margin-top: 90px; color: #fff; }
.md h2 { margin: 34px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--bg-2); font-size: 25px; }
.md h3 { margin: 26px 0 10px; font-size: 19px; }
.md h4 { margin: 20px 0 8px; font-size: 16px; text-transform: uppercase; letter-spacing: .03em; color: var(--sky); }
.md .anchor { position: absolute; left: -22px; padding-right: 6px; color: var(--ink-3); opacity: 0; font-weight: 700; transition: opacity .12s; }
.md h2:hover .anchor, .md h3:hover .anchor, .md h4:hover .anchor { opacity: 1; }
.md p { margin: 0 0 14px; }
.md a { color: var(--sky); font-weight: 700; text-decoration: underline; text-decoration-color: rgba(111, 178, 255, .35); text-underline-offset: 3px; }
.md a:hover { text-decoration-color: var(--sky); }
.md a.anchor { text-decoration: none; }
.md strong { color: #fff; font-weight: 800; }
.md ul, .md ol { margin: 0 0 14px; padding-left: 24px; }
.md li { margin: 4px 0; }
.md li::marker { color: var(--sky); font-weight: 800; }
.md li.task { list-style: none; margin-left: -20px; }
.md li.task input { accent-color: var(--blue); margin-right: 6px; }
.md code { padding: 2px 6px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--edge-lo); color: #bfe0ff; font: 600 .88em/1.4 ui-monospace, "Cascadia Code", Consolas, monospace; overflow-wrap: anywhere; }
.md pre { margin: 0 0 16px; padding: 14px 16px; border-radius: var(--r-sm); background: #050d1f; border: 2px solid var(--edge-lo); overflow-x: auto; }
.md pre code { padding: 0; border: 0; background: none; font-size: 14px; overflow-wrap: normal; white-space: pre; }
.md blockquote { margin: 0 0 16px; padding: 10px 16px; border-left: 4px solid var(--edge-hi); border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--bg-2); color: var(--ink-2); }
.md blockquote > :last-child, .callout > :last-child { margin-bottom: 0; }
.md hr { margin: 28px 0; border: 0; border-top: 2px solid var(--edge-lo); }
.md img { max-width: 100%; height: auto; border-radius: var(--r-sm); image-rendering: auto; }
.md .table, .md-help .table { margin: 0 0 16px; overflow-x: auto; border-radius: var(--r-sm); border: 2px solid var(--edge-lo); }
.md table, .md-help table { width: 100%; border-collapse: collapse; font-size: 14px; }
.md th, .md td, .md-help td { padding: 9px 12px; border-bottom: 2px solid var(--bg-2); text-align: left; vertical-align: top; }
.md th { background: var(--bg-2); color: var(--sky); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.md tr:last-child td, .md-help tr:last-child td { border-bottom: 0; }
.md td code { white-space: nowrap; }
.callout { --c: var(--sky); margin: 0 0 16px; padding: 12px 16px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--c) 10%, transparent); border: 2px solid color-mix(in srgb, var(--c) 45%, transparent); }
.callout-t { margin-bottom: 4px; color: var(--c); font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.c-tip { --c: var(--up); } .c-warning { --c: var(--t1); } .c-danger { --c: var(--down); } .c-important { --c: var(--t4); }

/* editor */
.editor { display: flex; flex-direction: column; gap: 14px; }
.ed-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.ed-top .page-h { margin-bottom: 2px; }
.ed-top p { margin: 0; }
.ed-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ed-fields { display: grid; grid-template-columns: 2fr 1.4fr 1fr 90px; gap: 12px; padding: 16px; }
.f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f > span { color: var(--ink-3); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.f > span i { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 600; margin-left: 6px; }
.f input, .f select, .ch-side select { width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 2px solid var(--edge-lo); background: var(--bg-2); color: var(--ink); font: 600 14px var(--font); outline: 0; transition: border-color .15s; }
.ch-side select { width: 160px; height: 34px; }
.f input:focus, .f select:focus, .ch-side select:focus { border-color: var(--sky); }
.f input:invalid:not(:placeholder-shown) { border-color: var(--down); }
.f-title input { font-size: 16px; font-weight: 800; }
.f-sum { grid-column: 1 / -1; }
.slug { display: flex; align-items: center; border-radius: var(--r-sm); border: 2px solid var(--edge-lo); background: var(--bg-2); }
.slug:focus-within { border-color: var(--sky); }
.slug em { padding-left: 12px; color: var(--ink-3); font: 600 13px var(--font); font-style: normal; }
.f .slug input { border: 0; padding-left: 2px; background: none; }
.ed-main { overflow: hidden; }
.ed-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 2px solid var(--bg-2); background: var(--bg-2); }
.ed-tools { display: flex; flex-wrap: wrap; gap: 4px; }
.ed-tools button { height: 30px; min-width: 32px; padding: 0 9px; border: 1px solid var(--edge-lo); border-radius: 7px; background: var(--panel); color: var(--ink-2); font-size: 12px; font-weight: 800; }
.ed-tools button:hover { color: #fff; border-color: var(--edge); background: var(--panel-2); }
.ed-panes { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 520px; }
.ed-panes textarea { display: block; width: 100%; min-height: 520px; padding: 18px 20px; border: 0; outline: 0; resize: vertical; background: transparent; color: var(--ink); font: 500 14px/1.65 ui-monospace, "Cascadia Code", Consolas, monospace; tab-size: 2; }
.ed-preview { display: none; padding: 18px 24px; overflow: auto; min-width: 0; }
.ed-panes[data-view="preview"] textarea { display: none; }
.ed-panes[data-view="preview"] .ed-preview { display: block; }
.ed-panes[data-view="split"] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ed-panes[data-view="split"] .ed-preview { display: block; max-height: 75vh; border-left: 2px solid var(--bg-2); }
.ed-panes[data-view="split"] textarea { height: 75vh; resize: none; }
.ed-foot { display: flex; align-items: flex-end; gap: 14px; padding: 12px 16px; border-top: 2px solid var(--bg-2); }
.ed-foot .f-note { flex: 1; }
.md-help { padding: 16px; }
.md-help code { padding: 1px 5px; border-radius: 5px; background: var(--bg-2); font: 600 12px ui-monospace, Consolas, monospace; color: #bfe0ff; }

/* tabs (admin, history) */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; padding-bottom: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: flex; align-items: center; gap: 8px; flex-shrink: 0; height: 42px; padding: 0 15px; border-radius: var(--r-sm); border: 2px solid var(--edge-lo); background: var(--panel); color: var(--ink-2); font-weight: 800; font-size: 14px; transition: border-color .15s, color .15s, background .15s; }
.tab:hover { color: #fff; border-color: var(--edge); }
.tab.on { color: #fff; background: var(--blue); border-color: var(--sky); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18); }

/* admin */
.inline-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 14px; }
.inline-form .f { flex: 1; min-width: 160px; }
.cat-edit { display: flex; flex-direction: column; gap: 10px; }
.cat-form { display: grid; grid-template-columns: 42px 1.2fr 1fr 2.4fr 110px 64px 74px auto; gap: 10px; align-items: end; padding: 12px 14px; }
.cat-form.new { border-style: dashed; }
.cat-form .f-color input { padding: 2px 4px; }
.cat-btns { display: flex; gap: 6px; }
section > p.muted { margin-top: 0; }

/* history diff */
.diff { padding: 6px 0; overflow-x: auto; }
.dl { display: flex; gap: 10px; padding: 1px 16px; font: 500 13px/1.6 ui-monospace, Consolas, monospace; }
.dl span { width: 12px; flex-shrink: 0; color: var(--ink-3); font-weight: 800; }
.dl code { white-space: pre-wrap; overflow-wrap: anywhere; }
.dl.da { background: rgba(74, 222, 128, .1); } .dl.da span { color: var(--up); }
.dl.dr { background: rgba(255, 107, 120, .1); } .dl.dr span { color: var(--down); }
.dl.dc { color: var(--ink-3); }
.dskip { justify-content: center; color: var(--ink-3); }
b.add { color: var(--up); } b.rem { color: var(--down); }

/* empty / 404 */
.empty-state { padding: 60px 20px; text-align: center; }
.empty-state h1, .empty-state h2 { margin-bottom: 8px; font-size: 26px; }
.empty-state p { margin: 0 auto; max-width: 480px; }
.empty-state .banner-actions { margin-top: 20px; }
.big-code { font: 400 72px/1 var(--display); color: var(--sky); text-shadow: 0 5px 0 var(--blue-dk), 0 8px 0 #04102a; margin-bottom: 14px; }

/* footer & toast */
.foot { padding: 34px 0; background: #040b1a; border-top: 3px solid #0c2149; }
.foot-in { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.foot-copy { color: var(--sky); font-weight: 700; }
.foot-copy b { color: #fff; }
.foot-note { margin: 6px 0 0; color: var(--ink-3); font-size: 13px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; font-size: 13px; font-weight: 700; }
.foot-links a { color: var(--ink-2); }
.foot-links a:hover { color: #fff; }
.foot-social { display: grid; place-items: center; flex-shrink: 0; width: 46px; height: 46px; border-radius: 10px; background: #5865f2; color: #fff; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .2); }
.foot-social .ic { width: 24px; height: 24px; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 50; max-width: calc(100% - 32px); transform: translateX(-50%); padding: 12px 20px; border-radius: 10px; background: var(--blue); color: #fff; font-weight: 800; font-size: 14px; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18), 0 12px 30px rgba(0, 0, 0, .4); }
.toast.err { background: #c2364a; }

/* responsive */
@media (max-width: 1080px) {
  .cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols { grid-template-columns: minmax(0, 1fr) 280px; }
  .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-form { grid-template-columns: 42px 1fr 1fr 1fr; }
  .cat-form .f-wide { grid-column: 2 / -1; }
}
@media (max-width: 900px) {
  .nav { position: absolute; top: 70px; left: 0; right: 0; display: none; flex-direction: column; padding: 10px 16px 14px; background: var(--bg); border-bottom: 2px solid var(--edge-lo); }
  .nav.open { display: flex; }
  .menu-btn { display: block; }
  .search { flex: 1; width: auto; min-width: 0; }
  .search kbd { display: none; }
  .banner { grid-template-columns: minmax(0, 1fr); padding: 28px; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
  .article-cols .toc { display: none; }
  .toc-m { display: block; }
  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ed-fields { grid-template-columns: 1fr 1fr; }
  .f-title { grid-column: 1 / -1; }
  .ed-panes[data-view="split"] { grid-template-columns: minmax(0, 1fr); }
  .ed-panes[data-view="split"] .ed-preview { border-left: 0; border-top: 2px solid var(--bg-2); }
  .ed-panes[data-view="split"] textarea { height: 45vh; }
}
@media (max-width: 640px) {
  .top-in { gap: 10px; height: 62px; }
  .nav { top: 64px; }
  .wm { font-size: 23px; }
  .brand-tag { display: none; }
  .signin span { display: none; }
  .signin { padding: 0 10px; }
  .search { padding: 0 8px; }
  .search input { height: 36px; }
  main { padding-top: 20px; }
  .banner { padding: 22px 18px; gap: 18px; }
  .banner h1 { font-size: 26px; }
  .hero-search { padding-left: 10px; }
  .hero-search .btn { padding: 0 12px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 12px 14px; }
  .stat b { font-size: 24px; }
  .cats { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .cat { padding: 13px 14px; }
  .posts { grid-template-columns: minmax(0, 1fr); }
  .page-h, .cat-head h1 { font-size: 25px; }
  .article { padding: 20px 18px; }
  .art-head h1 { font-size: 27px; }
  .lead { font-size: 15px; }
  .md { font-size: 15px; }
  .md h2 { font-size: 21px; }
  .md .anchor { display: none; }
  .md table { font-size: 13px; }
  .md th, .md td { padding: 8px 9px; }
  .pr { padding: 12px; gap: 12px; }
  .pr-meta { display: none; }
  .ch { flex-wrap: wrap; }
  .ch-side { width: 100%; justify-content: flex-end; }
  .ed-fields { grid-template-columns: minmax(0, 1fr); }
  .ed-actions { width: 100%; }
  .ed-actions .btn { flex: 1; }
  .ed-panes, .ed-panes textarea { min-height: 380px; }
  .ed-foot { flex-direction: column; align-items: stretch; }
  .cat-form { grid-template-columns: 42px minmax(0, 1fr); }
  .cat-form .f, .cat-form .cat-btns { grid-column: 1 / -1; }
  .foot-in { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }
