/* DumbSlab web app.
   Cool stone neutrals, one indigo accent, a system serif for titles and system sans for everything else. */

/* ---------------------------------------------------------------------------
   Tokens */

:root {
  --font-ui: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-serif: ui-serif, "New York", "Iowan Old Style", Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #ffffff;
  --bg-side: #f4f4f7;
  --bg-sunk: #f6f6f9;
  --bg-hover: rgb(30 32 70 / 5.5%);
  --bg-press: rgb(30 32 70 / 9%);
  --bg-raised: #ffffff;
  --line: #e5e5ec;
  --line-strong: #d3d3dd;
  --ink: #1c1d24;
  --ink-2: #4a4b57;
  --ink-3: #72737e;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-ink: #4338ca;
  --accent-tint: #eef0ff;
  --accent-line: #c5c7f8;
  --on-accent: #ffffff;
  --green: #11764f;
  --green-tint: #e5f4ec;
  --amber: #965800;
  --amber-tint: #fcf2dc;
  --red: #c02a2a;
  --red-tint: #fdeced;
  --mark-bg: #fff0a3;
  --diff-add: #e6f6ec;
  --diff-add-ink: #0f6a43;
  --diff-del: #fdecec;
  --diff-del-ink: #a72424;
  --shadow-pop: 0 1px 2px rgb(20 20 45 / 6%), 0 12px 32px -8px rgb(20 20 45 / 20%);
  --shadow-dialog: 0 2px 6px rgb(20 20 45 / 8%), 0 24px 60px -12px rgb(20 20 45 / 30%);
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px rgb(79 70 229 / 55%);

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --side-w: 260px;
  --reading: 70ch;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #15161c;
  --bg-side: #1a1b22;
  --bg-sunk: #1d1e26;
  --bg-hover: rgb(200 205 255 / 7%);
  --bg-press: rgb(200 205 255 / 11%);
  --bg-raised: #22232d;
  --line: #2a2b36;
  --line-strong: #3a3b49;
  --ink: #e7e7ee;
  --ink-2: #b4b5c2;
  --ink-3: #888997;
  --accent: #5b55ec;
  --accent-hover: #6a65f2;
  --accent-ink: #a9abff;
  --accent-tint: #24254a;
  --accent-line: #43458f;
  --green: #4cc793;
  --green-tint: #142d24;
  --amber: #e7aa4f;
  --amber-tint: #33270f;
  --red: #f27777;
  --red-tint: #3a1b1e;
  --mark-bg: #5a4a10;
  --diff-add: #13291f;
  --diff-add-ink: #7fdcae;
  --diff-del: #34191b;
  --diff-del-ink: #f5a0a0;
  --shadow-pop: 0 1px 2px rgb(0 0 0 / 30%), 0 14px 36px -8px rgb(0 0 0 / 55%);
  --shadow-dialog: 0 2px 6px rgb(0 0 0 / 30%), 0 28px 70px -12px rgb(0 0 0 / 65%);
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px rgb(140 140 255 / 70%);
  color-scheme: dark;
}

/* ---------------------------------------------------------------------------
   Base */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
img, svg { vertical-align: middle; }
.icon { flex: none; }
code, pre, kbd { font-family: var(--font-mono); }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }

::selection { background: rgb(79 70 229 / 22%); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: var(--r-sm);
}
.skip-link:focus { top: 12px; text-decoration: none; }

.noscript { padding: 40px; text-align: center; }

.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; }
.gap-xs { gap: 6px; }
.gap-sm { gap: 10px; }
.gap-md { gap: 16px; }
.wrap { flex-wrap: wrap; }
.center { justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-top { align-items: start; }
.text-danger { color: var(--red) !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Boot screen */
.root { min-height: 100vh; }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot img { animation: boot 1.2s ease-in-out infinite alternate; }
@keyframes boot { from { opacity: .35; transform: translateY(2px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------------------
   Buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--bg-raised); color: var(--ink);
  font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap;
  text-decoration: none !important;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--bg-sunk); }
.btn:active { background: var(--bg-press); }
.btn:disabled { opacity: .55; }
.btn[aria-busy="true"] { cursor: progress; opacity: .7; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:active { background: var(--accent-hover); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red); filter: brightness(.95); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--ink); }
.btn-ghost:active { background: var(--bg-press); }
.btn-subtle { background: var(--bg-sunk); border-color: var(--line); color: var(--ink); }
.btn-subtle:hover { background: var(--bg-hover); border-color: var(--line-strong); }
.btn-link { background: none; border: 0; color: var(--accent-ink); padding: 0 4px; height: auto; }
.btn-link:hover { text-decoration: underline; background: none; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 13px; gap: 6px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12.5px; gap: 5px; }
.btn-icon { width: 34px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn-xs.btn-icon { width: 26px; }
.btn-block { width: 100%; }
.btn[aria-pressed="true"] { color: var(--accent-ink); }

kbd, .kbds kbd {
  display: inline-block; min-width: 1.6em; padding: 1px 5px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px;
  background: var(--bg-raised); color: var(--ink-2);
  font: 500 11px/1.4 var(--font-ui); text-align: center;
}
.kbds { display: inline-flex; gap: 3px; }

/* ---------------------------------------------------------------------------
   Forms */

.input {
  display: block; width: 100%; height: 36px; padding: 0 11px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--bg); color: var(--ink); font-size: 14px;
  transition: border-color .12s, box-shadow .12s;
}
.input::placeholder { color: var(--ink-3); opacity: .85; }
.input:hover { border-color: var(--ink-3); }
.input:focus, .input:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(79 70 229 / 18%); border-radius: var(--r-sm); }
.input:disabled { opacity: .6; }
.textarea { height: auto; min-height: 72px; padding: 9px 11px; line-height: 1.55; resize: vertical; }
.select { padding-right: 30px; appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.input-sm { height: 30px; font-size: 13px; padding: 0 9px; }
.select.input-sm { padding-right: 28px; width: auto; }
.input-lg { height: 44px; font-size: 16px; }
.input-icon { width: 64px; text-align: center; font-size: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field-hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; user-select: none; }
.check input, input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.form-error { display: flex; align-items: flex-start; gap: 8px; color: var(--red); font-size: 13.5px; line-height: 1.45; }
.form-error .icon { margin-top: 2px; }

.callout {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 12px; border-radius: var(--r-md);
  background: var(--accent-tint); color: var(--ink-2); font-size: 13.5px; line-height: 1.5;
}
.callout .icon { margin-top: 2px; color: var(--accent-ink); }
.callout-warn { background: var(--amber-tint); color: var(--ink); }
.callout-warn .icon { color: var(--amber); }

/* Switch */
.switch-wrap { position: relative; display: inline-flex; width: 34px; height: 20px; flex: none; cursor: pointer; }
.switch-wrap .switch { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-ui { width: 34px; height: 20px; border-radius: 999px; background: var(--line-strong); transition: background .15s; position: relative; }
.switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 25%); transition: transform .15s; }
.switch:checked + .switch-ui { background: var(--accent); }
.switch:checked + .switch-ui::after { transform: translateX(14px); }
.switch:focus-visible + .switch-ui { box-shadow: var(--focus-ring); }

