:root {
  color-scheme: dark;
  --bg: #0b0d12;
  --panel: #11141b;
  --panel-2: #171b24;
  --line: #252b37;
  --muted: #929bad;
  --text: #eef1f7;
  --accent: #f05a28;
  --accent-2: #ff7a3d;
  --green: #4ed49b;
  --top: 4.25rem;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); min-width: 20rem; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.topbar { position: fixed; z-index: 20; inset: 0 0 auto 0; height: var(--top); display: grid; grid-template-columns: 15.5rem minmax(16rem, 38rem) 1fr; align-items: center; gap: 1.5rem; padding: 0 1.25rem; background: rgba(11,13,18,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; width: max-content; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.05; }
.brand strong { font-size: 1.02rem; letter-spacing: .01em; }
.brand small { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .15em; margin-top: .2rem; }
.brand-mark { position: relative; display: block; width: 2rem; height: 2rem; transform: rotate(30deg); }
.brand-mark i { position: absolute; width: 1.05rem; height: 1.05rem; background: var(--accent); border-radius: .18rem; }
.brand-mark i:nth-child(1) { left: .48rem; top: 0; }.brand-mark i:nth-child(2) { left: 0; top: .82rem; }.brand-mark i:nth-child(3) { right: 0; top: .82rem; background: #ff8759; }
.global-search { height: 2.65rem; display: flex; align-items: center; gap: .6rem; padding: 0 .7rem 0 1rem; border: 1px solid var(--line); background: var(--panel); border-radius: .65rem; transition: border-color .2s, box-shadow .2s; }
.global-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240,90,40,.12); }
.global-search input { flex: 1; min-width: 0; color: var(--text); border: 0; outline: 0; background: transparent; }
.global-search input::placeholder { color: #717b8d; }
kbd { color: var(--muted); border: 1px solid #303746; background: #1b202a; padding: .18rem .42rem; border-radius: .32rem; font-size: .72rem; }
.account { justify-self: end; display: flex; align-items: center; gap: .6rem; }
.account-loading { color: var(--muted); font-size: .85rem; }
.account-user { display: flex; align-items: center; gap: .65rem; }
.avatar { width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%; background: #252b37; color: var(--text); object-fit: cover; font-weight: 700; }
.account-name { display: flex; flex-direction: column; line-height: 1.15; font-size: .82rem; }.account-name small { color: var(--muted); }
.layout { display: grid; grid-template-columns: 16.5rem minmax(0, 1fr) 14rem; max-width: 96rem; margin: var(--top) auto 0; min-height: calc(100vh - var(--top)); }
.sidebar { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; border-right: 1px solid var(--line); padding: 1.5rem 1rem 1rem; display: flex; flex-direction: column; background: #0d1016; }
.sidebar-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 .55rem .75rem; color: #c6cbd5; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.icon-button { width: 1.75rem; height: 1.75rem; border: 1px solid var(--line); border-radius: .42rem; color: var(--text); background: var(--panel-2); cursor: pointer; font-size: 1.15rem; line-height: 1; }
.nav-group { margin-bottom: 1rem; }.nav-group > strong { display: block; padding: .45rem .6rem; color: #687386; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; }
.nav-link { width: 100%; display: flex; align-items: center; gap: .55rem; padding: .55rem .62rem; margin: .08rem 0; border: 0; border-radius: .45rem; text-align: left; text-decoration: none; background: transparent; color: #aeb6c5; cursor: pointer; font-size: .87rem; }
.nav-link:hover { color: var(--text); background: #151922; }.nav-link.active { color: #fff; background: #211b1b; box-shadow: inset 2px 0 var(--accent); }
.lock { color: var(--accent-2); font-size: .7rem; margin-left: auto; }
.sidebar-footer { margin-top: auto; padding: 1rem .55rem .25rem; color: #697386; font-size: .72rem; border-top: 1px solid var(--line); }
.status-dot { display: inline-block; width: .45rem; height: .45rem; margin-right: .4rem; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(78,212,155,.1); }
.main { min-width: 0; padding: 3.25rem clamp(1.5rem, 5vw, 5.5rem) 6rem; outline: 0; }
.article { max-width: 52rem; margin: 0 auto; }
.breadcrumb { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .8rem; margin-bottom: 1.25rem; }.breadcrumb span:last-child { color: #c1c7d1; }
.article-head { position: relative; border-bottom: 1px solid var(--line); padding-bottom: 1.75rem; margin-bottom: 2rem; }
.eyebrow { display: block; color: var(--accent-2); font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 750; margin-bottom: .6rem; }
.article h1 { margin: 0; font-size: clamp(2.1rem, 5vw, 3.5rem); letter-spacing: -.04em; line-height: 1.05; }
.lede { max-width: 44rem; color: #aeb6c4; font-size: 1.08rem; line-height: 1.7; margin: 1rem 0 0; }
.meta { display: flex; flex-wrap: wrap; gap: .8rem 1.25rem; color: #707a8b; font-size: .76rem; margin-top: 1rem; }.visibility { color: #d4a17f; }
.article-actions { display: flex; gap: .5rem; margin-top: 1.25rem; }
.button { border: 1px solid var(--line); border-radius: .5rem; padding: .62rem .9rem; color: var(--text); background: var(--panel-2); cursor: pointer; font-weight: 650; font-size: .85rem; }
.button:hover { border-color: #3b4352; background: #1d222c; }.button.primary { border-color: var(--accent); background: var(--accent); color: white; }.button.primary:hover { background: var(--accent-2); }.button.ghost { background: transparent; }.button.danger { color: #ff9b84; }
.wiki-content { color: #c9ced8; line-height: 1.78; }
.wiki-content h1, .wiki-content h2, .wiki-content h3, .wiki-content h4 { color: var(--text); letter-spacing: -.02em; scroll-margin-top: 6rem; }
.wiki-content h1 { font-size: 2rem; margin: 2.7rem 0 1rem; }.wiki-content h2 { font-size: 1.55rem; margin: 2.6rem 0 .8rem; padding-top: .2rem; }.wiki-content h3 { font-size: 1.18rem; margin: 2rem 0 .55rem; }
.wiki-content p { margin: .7rem 0 1.1rem; }.wiki-content strong { color: #f2f4f8; }.wiki-content a { color: #ff936a; text-decoration-color: rgba(255,147,106,.4); text-underline-offset: .18em; }.wiki-content a:hover { text-decoration-color: currentColor; }
.wiki-content code { padding: .15rem .36rem; border: 1px solid #2b3240; border-radius: .3rem; background: #151922; color: #ffb49a; font: .87em "Cascadia Code", Consolas, monospace; }
.wiki-content pre { overflow: auto; padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: .65rem; background: #090b10; }.wiki-content pre code { padding: 0; border: 0; background: transparent; color: #d7dce6; }
.wiki-content blockquote { margin: 1.5rem 0; padding: .95rem 1.1rem; border-left: 3px solid var(--accent); background: #171719; color: #d5d7de; }.wiki-content blockquote p { margin: 0; }
.wiki-content img { display: block; max-width: 100%; height: auto; margin: 1.5rem 0; border: 1px solid var(--line); border-radius: .7rem; background: #07090d; }
.wiki-content li { margin: .42rem 0; }.wiki-content hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.empty-state { padding: 4rem 1rem; text-align: center; }.empty-state h1 { font-size: 2rem; }.empty-state p { color: var(--muted); }
.toc { position: sticky; top: var(--top); align-self: start; height: calc(100vh - var(--top)); padding: 3.25rem 1.25rem; border-left: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.toc > strong { display: block; color: #cad0db; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: .8rem; }.toc a { display: block; padding: .35rem 0 .35rem .75rem; border-left: 1px solid #2b313e; text-decoration: none; line-height: 1.35; }.toc a:hover { color: var(--text); border-color: var(--accent); }
.mobile-nav { display: none; }
.skeleton { height: .75rem; margin: .7rem; border-radius: 1rem; background: linear-gradient(90deg,#171b23,#202630,#171b23); background-size: 200% 100%; animation: shimmer 1.2s infinite; }.skeleton.short { width: 60%; }.skeleton.wide { width: 35%; }.skeleton.title { width: 70%; height: 2.6rem; }
@keyframes shimmer { to { background-position: -200% 0; } }
dialog { color: var(--text); background: var(--panel); border: 1px solid #343b49; border-radius: .85rem; box-shadow: 0 1.5rem 5rem rgba(0,0,0,.55); } dialog::backdrop { background: rgba(3,5,8,.78); backdrop-filter: blur(4px); }
.editor-dialog { width: min(94vw, 78rem); height: min(90vh, 56rem); padding: 0; }.editor-dialog form { height: 100%; display: flex; flex-direction: column; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--line); }.dialog-header h2 { margin: 0; font-size: 1.3rem; }.dialog-header .eyebrow { margin-bottom: .25rem; }
.close-button { width: 2.25rem; height: 2.25rem; border: 0; border-radius: .4rem; color: var(--muted); background: transparent; font-size: 1.6rem; cursor: pointer; }.close-button:hover { color: white; background: var(--panel-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .75rem; padding: 1rem 1.5rem; border-bottom: 1px solid var(--line); }.field { display: flex; flex-direction: column; gap: .35rem; }.field-wide { grid-column: span 2; }.field span, .workspace-title span { color: var(--muted); font-size: .72rem; }.field input, .field select { height: 2.45rem; border: 1px solid #303746; border-radius: .45rem; padding: 0 .7rem; outline: 0; color: var(--text); background: #0d1016; }.field input:focus, .field select:focus { border-color: var(--accent); }
.editor-workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; }.editor-workspace > section { min-width: 0; display: flex; flex-direction: column; }.editor-workspace > section:first-child { border-right: 1px solid var(--line); }.workspace-title { height: 2.7rem; display: flex; align-items: center; justify-content: space-between; padding: 0 1rem; border-bottom: 1px solid var(--line); font-size: .8rem; }
.editor-workspace textarea { flex: 1; resize: none; border: 0; outline: 0; padding: 1.25rem; color: #d9dee7; background: #0a0c11; font: .9rem/1.65 "Cascadia Code", Consolas, monospace; }.preview-pane .wiki-content { flex: 1; overflow: auto; padding: 1rem 1.5rem 2rem; }
.dialog-footer { min-height: 4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1.5rem; border-top: 1px solid var(--line); }.dialog-footer > div { display: flex; gap: .55rem; }.dialog-footer > span { color: #ff9b84; font-size: .82rem; }
.history-dialog { width: min(90vw, 38rem); max-height: 80vh; padding: 0; }.history-list { padding: .75rem; max-height: 60vh; overflow: auto; }.history-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem; border-bottom: 1px solid var(--line); }.history-item strong { display: block; }.history-item small { color: var(--muted); }
.toast { position: fixed; z-index: 50; right: 1.25rem; bottom: 1.25rem; max-width: 24rem; padding: .8rem 1rem; border: 1px solid #3a4251; border-radius: .55rem; background: #181d26; color: #f1f3f7; box-shadow: 0 .7rem 2rem rgba(0,0,0,.4); opacity: 0; transform: translateY(.75rem); pointer-events: none; transition: .2s; }.toast.show { opacity: 1; transform: none; }
@media (max-width: 70rem) { .layout { grid-template-columns: 15.5rem minmax(0,1fr); }.toc { display: none; }.topbar { grid-template-columns: 14.5rem minmax(14rem, 34rem) 1fr; } }
@media (max-width: 48rem) {
  :root { --top: 4rem; }.topbar { grid-template-columns: auto auto 1fr; gap: .65rem; padding: 0 .75rem; }.brand small, .global-search kbd, .account-name { display: none; }.global-search { grid-column: auto; padding: 0 .6rem; }.mobile-nav { display: block; order: -1; border: 1px solid var(--line); border-radius: .4rem; color: var(--text); background: var(--panel); padding: .45rem .6rem; }.layout { display: block; }.sidebar { position: fixed; z-index: 15; top: var(--top); left: 0; width: min(19rem, 85vw); transform: translateX(-102%); transition: transform .22s; box-shadow: 1rem 0 3rem rgba(0,0,0,.4); }.sidebar.open { transform: none; }.main { padding: 2rem 1.15rem 4rem; }.article h1 { font-size: 2.25rem; }.form-grid { grid-template-columns: 1fr; }.field-wide { grid-column: auto; }.editor-workspace { grid-template-columns: 1fr; }.preview-pane { display: none !important; }.editor-workspace > section:first-child { border-right: 0; }.editor-dialog { width: 100vw; height: 100vh; max-width: none; max-height: none; border-radius: 0; }.dialog-footer > span { display: none; }
}
