/* Last Mile Wiki. Same palette and window style as the Ironlock Version Roadmap. */
:root {
  --desk: #D9DEE6; --desk-a: rgba(255, 149, 0, .16); --desk-b: rgba(0, 122, 255, .14);
  --window: #F5F5F7; --bar: rgba(246, 246, 248, .86); --side: rgba(232, 233, 238, .78);
  --group: #FFFFFF; --sunk: #EDEDF0; --fill: rgba(120, 120, 128, .12); --fill-2: rgba(120, 120, 128, .2);
  --fg: #1D1D1F; --fg-2: #48484C; --muted: #6E6E73; --sep: rgba(60, 60, 67, .16); --edge: rgba(0, 0, 0, .14);
  --accent: #007AFF; --brand: #FF7A2F; --sel: rgba(0, 0, 0, .07);
  --ok: #1E9E34; --ok-bg: rgba(40, 200, 64, .14); --warn: #B25000; --warn-bg: rgba(255, 149, 0, .14);
  --plan: #0060D0; --plan-bg: rgba(0, 122, 255, .11); --admin: #8E3FC0; --admin-bg: rgba(175, 82, 222, .12);
  --danger: #D70015; --teal: #30B0C7; --minor: #FFCC00; --purple: #AF52DE; --major: #FF9500; --green: #28C840;
  --shadow: 0 22px 70px rgba(0, 0, 0, .22), 0 0 0 .5px rgba(0, 0, 0, .18);
  --pop: 0 12px 40px rgba(0, 0, 0, .18), 0 0 0 .5px var(--edge);
  --sys: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', 'Segoe UI', system-ui, sans-serif;
  --rounded: ui-rounded, 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --desk: #15171C; --desk-a: rgba(255, 159, 10, .13); --desk-b: rgba(10, 132, 255, .12);
  --window: #1E1E20; --bar: rgba(44, 44, 47, .88); --side: rgba(38, 38, 42, .8);
  --group: #2A2A2D; --sunk: #232326; --fill: rgba(120, 120, 128, .24); --fill-2: rgba(120, 120, 128, .34);
  --fg: #F5F5F7; --fg-2: #D1D1D6; --muted: #98989D; --sep: rgba(255, 255, 255, .09); --edge: rgba(255, 255, 255, .1);
  --accent: #0A84FF; --sel: rgba(255, 255, 255, .1);
  --ok: #32D74B; --ok-bg: rgba(50, 215, 75, .14); --warn: #FFB340; --warn-bg: rgba(255, 159, 10, .15);
  --plan: #64B0FF; --plan-bg: rgba(10, 132, 255, .17); --admin: #D58CF5; --admin-bg: rgba(191, 90, 242, .17);
  --danger: #FF6961; --teal: #40C8E0; --purple: #BF5AF2; --major: #FF9F0A; --green: #32D74B;
  --shadow: 0 22px 70px rgba(0, 0, 0, .6), 0 0 0 .5px rgba(255, 255, 255, .14);
  --pop: 0 12px 40px rgba(0, 0, 0, .55), 0 0 0 .5px var(--edge);
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --desk: #15171C; --desk-a: rgba(255, 159, 10, .13); --desk-b: rgba(10, 132, 255, .12);
  --window: #1E1E20; --bar: rgba(44, 44, 47, .88); --side: rgba(38, 38, 42, .8);
  --group: #2A2A2D; --sunk: #232326; --fill: rgba(120, 120, 128, .24); --fill-2: rgba(120, 120, 128, .34);
  --fg: #F5F5F7; --fg-2: #D1D1D6; --muted: #98989D; --sep: rgba(255, 255, 255, .09); --edge: rgba(255, 255, 255, .1);
  --accent: #0A84FF; --sel: rgba(255, 255, 255, .1);
  --ok: #32D74B; --ok-bg: rgba(50, 215, 75, .14); --warn: #FFB340; --warn-bg: rgba(255, 159, 10, .15);
  --plan: #64B0FF; --plan-bg: rgba(10, 132, 255, .17); --admin: #D58CF5; --admin-bg: rgba(191, 90, 242, .17);
  --danger: #FF6961; --teal: #40C8E0; --purple: #BF5AF2; --major: #FF9F0A; --green: #32D74B;
  --shadow: 0 22px 70px rgba(0, 0, 0, .6), 0 0 0 .5px rgba(255, 255, 255, .14);
  --pop: 0 12px 40px rgba(0, 0, 0, .55), 0 0 0 .5px var(--edge);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--desk); color: var(--fg); font-family: var(--sys); font-size: 14px; line-height: 1.5;
  background-image: radial-gradient(1200px 700px at 8% -10%, var(--desk-a), transparent 60%), radial-gradient(1000px 800px at 100% 20%, var(--desk-b), transparent 60%);
  background-attachment: fixed; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- window ---------- */