/* ---------------------------------------------------------------------------
   Badges, chips, avatars */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 7px; border-radius: 999px;
  background: var(--bg-sunk); color: var(--ink-2); border: 1px solid var(--line);
  font-size: 11.5px; font-weight: 600; line-height: 1; white-space: nowrap; vertical-align: middle;
}
.badge-draft { background: var(--amber-tint); color: var(--amber); border-color: transparent; }
.badge-published { background: var(--green-tint); color: var(--green); border-color: transparent; }
.badge-archived { background: var(--bg-sunk); color: var(--ink-3); }
.badge-trash { background: var(--red-tint); color: var(--red); border-color: transparent; }
.badge-template { background: var(--accent-tint); color: var(--accent-ink); border-color: transparent; }
.badge-verified, .badge-resolved { background: var(--green-tint); color: var(--green); border-color: transparent; }
.badge-expired { background: var(--amber-tint); color: var(--amber); border-color: transparent; }
.badge-unverified { color: var(--ink-3); }
.badge-bot { background: var(--accent-tint); color: var(--accent-ink); border-color: transparent; }
.badge-private { color: var(--ink-2); }
.badge-current { background: var(--accent-tint); color: var(--accent-ink); border-color: transparent; margin-left: 6px; }
.badge-role, .badge-scope { text-transform: capitalize; }
.badge-oauth { background: var(--accent-tint); color: var(--accent-ink); border-color: transparent; }
.badge-via-web { color: var(--ink-3); }
.badge-via-api { background: #e8f1fb; color: #1d5f9e; border-color: transparent; }
.badge-via-mcp { background: var(--accent-tint); color: var(--accent-ink); border-color: transparent; }
.badge-via-cli { background: #eef4e6; color: #4b6b1f; border-color: transparent; }
:root[data-theme="dark"] .badge-via-api { background: #172a3f; color: #8cc1f2; }
:root[data-theme="dark"] .badge-via-cli { background: #1f2a14; color: #b5d68a; }

.chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px 0 7px; border-radius: 999px;
  background: var(--bg-sunk); border: 1px solid var(--line); color: var(--ink-2);
  font-size: 12.5px; font-weight: 500; white-space: nowrap; max-width: 220px;
}
.chip > span:not(.topic-icon) { overflow: hidden; text-overflow: ellipsis; }
a.chip:hover { background: var(--bg-hover); color: var(--ink); text-decoration: none; }
.chip-static { height: 20px; font-size: 11.5px; padding: 0 7px; }
.chip-removable { padding-right: 3px; }
.chip-remove { display: inline-grid; place-items: center; width: 18px; height: 18px; border: 0; border-radius: 50%; background: none; color: var(--ink-3); padding: 0; }
.chip-remove:hover { background: var(--bg-press); color: var(--ink); }

.topic-icon { display: inline-grid; place-items: center; flex: none; line-height: 1; }
.topic-icon-xs { width: 14px; height: 14px; font-size: 12px; }
.topic-icon-sm { width: 18px; height: 18px; font-size: 14px; }
.topic-icon-md { width: 28px; height: 28px; font-size: 20px; }
.topic-icon-lg { width: 40px; height: 40px; font-size: 30px; }
.topic-dot::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--c, var(--ink-3)); }
.topic-icon-md.topic-dot::before { width: 12px; height: 12px; border-radius: 4px; }
.topic-icon-lg.topic-dot::before { width: 18px; height: 18px; border-radius: 5px; }

.avatar {
  --h: 230;
  display: inline-grid; place-items: center; flex: none; overflow: hidden; position: relative;
  border-radius: 50%; background: hsl(var(--h) 52% 91%); color: hsl(var(--h) 42% 30%);
  font-weight: 650; letter-spacing: .01em; user-select: none;
}
:root[data-theme="dark"] .avatar { background: hsl(var(--h) 28% 26%); color: hsl(var(--h) 60% 84%); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { width: 20px; height: 20px; font-size: 9px; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-md { width: 36px; height: 36px; font-size: 13px; }
.avatar-lg { width: 48px; height: 48px; font-size: 17px; }
.avatar-xl { width: 76px; height: 76px; font-size: 26px; }
.avatar-bot { border-radius: 28%; }
.avatar-icon { background: var(--bg-sunk); color: var(--ink-3); border: 1px solid var(--line); }

.user-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 500; min-width: 0; }
.user-link:hover { text-decoration: none; }
.user-link:hover .user-link-name { text-decoration: underline; text-underline-offset: 2px; }
.user-link .badge { height: 17px; font-size: 10.5px; padding: 0 5px; }

/* ---------------------------------------------------------------------------
   App shell */

.app { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; width: var(--side-w); flex: none;
  display: flex; flex-direction: column;
  background: var(--bg-side); border-right: 1px solid var(--line);
  z-index: 30;
}
.side-top { padding: 14px 12px 10px; display: flex; flex-direction: column; gap: 10px; }
.ws { display: flex; align-items: center; gap: 9px; padding: 4px 6px; border-radius: var(--r-sm); color: var(--ink); font-weight: 650; font-size: 15px; min-width: 0; }
.ws:hover { text-decoration: none; background: var(--bg-hover); }
.ws-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.new-post { height: 34px; }
.search-trigger {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 8px 0 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); color: var(--ink-3);
  font-size: 13.5px; text-align: left;
}
.search-trigger:hover { border-color: var(--line-strong); color: var(--ink-2); }
.search-trigger-label { flex: 1; }

.side-scroll { flex: 1; overflow-y: auto; padding: 4px 12px 12px; overscroll-behavior: contain; }
.nav-group { display: flex; flex-direction: column; gap: 1px; padding: 6px 0; }
.nav-group + .nav-group { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: 14px; font-weight: 500;
}
.nav-link:hover { background: var(--bg-hover); color: var(--ink); text-decoration: none; }
.nav-link[aria-current="page"] { background: var(--accent-tint); color: var(--accent-ink); }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.nav-group-quiet .nav-link { height: 29px; font-size: 13.5px; color: var(--ink-3); }

.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 4px 8px; }
.side-head-link { font-size: 12.5px; font-weight: 600; color: var(--ink-3); letter-spacing: .01em; }
.side-head-link:hover, .side-head-link[aria-current="page"] { color: var(--ink); text-decoration: none; }

.tree { list-style: none; }
.tree .tree { margin: 0; }
.tree-row { display: flex; align-items: center; padding-left: calc(var(--depth) * 14px); }
.tree-toggle {
  width: 20px; height: 28px; flex: none; display: inline-grid; place-items: center;
  border: 0; background: none; color: var(--ink-3); padding: 0; border-radius: 4px;
}
.tree-toggle:hover { color: var(--ink); background: var(--bg-hover); }
.tree-toggle .icon { transition: transform .15s; }
.tree-item[aria-expanded="true"] > .tree-row .tree-toggle .icon { transform: rotate(90deg); }
.tree-toggle-empty { pointer-events: none; }
.tree-link {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px 0 4px;
  border-radius: var(--r-sm); color: var(--ink-2); font-size: 13.5px; font-weight: 500;
}
.tree-link:hover { background: var(--bg-hover); color: var(--ink); text-decoration: none; }
.tree-link[aria-current="page"] { background: var(--accent-tint); color: var(--accent-ink); }
.tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-lock { color: var(--ink-3); }
.tree-empty { padding: 4px 8px; color: var(--ink-3); font-size: 13px; line-height: 1.45; }

.side-bottom { border-top: 1px solid var(--line); padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.account {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px;
  border: 0; border-radius: var(--r-sm); background: none; text-align: left;
}
.account:hover, .account[aria-expanded="true"] { background: var(--bg-hover); }
.account-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.account-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-handle { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-more { color: var(--ink-3); }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main { flex: 1; outline: none; }
.main:focus-visible { box-shadow: none; }
.topbar { display: none; }
.backdrop { position: fixed; inset: 0; background: rgb(10 10 25 / 38%); z-index: 25; }

@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: auto;
    transform: translateX(-102%); transition: transform .22s ease, visibility .22s;
    width: min(300px, 86vw); visibility: hidden;
  }
  body.drawer-open .sidebar { transform: none; visibility: visible; box-shadow: var(--shadow-dialog); }
  .search-trigger .kbds { display: none; }
  body.drawer-open { overflow: hidden; }
  .topbar {
    display: flex; align-items: center; gap: 4px; position: sticky; top: 0; z-index: 20;
    height: 52px; padding: 0 8px; background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .ws-top { flex: 1; font-size: 15px; }
}

/* ---------------------------------------------------------------------------
   Pages */

.page { margin: 0 auto; padding: 40px 48px 96px; }
.page-narrow { max-width: 620px; padding-top: 72px; }
.page-medium { max-width: 920px; }
.page-wide { max-width: 1240px; }
.page-post { max-width: 1180px; padding-top: 32px; }
.page-home { max-width: 1120px; }
.page-settings { max-width: 1120px; }
.page-editor { max-width: 1520px; padding: 0 32px 40px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; max-width: 64ch; }
.page-title { font-family: var(--font-serif); font-size: 31px; font-weight: 600; line-height: 1.15; letter-spacing: -.012em; color: var(--ink); }
.page-desc { color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-3); margin-bottom: 4px; }
.back-link:hover { color: var(--ink); }

.section { margin-top: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-title { font-size: 15px; font-weight: 650; color: var(--ink); letter-spacing: -.003em; }
.section-link { font-size: 13px; }

.load-more { display: flex; justify-content: center; padding: 16px 0 0; }
.load-more:empty { display: none; }
.inline-loading { display: flex; justify-content: center; padding: 32px 0; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 48px 24px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
.empty-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--bg-sunk); color: var(--ink-3); margin-bottom: 4px; }
.empty-title { font-size: 16px; font-weight: 650; }
.empty-body { color: var(--ink-3); max-width: 46ch; line-height: 1.55; }
.empty > .btn, .empty > .row { margin-top: 10px; }