.desk { padding: 28px 24px 48px; }
.window { max-width: 1320px; margin: 0 auto; background: var(--window); border-radius: 12px; box-shadow: var(--shadow); overflow: clip; min-height: calc(100vh - 76px); display: flex; flex-direction: column; }
.bar {
  position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 260px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 56px; padding-right: 14px; background: var(--bar); border-bottom: .5px solid var(--edge);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.brand { display: flex; align-items: center; gap: 10px; padding-left: 16px; min-width: 0; color: var(--fg); }
.brand:hover { text-decoration: none; }
.brand svg { width: 28px; height: 28px; flex: none; }
.brand b { display: block; font-size: 14px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.brand small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn.menu-btn { display: none; }

.search { position: relative; max-width: 560px; width: 100%; }
.search input {
  width: 100%; height: 34px; border-radius: 9px; border: 0; padding: 0 64px 0 34px; background: var(--fill);
  font-size: 13.5px; outline: none;
}
.search input:focus { background: var(--group); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.search > svg { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search kbd { position: absolute; right: 8px; top: 7px; }
.results {
  position: absolute; left: 0; right: 0; top: 40px; background: var(--group); border-radius: 12px; box-shadow: var(--pop);
  padding: 6px; max-height: min(70vh, 520px); overflow: auto; z-index: 30;
}
.results a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--fg); }
.results a:hover, .results a[aria-selected="true"] { background: var(--sel); text-decoration: none; }
.results a b { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.results a small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.results a span.snip { display: block; color: var(--fg-2); font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results mark, .search-page mark { background: color-mix(in srgb, var(--minor) 45%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.results .empty { padding: 14px 10px; color: var(--muted); font-size: 13px; }
.results .all { border-top: .5px solid var(--sep); margin-top: 4px; padding-top: 9px; font-size: 12.5px; color: var(--accent); }

.bar-right { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; cursor: pointer; color: var(--fg-2);
}
.icon-btn:hover { background: var(--sel); }
.icon-btn svg { width: 18px; height: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 13px; border-radius: 8px; border: 0;
  background: var(--group); color: var(--fg); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 0 0 .5px var(--edge);
}
.btn:hover { background: var(--sunk); text-decoration: none; }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.danger { color: var(--danger); }
.btn.small { height: 26px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.admin-on { background: var(--admin-bg); color: var(--admin); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--admin) 40%, transparent); }

kbd {
  display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 5px; font-family: var(--mono); font-size: 11.5px; font-weight: 600; line-height: 1.5;
  text-align: center; background: var(--group); color: var(--fg-2); box-shadow: inset 0 -1px 0 var(--fill-2), 0 0 0 .5px var(--edge); vertical-align: 1px;
}

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); flex: 1; }
.side { background: var(--side); border-right: .5px solid var(--edge); padding: 14px 10px 24px; backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); }
.side-inner { position: sticky; top: 70px; max-height: calc(100vh - 84px); overflow: auto; display: flex; flex-direction: column; gap: 14px; padding-bottom: 12px; }
.side-sec h4 {
  margin: 0; display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 2px 10px 4px; font-size: 11px; font-weight: 600; color: var(--muted);
  background: none; border: 0; cursor: pointer; text-align: left; letter-spacing: .01em;
}
.side-sec h4 button { all: unset; flex: 1; cursor: pointer; }
.side-sec h4 button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 4px; }
.side-sec h4 svg { width: 10px; height: 10px; transition: transform .15s; }
.side-sec.closed h4 svg { transform: rotate(-90deg); }
.side-sec.closed .side-links { display: none; }
.side-links { display: flex; flex-direction: column; gap: 1px; }
.side-links a { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 6px; color: var(--fg); font-size: 13px; line-height: 1.3; }
.side-links a:hover { background: var(--sel); text-decoration: none; }
.side-links a[aria-current="page"] { background: color-mix(in srgb, var(--accent) 16%, transparent); font-weight: 600; }
.side-links a .ver { margin-left: auto; }
.side-links a.planned { color: var(--fg-2); }
.side-admin { border-top: .5px solid var(--sep); padding-top: 12px; }
.side-admin h4 { color: var(--admin); cursor: default; }
.side-admin a svg { width: 15px; height: 15px; color: var(--admin); flex: none; }
.side-brand { display: flex; align-items: center; gap: 9px; padding: 10px; border-top: .5px solid var(--sep); color: var(--fg-2); font-size: 12px; margin-top: auto; }
.side-brand svg { width: 22px; height: 22px; color: var(--fg); }

main { min-width: 0; padding: 28px 36px 56px; }
.admin-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 9px 14px; margin: -8px 0 22px; border-radius: 10px;
  background: var(--admin-bg); color: var(--fg); font-size: 12.5px;
}
.admin-strip b { color: var(--admin); }
.admin-strip .grow { flex: 1; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { appearance: none; -webkit-appearance: none; width: 32px; height: 19px; border-radius: 10px; background: var(--fill-2); position: relative; margin: 0; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked { background: var(--green); }
.switch input:checked::after { transform: translateX(13px); }

/* ---------- article ---------- */
.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 40px; align-items: start; }
.page-grid.no-toc { grid-template-columns: minmax(0, 1fr); }
article { min-width: 0; max-width: 780px; }
.crumbs svg { width: 14px; height: 14px; flex: none; }
.crumbs { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; margin-bottom: 6px; }
.page-head h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.022em; line-height: 1.15; text-wrap: balance; }
.page-head .tools { display: flex; gap: 6px; padding-top: 4px; }
.lead { font-size: 15.5px; color: var(--fg-2); margin: 6px 0 4px; max-width: 68ch; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0 22px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 11px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--fill); color: var(--fg-2);
}
.tag.now { background: var(--ok-bg); color: var(--ok); }
.tag.now::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.planned { background: var(--plan-bg); color: var(--plan); }
.tag.admin { background: var(--admin-bg); color: var(--admin); }
.tag.edited { background: var(--warn-bg); color: var(--warn); }
.ver { font-family: var(--mono); font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 5px; background: var(--plan-bg); color: var(--plan); white-space: nowrap; }
.updated { font-size: 12px; color: var(--muted); }