.spinner { display: inline-block; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-loading { max-width: 760px; display: flex; flex-direction: column; gap: 14px; }
.skeleton { border-radius: 6px; background: linear-gradient(90deg, var(--bg-sunk), var(--bg-hover), var(--bg-sunk)); background-size: 200% 100%; animation: shimmer 1.4s ease infinite; }
.skeleton-title { height: 34px; width: 55%; margin-bottom: 14px; }
.skeleton-line { height: 14px; width: 92%; }
.skeleton-line.short { width: 64%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: var(--r-md); margin-bottom: 18px;
  background: var(--amber-tint); color: var(--ink); font-size: 13.5px;
}
.banner > .icon { color: var(--amber); }
.banner > span { flex: 1; min-width: 200px; }
.banner-muted { background: var(--bg-sunk); }
.banner-muted > .icon { color: var(--ink-3); }
.banner-danger { background: var(--red-tint); }
.banner-danger > .icon { color: var(--red); }
.banner-actions { display: flex; gap: 8px; }

.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-md); background: var(--bg-sunk); border: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.seg { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.seg:hover { color: var(--ink); text-decoration: none; }
.seg[aria-selected="true"], .seg[aria-checked="true"] { background: var(--bg-raised); color: var(--ink); box-shadow: 0 1px 2px rgb(20 20 45 / 10%), 0 0 0 1px var(--line); }

/* ---------------------------------------------------------------------------
   Post lists */

.post-list { list-style: none; border-top: 1px solid var(--line); }
.post-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.post-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.post-row-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post-row-title { font-size: 15.5px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.post-row-title:hover { color: var(--accent-ink); }
.post-row-excerpt { color: var(--ink-2); font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 78ch; }
.post-row-meta { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.post-row-meta .user-link { font-size: 12.5px; color: var(--ink-2); }
.post-row-actions { flex: none; display: flex; align-items: center; gap: 4px; padding-top: 1px; }
.meta-item { display: inline-flex; align-items: center; gap: 5px; }
.pin-mark { color: var(--accent-ink); display: inline-flex; }

.compact-list { list-style: none; display: flex; flex-direction: column; gap: 1px; }
.compact-link { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: var(--r-sm); color: var(--ink-2); font-size: 13.5px; }
.compact-link .icon { color: var(--ink-3); }
.compact-link:hover { background: var(--bg-hover); color: var(--ink); text-decoration: none; }
.compact-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------------------
   Home */

.home-head { margin-bottom: 22px; display: flex; flex-direction: column; gap: 6px; }
.home-title { font-size: 34px; }
.welcome { border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; margin: 0 0 8px; max-width: 72ch; }
.welcome-text { white-space: pre-line; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; }
.home-side .section-title { font-size: 13.5px; color: var(--ink-2); }
.home-main .chips { margin-bottom: 12px; }

/* ---------------------------------------------------------------------------
   Auth */

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: var(--bg-side); }
.auth-card { width: 100%; max-width: 400px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 36px 32px 28px; box-shadow: var(--shadow-pop); outline: none; }
.auth-mark { display: block; margin-bottom: 20px; }
.auth-title { font-family: var(--font-serif); font-size: 26px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.auth-sub { color: var(--ink-2); margin-top: 8px; line-height: 1.55; }
.auth-form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.auth-form .btn { height: 38px; margin-top: 4px; }
.auth-foot { margin-top: 20px; font-size: 12.5px; color: var(--ink-3); text-align: center; }

/* ---------------------------------------------------------------------------
   Toasts */

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 420px;
  padding: 8px 6px 8px 14px; border-radius: 10px;
  background: #1f2029; color: #f1f1f6; box-shadow: var(--shadow-pop); font-size: 13.5px;
  animation: toast-in .2s ease;
}
:root[data-theme="dark"] .toast { background: #2c2d39; border: 1px solid var(--line-strong); }
.toast > .icon { color: #8de0b6; }
.toast-error > .icon { color: #ff9b9b; }
.toast-info > .icon { color: #b8baff; }
.toast-msg { flex: 1; line-height: 1.4; }
.toast .btn-link { color: #c3c4ff; font-weight: 600; }
.toast .btn-ghost { color: #a9aab8; }
.toast .btn-ghost:hover { background: rgb(255 255 255 / 10%); color: #fff; }
.toast-out { opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------------------
   Dialogs, popovers, menus */

dialog { color: var(--ink); }
.modal {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line);
  border-radius: 14px; background: var(--bg-raised); box-shadow: var(--shadow-dialog); overflow: hidden;
}
.modal-sm { width: min(420px, calc(100vw - 32px)); }
.modal::backdrop, .palette::backdrop { background: rgb(12 12 30 / 40%); }
.modal[open] { animation: pop .16s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-form { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 4px; }
.modal-title { font-size: 17px; font-weight: 650; letter-spacing: -.005em; }
.modal-body { padding: 12px 20px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-text { color: var(--ink-2); line-height: 1.55; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; }

.popover {
  position: absolute; z-index: 150; min-width: 180px; max-width: min(380px, calc(100vw - 16px));
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop);
  animation: pop .12s ease;
}
.menu { padding: 5px; display: flex; flex-direction: column; min-width: 210px; }
.menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 32px; padding: 5px 10px 5px 8px;
  border: 0; border-radius: 6px; background: none; color: var(--ink); text-align: left; font-size: 13.5px;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--bg-hover); box-shadow: none; }
.menu-item:disabled { opacity: .5; }
.menu-item-danger { color: var(--red); }
.menu-icon { width: 16px; display: inline-grid; place-items: center; color: var(--ink-3); flex: none; }
.menu-item-danger .menu-icon { color: var(--red); }
.menu-item[aria-checked="true"] .menu-icon { color: var(--accent-ink); }
.menu-label { flex: 1; }
.menu-hint { color: var(--ink-3); font-size: 12px; }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu-heading { padding: 7px 10px 4px; font-size: 12px; color: var(--ink-3); font-weight: 600; line-height: 1.4; max-width: 300px; }

.emoji-grid { display: grid; grid-template-columns: repeat(4, 38px); gap: 4px; padding: 6px; }
.emoji-btn { width: 38px; height: 36px; border: 0; border-radius: 8px; background: none; font-size: 19px; display: grid; place-items: center; padding: 0; }
.emoji-btn:hover { background: var(--bg-hover); }
.emoji-btn.is-on { background: var(--accent-tint); }
.popover-emoji { min-width: 0; }

.picker { display: flex; flex-direction: column; gap: 6px; padding: 8px; width: 300px; max-width: 100%; }
.picker-list { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.picker-item {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 4px 8px 4px calc(8px + var(--depth, 0) * 14px);
  border: 0; border-radius: 6px; background: none; text-align: left; font-size: 13.5px;
}
.picker-item:hover, .picker-item:focus-visible { background: var(--bg-hover); box-shadow: none; }
.picker-check { width: 14px; display: inline-grid; place-items: center; color: var(--accent-ink); }
.picker-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-empty { color: var(--ink-3); font-size: 13px; padding: 8px; }
.picker-create { justify-content: flex-start; border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; margin-top: 2px; }

.copy-field { display: flex; align-items: center; gap: 8px; padding: 5px 5px 5px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--bg-sunk); min-width: 0; }
.copy-value { flex: 1; min-width: 0; font-size: 13px; overflow-x: auto; white-space: nowrap; color: var(--ink); }
.copy-pre { margin: 0; white-space: pre; }

.shortcuts { display: flex; flex-direction: column; }
.shortcut { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.shortcut:last-child { border-bottom: 0; }

/* ---------------------------------------------------------------------------
   Command palette and search */

.palette {
  width: min(640px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 80px)); margin-top: 12vh; padding: 0;
  border: 1px solid var(--line); border-radius: 14px; background: var(--bg-raised); box-shadow: var(--shadow-dialog); overflow: hidden;
}
.palette[open] { animation: pop .14s ease; }
.palette-box { display: flex; flex-direction: column; max-height: inherit; }
.palette-field { display: flex; align-items: center; gap: 10px; padding: 0 14px 0 16px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.palette-input { flex: 1; height: 54px; border: 0; background: none; font-size: 16.5px; color: var(--ink); min-width: 0; }
.palette-input:focus, .palette-input:focus-visible { box-shadow: none; }
.palette-input::placeholder { color: var(--ink-3); }
.palette-hint { padding: 8px 16px; font-size: 12.5px; color: var(--ink-2); background: var(--accent-tint); }
.palette-list { flex: 1; overflow-y: auto; padding: 6px; min-height: 60px; }
.palette-group { padding: 10px 10px 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.palette-item { display: flex; align-items: flex-start; gap: 11px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.palette-item[aria-selected="true"] { background: var(--accent-tint); }
.palette-item[aria-selected="true"] .palette-kind { color: var(--accent-ink); }
.palette-kind { width: 18px; padding-top: 1px; color: var(--ink-3); flex: none; display: inline-grid; place-items: center; }
.palette-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.palette-title { display: flex; align-items: center; gap: 6px; font-weight: 550; font-size: 14px; color: var(--ink); min-width: 0; }
.palette-title > span:not(.badge):not(.palette-sub) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-sub { color: var(--ink-3); font-weight: 400; }
.palette-snippet { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.palette-topics { display: flex; gap: 4px; flex: none; padding-top: 1px; }
.palette-empty { padding: 28px 16px; text-align: center; color: var(--ink-3); }
.palette-foot { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--line); background: var(--bg-sunk); font-size: 12px; color: var(--ink-3); }
.palette-foot kbd { font-size: 10.5px; }
mark { background: var(--mark-bg); color: inherit; border-radius: 3px; padding: 0 1px; }

.search-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.search-form-row { display: flex; align-items: center; gap: 10px; position: relative; }
.search-form-row > .icon { position: absolute; left: 14px; color: var(--ink-3); pointer-events: none; }
.search-form-row .input { padding-left: 42px; }
.search-form-row .btn { height: 44px; }
.search-filters { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.search-filters .select { width: auto; height: 32px; font-size: 13px; }
.search-results > .callout { margin-bottom: 14px; }
.hit-list { list-style: none; border-top: 1px solid var(--line); }
.hit { display: flex; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.hit-kind { color: var(--ink-3); padding-top: 2px; }
.hit-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.hit-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hit-title { font-weight: 600; font-size: 15.5px; color: var(--ink); }
.hit-title:hover { color: var(--accent-ink); }
.hit-snippet { color: var(--ink-2); line-height: 1.55; max-width: 80ch; }

/* ---------------------------------------------------------------------------
   Post */

.post-layout { display: block; }
.post { min-width: 0; max-width: var(--reading); }
.post-layout:not(.with-toc) .post { margin: 0 auto; }
.post-head { margin-bottom: 30px; }
.post-crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; min-height: 24px; }
.post-title-row { display: flex; align-items: flex-start; gap: 16px; }
.post-title {
  flex: 1; min-width: 0;
  font-family: var(--font-serif); font-size: clamp(30px, 3.4vw, 42px); font-weight: 600;
  line-height: 1.12; letter-spacing: -.016em; color: var(--ink); overflow-wrap: anywhere;
}
.post-actions { display: flex; align-items: center; gap: 4px; flex: none; padding-top: 8px; }
.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; padding-bottom: 20px; border-bottom: 1px solid var(--line); color: var(--ink-3); font-size: 13px; }
.post-meta .user-link { color: var(--ink); }
.meta-link { color: var(--ink-3); }
.meta-link:hover { color: var(--ink); text-decoration: none; }

.verify-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px 0 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); font-size: 12.5px; font-weight: 600; color: var(--ink-3);
}
.verify-btn:hover { background: var(--bg-hover); color: var(--ink); }
.verify-verified { background: var(--green-tint); color: var(--green); border-color: transparent; }
.verify-verified:hover { background: var(--green-tint); color: var(--green); filter: brightness(.97); }
.verify-expired { background: var(--amber-tint); color: var(--amber); border-color: transparent; }
.verify-expired:hover { background: var(--amber-tint); color: var(--amber); filter: brightness(.97); }

.post-reactions { margin-top: 32px; }
.reactions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.reaction {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); font-size: 13px; color: var(--ink-2);
}
.reaction:hover { border-color: var(--line-strong); background: var(--bg-sunk); }
.reaction[aria-pressed="true"] { background: var(--accent-tint); border-color: var(--accent-line); color: var(--accent-ink); }
.reaction-emoji { font-size: 15px; line-height: 1; }
.reaction-count { font-weight: 600; font-variant-numeric: tabular-nums; }
.reactions-compact .reaction { height: 24px; padding: 0 7px; font-size: 12px; }
.reactions-compact .reaction-emoji { font-size: 13px; }
.reaction-add { color: var(--ink-3); border-radius: 999px; }

.backlinks { margin-top: 40px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--bg-sunk); }
.backlinks-title { font-size: 13px; font-weight: 650; color: var(--ink-2); margin-bottom: 8px; }
.backlink-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.backlink-list li { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 14px; }

.toc { position: sticky; top: 28px; align-self: start; max-height: calc(100vh - 56px); overflow-y: auto; padding: 4px 0 4px 2px; }
.toc-title { font-size: 12.5px; font-weight: 650; color: var(--ink-3); margin-bottom: 10px; padding-left: 12px; }
.toc-list { list-style: none; display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.toc-item a {
  display: block; padding: 4px 8px 4px calc(12px + var(--lvl, 0) * 12px); margin-left: -1px; border-left: 2px solid transparent;
  font-size: 13px; line-height: 1.4; color: var(--ink-3);
}
.toc-item a:hover { color: var(--ink); text-decoration: none; }
.toc-item a[aria-current="location"] { color: var(--accent-ink); border-left-color: var(--accent); font-weight: 550; }
.toc-inline { display: none; margin: -8px 0 24px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 12px; }
.toc-inline summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.toc-inline .toc-list { margin-top: 8px; }

@media (min-width: 1240px) {
  .post-layout.with-toc { display: grid; grid-template-columns: minmax(0, var(--reading)) 220px; gap: 64px; justify-content: center; }
}
@media (max-width: 1239px) {
  .post-layout .toc { display: none; }
  .toc-inline { display: block; }
  .post { margin: 0 auto; }
}

/* Inline comments */
.quote-mark { background: rgb(250 204 21 / 28%); border-bottom: 2px solid rgb(234 179 8 / 70%); border-radius: 2px; padding: 0; cursor: pointer; }
:root[data-theme="dark"] .quote-mark { background: rgb(250 204 21 / 16%); }
.quote-mark:hover { background: rgb(250 204 21 / 45%); }
.float-comment {
  position: absolute; z-index: 60; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 0; border-radius: 8px; background: #1f2029; color: #fff; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-pop);
}
:root[data-theme="dark"] .float-comment { background: var(--accent); }
.float-comment:hover { background: var(--accent); }
.popover-composer { width: min(400px, calc(100vw - 16px)); max-width: none; }
.inline-composer { padding: 12px; display: flex; flex-direction: column; gap: 10px; }

/* ---------------------------------------------------------------------------
   Prose (rendered Markdown) */

.prose { font-size: 17px; line-height: 1.72; color: var(--ink); overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table, .prose details, .prose dl { margin: 0 0 1.05em; }
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { position: relative; scroll-margin-top: 72px; color: var(--ink); }
.prose h1 { font-family: var(--font-serif); font-size: 1.75em; font-weight: 600; line-height: 1.2; letter-spacing: -.012em; margin: 1.7em 0 .55em; }
.prose h2 { font-family: var(--font-serif); font-size: 1.4em; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; margin: 1.75em 0 .5em; }
.prose h3 { font-size: 1.1em; font-weight: 650; line-height: 1.35; margin: 1.6em 0 .45em; }
.prose h4, .prose h5, .prose h6 { font-size: 1em; font-weight: 650; margin: 1.4em 0 .4em; }
.prose a { color: var(--accent-ink); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose strong { font-weight: 650; }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose li { margin: .28em 0; }
.prose li > ul, .prose li > ol { margin: .25em 0; }
.prose li::marker { color: var(--ink-3); }
.prose li:has(> input[type="checkbox"]) { list-style: none; margin-left: -1.35em; }
.prose li > input[type="checkbox"] { margin: 0 .55em 0 0; vertical-align: -.1em; width: 15px; height: 15px; }
.prose blockquote { margin-left: 0; padding: .1em 0 .1em 1.1em; border-left: 3px solid var(--accent-line); color: var(--ink-2); }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose code { font-size: .86em; padding: .15em .38em; border-radius: 5px; background: var(--bg-sunk); border: 1px solid var(--line); }
.prose pre { padding: 14px 18px; border-radius: 10px; background: var(--bg-sunk); border: 1px solid var(--line); overflow-x: auto; font-size: 13.5px; line-height: 1.6; tab-size: 4; }
.prose pre code { padding: 0; border: 0; background: none; font-size: inherit; }
.prose table { display: block; width: max-content; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.prose th, .prose td { padding: 8px 14px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--bg-sunk); font-weight: 600; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.2em 0; }
.prose img { max-width: 100%; height: auto; border-radius: 8px; }
.prose kbd { font-size: .78em; }
.prose .mention { text-decoration: none; background: var(--accent-tint); padding: 0 .3em; border-radius: 5px; font-weight: 550; }
.prose .mention:hover { text-decoration: underline; }
.prose .footnote-definition { font-size: .9em; color: var(--ink-2); display: flex; gap: .5em; }
.prose .footnote-definition p { margin: 0; }
.prose sup { line-height: 0; }
.prose details { border: 1px solid var(--line); border-radius: 8px; padding: .5em .9em; }
.prose summary { cursor: pointer; font-weight: 600; }

.heading-anchor {
  position: absolute; left: -1.1em; top: 0; width: 1em; text-align: center;
  color: var(--ink-3) !important; text-decoration: none !important; font-family: var(--font-ui); font-weight: 400;
  opacity: 0; transition: opacity .12s;
}
.prose h1:hover .heading-anchor, .prose h2:hover .heading-anchor, .prose h3:hover .heading-anchor, .prose h4:hover .heading-anchor, .heading-anchor:focus-visible { opacity: 1; }

.prose-comment { font-size: 14.5px; line-height: 1.6; }
.prose-comment p, .prose-comment ul, .prose-comment ol, .prose-comment pre, .prose-comment blockquote { margin-bottom: .6em; }
.prose-comment > :last-child { margin-bottom: 0; }
.prose-comment h1, .prose-comment h2, .prose-comment h3 { font-size: 1.05em; font-family: var(--font-ui); margin: .8em 0 .3em; }
.prose-comment pre { font-size: 12.5px; padding: 10px 12px; }

/* ---------------------------------------------------------------------------
   Comments */

.comments { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.comments-title { font-size: 17px; font-weight: 650; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.comments-title .count { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.comments-title .count:empty { display: none; }
.comment-list { display: flex; flex-direction: column; gap: 6px; }
.comments-empty { padding: 4px 0 12px; font-size: 14px; }
.comment { display: flex; gap: 12px; padding: 12px; margin: 0 -12px; border-radius: var(--r-lg); scroll-margin-top: 80px; }
.comment.is-resolved > .comment-main > .comment-body, .comment.is-resolved > .comment-main > .comment-quote { opacity: .72; }
.comment.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 35% { background: var(--accent-tint); } 100% { background: transparent; } }
.comment-avatar { padding-top: 1px; }
.comment-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.comment-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; min-height: 26px; }
.comment-head .user-link { font-weight: 600; }
.comment-time { color: var(--ink-3); font-size: 12.5px; }
.comment-time:hover { color: var(--ink); }
.comment-quote {
  margin: 2px 0; padding: 6px 12px; border-left: 3px solid rgb(234 179 8 / 75%); border-radius: 0 6px 6px 0;
  background: rgb(250 204 21 / 10%); color: var(--ink-2); font-size: 13.5px; line-height: 1.5; white-space: pre-line;
  font-family: var(--font-serif); font-style: italic;
}
.comment-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.comment-actions .reactions { margin-right: 4px; }
.comment-actions .btn-ghost { color: var(--ink-3); }
.comment-actions .btn-ghost:hover { color: var(--ink); }
.comment-replies { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; padding-left: 4px; border-left: 2px solid var(--line); }
.comment-replies .comment { margin: 0; padding: 8px 8px 8px 12px; }
.resolved-box { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.resolved-box > .btn { align-self: flex-start; }
.resolved-list { padding-left: 0; }

.composer { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.composer .textarea { min-height: 44px; resize: none; font-size: 14.5px; overflow-y: auto; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.composer-hint { font-size: 12px; color: var(--ink-3); }
.composer-main { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; }
.composer-reply { margin-top: 6px; }

/* ---------------------------------------------------------------------------
   Editor */

.page-editor { display: flex; flex-direction: column; min-height: 100vh; }
.editor-bar {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 0; background: var(--bg); border-bottom: 1px solid var(--line); margin-bottom: 20px;
}
.save-state { font-size: 12.5px; color: var(--ink-3); }
.save-state.is-dirty { color: var(--amber); }
.editor-actions { display: flex; align-items: center; gap: 8px; }
.editor-head { max-width: 1100px; width: 100%; margin: 0 auto 14px; display: flex; flex-direction: column; gap: 12px; }
.editor-title {
  width: 100%; border: 0; background: none; padding: 4px 0;
  font-family: var(--font-serif); font-size: clamp(28px, 3vw, 38px); font-weight: 600; line-height: 1.15; letter-spacing: -.014em; color: var(--ink);
}
.editor-title::placeholder { color: var(--ink-3); opacity: .55; }
.editor-title:focus-visible { box-shadow: none; }
.editor-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topic-picker { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.template-pick { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); }
.template-pick .select { width: auto; max-width: 220px; }

.tabs { display: none; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 auto 0; width: 100%; max-width: 1100px; }
.tab { height: 36px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ink-3); font-weight: 600; font-size: 13.5px; margin-bottom: -1px; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

.editor-panes { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; min-height: 480px; height: calc(100vh - 250px); }
.editor-panes.no-preview { grid-template-columns: minmax(0, 1fr); max-width: 980px; width: 100%; margin: 0 auto; }
.editor-panes.no-preview .pane-preview { display: none; }
.pane { min-width: 0; min-height: 0; }
.pane-write { display: flex; flex-direction: column; background: var(--bg); }
.pane-preview { overflow-y: auto; padding: 28px 36px 64px; background: var(--bg-sunk); border-left: 1px solid var(--line); }
:root[data-theme="dark"] .pane-preview { background: #181920; }
.preview-title { font-size: 30px; margin-bottom: 22px; }
.toolbar { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--bg); flex-wrap: wrap; }
.tool { width: 32px; height: 30px; display: inline-grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--ink-2); padding: 0; }
.tool:hover { background: var(--bg-hover); color: var(--ink); }
.tool:active { background: var(--bg-press); }
.toolbar-sep { width: 1px; height: 18px; background: var(--line); margin: 0 5px; }
.editor-text {
  flex: 1; width: 100%; min-height: 0; resize: none; border: 0; background: var(--bg); color: var(--ink);
  padding: 20px 24px 64px; font-family: var(--font-mono); font-size: 14px; line-height: 1.7; tab-size: 2;
}
.editor-text:focus-visible { box-shadow: none; }
.editor-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 10px 2px 0; }

@media (max-width: 1100px) {
  .tabs { display: flex; }
  .editor-panes, .editor-panes.no-preview { grid-template-columns: minmax(0, 1fr); border-radius: 0 0 var(--r-lg) var(--r-lg); border-top: 0; max-width: 1100px; width: 100%; margin: 0 auto; }
  .editor-panes[data-tab="write"] .pane-preview { display: none; }
  .editor-panes[data-tab="preview"] .pane-write { display: none; }
  .editor-panes[data-tab="preview"] .pane-preview { display: block; border-left: 0; }
  [aria-label="Toggle preview"] { display: none; }
}

/* ---------------------------------------------------------------------------
   History and diffs */

.history-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 32px; align-items: start; }
.version-col { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; }
.version-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.version-item { display: flex; gap: 12px; width: 100%; padding: 10px; border: 0; border-radius: var(--r-md); background: none; text-align: left; }
.version-item:hover { background: var(--bg-hover); }
.version-item[aria-current="true"] { background: var(--accent-tint); }
.version-num { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; color: var(--ink-3); min-width: 30px; padding-top: 1px; }
.version-item[aria-current="true"] .version-num { color: var(--accent-ink); }
.version-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.version-line { display: flex; align-items: center; gap: 4px; }
.version-who { font-weight: 600; font-size: 13.5px; }
.version-when { font-size: 12.5px; color: var(--ink-3); }
.version-note { font-size: 12.5px; color: var(--ink-2); }
.version-detail { min-width: 0; }
.version-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.version-title { font-size: 19px; font-weight: 650; display: flex; align-items: center; }
.version-sub { margin-top: 4px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.version-content { padding: 28px 32px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.version-content .post-title { font-size: 30px; margin-bottom: 20px; }

.diff-summary { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 13px; flex-wrap: wrap; }
.diff-stat-add { color: var(--diff-add-ink); font-weight: 650; font-family: var(--font-mono); }
.diff-stat-del { color: var(--diff-del-ink); font-weight: 650; font-family: var(--font-mono); }
.diff { border: 1px solid var(--line); border-radius: var(--r-lg); overflow-x: auto; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; background: var(--bg); }
.diff-line { display: grid; grid-template-columns: 44px 44px 20px minmax(0, 1fr); min-width: max-content; }
.diff-ln { padding: 0 8px; text-align: right; color: var(--ink-3); user-select: none; border-right: 1px solid var(--line); opacity: .8; }
.diff-sign { text-align: center; user-select: none; }
.diff-text { padding-right: 16px; white-space: pre-wrap; word-break: break-word; }
.diff-add { background: var(--diff-add); color: var(--diff-add-ink); }
.diff-del { background: var(--diff-del); color: var(--diff-del-ink); }
.diff-hunk { background: var(--accent-tint); color: var(--accent-ink); }
.diff-hunk .diff-text { padding: 3px 12px; }

/* ---------------------------------------------------------------------------
   Topics */

.topic-head { margin-bottom: 8px; display: flex; flex-direction: column; gap: 10px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); }
.crumb-sep { color: var(--line-strong); }
.topic-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.topic-title-wrap { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topic-head .page-desc { max-width: 64ch; }
.member-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.member { display: inline-flex; align-items: center; gap: 2px; padding: 4px 4px 4px 6px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; }
.subtopics { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.subtopic { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink); font-weight: 550; }
.subtopic:hover { border-color: var(--line-strong); background: var(--bg-sunk); text-decoration: none; }
.subtopic-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topic-tree { list-style: none; border-top: 1px solid var(--line); }
.topic-tree > li { border-bottom: 1px solid var(--line); }
.topic-tree-sub { list-style: none; margin-left: 42px; border-left: 1px solid var(--line); margin-bottom: 8px; }
.topic-card { display: flex; align-items: center; gap: 14px; padding: 12px 8px; color: var(--ink); border-radius: var(--r-md); }
.topic-tree-sub .topic-card { padding: 8px 8px 8px 14px; }
.topic-card:hover { background: var(--bg-hover); text-decoration: none; }
.topic-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.topic-card-name { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; }
.topic-card-name .icon { color: var(--ink-3); }
.topic-card-desc { color: var(--ink-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-card-count { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 24px; text-align: right; }

.swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.swatches .emoji-btn { width: 34px; height: 34px; font-size: 17px; border: 1px solid var(--line); }
.emoji-none { color: var(--ink-3); }
.swatch { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--bg); background: var(--c, var(--bg-sunk)); box-shadow: 0 0 0 1px var(--line-strong); padding: 0; display: inline-grid; place-items: center; color: var(--ink-3); position: relative; cursor: pointer; }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--ink); }
.swatch-custom { background: conic-gradient(#e11d48, #f59e0b, #22c55e, #0ea5e9, #6366f1, #d946ef, #e11d48); overflow: hidden; }
.swatch-custom .color-input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.swatch-none { background: var(--bg); }

/* ---------------------------------------------------------------------------
   Profile, notifications, activity, insights */

.profile-head { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 8px; }
.profile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.profile-handle { display: flex; align-items: center; gap: 8px; color: var(--ink-3); flex-wrap: wrap; }
.profile-bio { color: var(--ink-2); line-height: 1.6; max-width: 62ch; white-space: pre-line; }

.notif-list { list-style: none; border-top: 1px solid var(--line); }
.notif { display: flex; align-items: flex-start; gap: 12px; padding: 13px 4px 13px 0; border-bottom: 1px solid var(--line); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 10px; flex: none; background: transparent; }
.notif.is-unread .notif-dot { background: var(--accent); }
.notif-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.notif-msg { color: var(--ink-2); font-size: 14px; line-height: 1.45; }
a.notif-msg:hover { color: var(--ink); }
.notif.is-unread .notif-msg { color: var(--ink); font-weight: 550; }
.notif-meta { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--ink-3); }
.notif-kind { display: inline-flex; align-items: center; gap: 4px; }

.activity-list { list-style: none; border-top: 1px solid var(--line); }
.activity { display: flex; align-items: flex-start; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.activity.is-bot { background: linear-gradient(90deg, var(--accent-tint), transparent 60%); }
.activity-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.activity-text { font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.activity-actor { font-weight: 600; color: var(--ink); }
.activity-summary { color: var(--ink-2); }
a.activity-summary:hover { color: var(--accent-ink); }
.activity-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.activity-kind { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 11.5px; }

.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-right: 1px solid var(--line); color: var(--ink); }
.stat:last-child { border-right: 0; }
a.stat:hover { background: var(--bg-hover); text-decoration: none; }
.stat-value { font-family: var(--font-serif); font-size: 26px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12.5px; color: var(--ink-3); }
.contributors { list-style: none; border-top: 1px solid var(--line); }
.contributor { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); }

/* ---------------------------------------------------------------------------
   Settings */

.settings-title { margin-bottom: 24px; }
.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 40px; align-items: start; }
.settings-nav { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav-head { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 14px 10px 4px; }
.settings-link { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 500; }
.settings-link:hover { background: var(--bg-hover); color: var(--ink); text-decoration: none; }
.settings-link[aria-current="page"] { background: var(--accent-tint); color: var(--accent-ink); }
.settings-link-accent .icon { color: var(--accent-ink); }
.settings-content { display: flex; flex-direction: column; gap: 20px; min-width: 0; max-width: 760px; }

.panel { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.panel-head { display: flex; flex-direction: column; gap: 4px; }
.panel > .btn { align-self: flex-start; }
.panel-title { font-size: 16px; font-weight: 650; }
.panel-desc { color: var(--ink-2); font-size: 14px; line-height: 1.55; max-width: 64ch; }
.panel-hero { background: linear-gradient(180deg, var(--accent-tint), transparent 85%); border-color: var(--accent-line); padding: 28px 28px 24px; }
.panel-hero .panel-title { font-family: var(--font-serif); font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.hero-mark { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.panel-hero .copy-field { background: var(--bg); padding: 7px 7px 7px 14px; }
.panel-hero .copy-value { font-size: 14.5px; font-weight: 550; }
.profile-preview { display: flex; align-items: center; gap: 14px; }

.snippet { display: flex; flex-direction: column; gap: 6px; }
.snippet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.snippet-title { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.code-block { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-sunk); font-size: 12.5px; line-height: 1.6; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.link-list { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.link-list a { display: inline-flex; align-items: center; gap: 6px; font-weight: 550; }
.link-list code { font-size: 12.5px; background: var(--bg-sunk); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line); }

.token-list, .people-list, .webhook-list { list-style: none; border-top: 1px solid var(--line); }
.token, .person, .webhook { display: flex; align-items: center; gap: 14px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.token:last-child, .person:last-child, .webhook:last-child { border-bottom: 0; }
.token-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--bg-sunk); color: var(--ink-2); flex: none; border: 1px solid var(--line); }
.token-main, .person-main, .webhook-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.token-head, .person-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.token-meta, .person-meta { display: flex; align-items: center; gap: 4px 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); }
.token-meta code { font-size: 12px; }
.person-name { font-weight: 600; color: var(--ink); }
.person .select { width: 110px; flex: none; }
.person.is-deactivated .avatar, .person.is-deactivated .person-name { opacity: .55; }
.webhook-url { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; color: var(--ink); }
.status-ok { display: inline-flex; align-items: center; gap: 4px; color: var(--green); }
.status-bad { display: inline-flex; align-items: center; gap: 4px; color: var(--red); }

/* ---------------------------------------------------------------------------
   Responsive */

@media (max-width: 1100px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-right: 0; }
  .stat:nth-child(-n + 3) { border-bottom: 1px solid var(--line); }
  .history-layout { grid-template-columns: minmax(0, 1fr); }
  .version-col { position: static; max-height: 280px; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 4px; }
}

@media (max-width: 900px) {
  .page { padding: 28px 24px 80px; }
  .page-editor { padding: 0 16px 24px; }
  .editor-bar { top: 52px; }
  .editor-panes { height: calc(100vh - 300px); }
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
  .settings-nav-head { display: none; }
  .settings-link { flex: none; }
  .toc { display: none; }
  .comment { margin: 0; }
}

@media (max-width: 640px) {
  .page { padding: 22px 16px 72px; }
  .page-title { font-size: 26px; }
  .home-title { font-size: 28px; }
  .post-title-row { flex-direction: column; gap: 10px; }
  .post-actions { padding-top: 0; }
  .post-meta { gap: 8px 14px; }
  .prose { font-size: 16.5px; }
  .heading-anchor { display: none; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(odd) { border-right: 1px solid var(--line); }
  .stat:nth-child(even) { border-right: 0; }
  .stat:nth-child(-n + 4) { border-bottom: 1px solid var(--line); }
  .panel { padding: 18px 16px; }
  .person { flex-wrap: wrap; }
  .composer-hint { display: none; }
  .toasts { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
  .toast { max-width: none; }
  .editor-text { padding: 16px; }
  .editor-bar { gap: 8px; }
  .editor-bar .save-state { display: none; }
  .editor-bar > .btn-ghost { padding: 0 6px; }
  .pane-preview { padding: 20px 16px 48px; }
  .search-form-row .btn { display: none; }
  .profile-head { flex-wrap: wrap; }
  .palette { margin-top: 8px; }
  .palette-foot { display: none; }
  .palette-topics { display: none; }
}

@media print {
  .sidebar, .topbar, .post-actions, .comments, .post-reactions, .toc, .toc-inline, .banner { display: none !important; }
  .page { padding: 0; }
}