.prose { font-size: 15px; line-height: 1.65; color: var(--fg); }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 21px; font-weight: 700; letter-spacing: -.012em; margin: 34px 0 10px; padding-top: 4px; scroll-margin-top: 76px; }
.prose h3 { font-size: 16.5px; font-weight: 650; margin: 24px 0 6px; scroll-margin-top: 76px; }
.prose h4 { font-size: 14.5px; margin: 18px 0 4px; }
.prose p { margin: 0 0 14px; max-width: 72ch; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 14px; max-width: 72ch; }
.prose li { margin: 3px 0; }
.prose li > ul, .prose li > ol { margin: 4px 0 2px; }
.prose strong { font-weight: 650; }
.prose code { font-family: var(--mono); font-size: .88em; padding: 1px 5px; border-radius: 5px; background: var(--fill); }
.prose pre { background: var(--sunk); border-radius: 10px; padding: 12px 14px; overflow: auto; box-shadow: inset 0 0 0 .5px var(--edge); }
.prose pre code { background: none; padding: 0; }
.prose blockquote { margin: 0 0 14px; padding: 4px 14px; border-left: 3px solid var(--fill-2); color: var(--fg-2); }
.prose hr { border: 0; height: .5px; background: var(--sep); margin: 26px 0; }
.prose img { max-width: 100%; border-radius: 10px; }
.prose .table-wrap { overflow-x: auto; margin: 0 0 16px; border-radius: 10px; box-shadow: 0 0 0 .5px var(--edge); background: var(--group); }
.prose table { border-collapse: collapse; width: 100%; font-size: 13.5px; line-height: 1.45; }
.prose th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); background: var(--sunk); }
.prose th, .prose td { padding: 8px 12px; border-bottom: .5px solid var(--sep); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.prose a.missing { color: var(--danger); text-decoration: underline dotted; }

.callout { margin: 0 0 16px; padding: 11px 14px 2px; border-radius: 10px; background: var(--sunk); box-shadow: inset 3px 0 0 var(--c, var(--fill-2)); max-width: 72ch; }
.callout > .callout-h { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--c, var(--fg-2)); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .03em; }
.callout > .callout-h svg { width: 15px; height: 15px; }
.callout p, .callout ul, .callout ol { margin-bottom: 10px; }
.callout.tip { --c: var(--ok); background: var(--ok-bg); }
.callout.note { --c: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.callout.warning { --c: var(--warn); background: var(--warn-bg); }
.callout.planned { --c: var(--plan); background: var(--plan-bg); }
.callout.admin { --c: var(--admin); background: var(--admin-bg); }

.toc { position: sticky; top: 76px; font-size: 12.5px; border-left: .5px solid var(--sep); padding-left: 14px; }
.toc h5 { margin: 0 0 8px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.toc a { display: block; color: var(--fg-2); padding: 3px 0; line-height: 1.35; }
.toc a.l3 { padding-left: 12px; font-size: 12px; color: var(--muted); }
.toc a.on { color: var(--accent); font-weight: 600; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 40px; max-width: 780px; }
.pager a { display: block; padding: 12px 14px; border-radius: 10px; background: var(--group); box-shadow: 0 0 0 .5px var(--edge); color: var(--fg); }
.pager a:hover { text-decoration: none; box-shadow: 0 0 0 1.5px var(--accent); }
.pager a small { display: block; color: var(--muted); font-size: 11.5px; }
.pager a b { font-weight: 600; }
.pager a.next { text-align: right; grid-column: 2; }

/* home */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 18px; }
.card { padding: 14px 16px; border-radius: 12px; background: var(--group); box-shadow: 0 0 0 .5px var(--edge); }
.card h3 { margin: 0 0 6px; font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card h3 svg { width: 18px; height: 18px; color: var(--brand); }
.card ul { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.card li { padding: 2px 0; display: flex; align-items: center; gap: 6px; }
.card li .ver { margin-left: auto; }

/* search page */
.search-page h1 { font-size: 26px; margin: 0 0 4px; }
.search-page .hit { padding: 14px 0; border-bottom: .5px solid var(--sep); max-width: 760px; }
.search-page .hit a { font-size: 16px; font-weight: 600; }
.search-page .hit small { display: block; color: var(--muted); font-size: 12px; }
.search-page .hit p { margin: 4px 0 0; color: var(--fg-2); font-size: 13.5px; }

/* empty / errors */
.empty-state { max-width: 520px; margin: 40px auto; text-align: center; color: var(--fg-2); }
.empty-state h1 { font-size: 24px; margin: 0 0 8px; color: var(--fg); }

/* ---------- forms and dialogs ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 600; color: var(--fg-2); }
.field > small { font-size: 11.5px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 32px; border: 0; border-radius: 8px; padding: 6px 10px; background: var(--group);
  box-shadow: inset 0 0 0 .5px var(--edge), 0 1px 1px rgba(0,0,0,.04); font-size: 13.5px; outline: none;
}
.input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent), inset 0 0 0 .5px var(--accent); }
.code-input { font-family: var(--mono); font-size: 22px; letter-spacing: .3em; text-align: center; height: 48px; }

dialog { border: 0; padding: 0; border-radius: 14px; background: var(--window); color: var(--fg); box-shadow: var(--pop); width: min(420px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .35); backdrop-filter: blur(3px); }
dialog form, dialog .dlg { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
dialog h2 { margin: 0; font-size: 18px; }
dialog p { margin: 0; color: var(--fg-2); font-size: 13.5px; }
dialog .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
dialog .err { color: var(--danger); font-size: 12.5px; min-height: 1em; }
.qr { align-self: center; background: #fff; padding: 10px; border-radius: 10px; line-height: 0; }
.qr img { width: 180px; height: 180px; image-rendering: pixelated; }
.secret { font-family: var(--mono); font-size: 12.5px; word-break: break-all; padding: 8px 10px; border-radius: 8px; background: var(--sunk); user-select: all; text-align: center; }
.steps { margin: 0; padding-left: 20px; color: var(--fg-2); font-size: 13px; }
.steps li { margin: 3px 0; }

/* editor */
.editor-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.editor-head h1 { margin: 0; font-size: 22px; }
.editor-head .tools { display: flex; flex-wrap: wrap; gap: 6px; }
.meta-grid { display: grid; grid-template-columns: 2fr 1.4fr 1.3fr .6fr; gap: 12px; margin-bottom: 12px; }
.meta-grid.two { grid-template-columns: 1.4fr .8fr 2fr; }
.ed-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.ed-pane { display: flex; flex-direction: column; min-width: 0; border-radius: 12px; background: var(--group); box-shadow: 0 0 0 .5px var(--edge); overflow: hidden; }
.ed-pane > .ed-tools { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: .5px solid var(--sep); background: var(--sunk); }
.ed-tools button { border: 0; background: transparent; border-radius: 6px; height: 26px; padding: 0 8px; font-size: 12.5px; cursor: pointer; color: var(--fg-2); white-space: nowrap; }
.ed-tools button:hover { background: var(--sel); color: var(--fg); }
.ed-tools .sep { width: .5px; background: var(--sep); margin: 3px 4px; }
.ed-pane textarea { flex: 1; min-height: 560px; border: 0; resize: vertical; padding: 14px 16px; font-family: var(--mono); font-size: 13px; line-height: 1.6; background: var(--group); outline: none; tab-size: 2; }
.ed-pane .preview { padding: 18px 20px; overflow: auto; max-height: 72vh; min-height: 560px; }
.ed-pane .pane-h { font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 8px 14px; border-bottom: .5px solid var(--sep); background: var(--sunk); display: flex; justify-content: space-between; }
.ed-help { font-size: 12px; color: var(--muted); margin-top: 10px; }
.ed-help code { font-family: var(--mono); font-size: 11.5px; background: var(--fill); padding: 0 4px; border-radius: 4px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; padding: 9px 16px; border-radius: 10px;
  background: var(--fg); color: var(--window); font-size: 13px; font-weight: 500; box-shadow: var(--pop); max-width: calc(100vw - 32px);
}
.toast.bad { background: var(--danger); color: #fff; }

/* sections manager */
.sec-list { list-style: none; margin: 0 0 16px; padding: 0; max-width: 560px; border-radius: 12px; background: var(--group); box-shadow: 0 0 0 .5px var(--edge); }
.sec-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; }
.sec-list li + li { border-top: .5px solid var(--sep); }
.sec-list li span { flex: 1; font-weight: 500; }
.sec-list li small { color: var(--muted); font-size: 12px; }

/* ---------- roadmap ---------- */
.rm-hero { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 14px; margin-bottom: 14px; }
.panel { background: var(--group); border-radius: 12px; box-shadow: 0 0 0 .5px var(--edge); }
.rm-state { padding: 20px 22px; }
.rm-state h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.rm-state p { margin: 4px 0 0; color: var(--fg-2); max-width: 64ch; }
.rm-widget { padding: 16px 18px; border-radius: 20px; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; }
.rm-widget .wt { font-size: 12px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .02em; }
.rm-widget .num { font-family: var(--rounded); font-size: 64px; font-weight: 700; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.rm-widget .wl { font-size: 13.5px; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat { padding: 13px 16px; border-radius: 14px; }
.stat .k { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.stat .v { font-family: var(--rounded); font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .d { font-size: 12px; color: var(--muted); }
.bar-prog { height: 6px; border-radius: 3px; background: var(--fill-2); overflow: hidden; margin-top: 6px; }
.bar-prog i { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.rm-sec-h { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px; margin: 26px 0 10px; }
.rm-sec-h h2 { margin: 0; font-size: 20px; }
.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--fill); gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 6px; height: 26px; padding: 0 12px; font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--group); box-shadow: 0 1px 2px rgba(0,0,0,.14), 0 0 0 .5px var(--edge); }
.tl-wrap { overflow-x: auto; }
.tl { min-width: 760px; padding: 14px 18px; }
.tl-months { display: grid; grid-template-columns: repeat(var(--m), minmax(0, 1fr)); font-size: 10.5px; color: var(--muted); margin-bottom: 6px; }
.tl-months span { text-align: center; }
.tl-months span.y { font-weight: 700; color: var(--fg-2); }
.tl-track { position: relative; height: 84px; border-radius: 8px; background: var(--sunk); }
.tl-dot { position: absolute; transform: translateX(-50%); border: 0; padding: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.tl-dot i { width: 11px; height: 11px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.tl-dot span { font-family: var(--mono); font-size: 10px; font-weight: 600; background: var(--group); padding: 0 4px; border-radius: 4px; box-shadow: 0 0 0 .5px var(--edge); }
.tl-now { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--danger); border-radius: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend span::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }

.rel { margin-bottom: 12px; scroll-margin-top: 80px; }
.rel-head { padding: 14px 16px 12px; display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 14px; border-bottom: .5px solid var(--sep); }
.rel-head .l { flex: 1 1 320px; min-width: 0; }
.rel-head .vtag { font-family: var(--mono); font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--fill); }
.rel-head h3 { margin: 0; font-size: 16px; font-weight: 650; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rel-head p { margin: 3px 0 0; color: var(--fg-2); font-size: 13px; }
.rel-head .r { text-align: right; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.rel-head .r b { color: var(--fg); font-size: 13px; }
.chip { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--fg); white-space: nowrap; }
.prog { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.prog i { width: 64px; height: 5px; border-radius: 3px; background: var(--fill-2); overflow: hidden; display: block; }
.prog i b { display: block; height: 100%; background: var(--green); }
.notes { list-style: none; margin: 0; padding: 6px 16px 8px; }
.notes li { display: grid; grid-template-columns: 20px 84px minmax(0, 1fr) auto; gap: 10px; padding: 7px 0; align-items: baseline; }
.notes li + li { border-top: .5px solid var(--sep); }
.notes li.done .txt { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.tick { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 0; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--fill-2); background: var(--group); cursor: pointer; align-self: start; margin-top: 1px; display: grid; place-items: center; }
.tick:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
.tick:checked { background: var(--green); box-shadow: none; }
.tick:checked::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.nk { justify-self: start; }
.note-tools { display: flex; gap: 2px; }
.note-tools button { border: 0; background: transparent; border-radius: 6px; height: 24px; padding: 0 7px; font-size: 12px; color: var(--accent); cursor: pointer; white-space: nowrap; }
.note-tools button:hover { background: var(--sel); }
.prompt { grid-column: 3 / -1; margin: 6px 0 2px; border-radius: 8px; background: var(--sunk); box-shadow: inset 0 0 0 .5px var(--edge); }
.prompt-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 8px 5px 12px; border-bottom: .5px solid var(--sep); font-size: 11.5px; font-weight: 600; color: var(--muted); }
.prompt p { margin: 0; padding: 9px 12px 11px; font-size: 13px; color: var(--fg); user-select: text; }
.why { margin: 0 16px 14px; padding: 9px 12px; border-radius: 8px; background: var(--sunk); font-size: 12.5px; color: var(--fg-2); }
.note-edit { grid-column: 1 / -1; display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px; padding: 6px 0; }
.note-edit textarea { min-height: 60px; resize: vertical; }
.note-edit .full { grid-column: 1 / -1; }
.note-edit .row { grid-column: 1 / -1; display: flex; gap: 6px; justify-content: flex-end; }
.ver-edit { padding: 14px 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; border-bottom: .5px solid var(--sep); background: var(--sunk); }
.ver-edit .wide { grid-column: span 2; }
.ver-edit .full { grid-column: 1 / -1; }
.ver-edit .row { grid-column: 1 / -1; display: flex; gap: 6px; justify-content: flex-end; }
.rm-foot { font-size: 12px; color: var(--muted); margin-top: 18px; }
.rel.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 .5px var(--edge); } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .page-grid { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 980px) {
  .desk { padding: 0; }
  .window { border-radius: 0; min-height: 100vh; }
  .bar { grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 8px; padding-right: 8px; }
  .brand small { display: none; }
  .icon-btn.menu-btn { display: inline-grid; margin-left: 6px; order: -1; }
  .brand { padding-left: 2px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .2s; background: var(--window); box-shadow: var(--pop); padding-top: 18px; }
  .side.open { transform: none; }
  .side-inner { position: static; max-height: none; height: 100%; }
  .scrim { position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .3); }
  main { padding: 22px 16px 48px; }
  .ed-split { grid-template-columns: minmax(0, 1fr); }
  .ed-pane .preview { min-height: 0; max-height: none; }
  .ed-pane textarea { min-height: 380px; }
  .meta-grid, .meta-grid.two { grid-template-columns: 1fr 1fr; }
  .rm-hero { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ver-edit { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .bar { gap: 6px; }
  .brand b { display: none; }
  .search input { padding-right: 10px; }
  .search kbd { display: none; }
  .page-head h1 { font-size: 25px; }
  .notes li { grid-template-columns: 20px minmax(0, 1fr); gap: 4px 10px; }
  .notes li .nk, .notes li .txt, .notes li .note-tools { grid-column: 2; }
  .prompt { grid-column: 1 / -1; }
  .note-edit { grid-template-columns: 1fr; }
  .rel-head .r { text-align: left; align-items: flex-start; }
  .pager { grid-template-columns: 1fr; }
  .pager a.next { grid-column: 1; }
  .meta-grid, .meta-grid.two { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .rel.flash { animation: none; } .side { transition: none; } }
@media print {
  body { background: #fff; }
  .desk { padding: 0; }
  .window { box-shadow: none; }
  .bar, .side, .toc, .admin-strip, .pager, .page-head .tools { display: none !important; }
  .shell { grid-template-columns: 1fr; }
}
main:focus { outline: none; }
