@import url('/style.css?v=profiles-1');
:root {
  --paper: #f4f0e7;
  --paper-deep: #eee8dc;
  --surface: #fffdf8;
  --surface-alt: #faf7f0;
  --header-row: #e9e4d9;
  --ink: #202529;
  --muted: #707574;
  --line: #d2cbc0;
  --line-dark: #bdb5aa;
  --header: #202528;
  --link: #355f77;
  --link-dark: #294b5d;
  --action: #c95b3d;
  --action-dark: #ad4a31;
  --blue-soft: #e8eef1;
  --reference-green: #7e8e5f;
  --danger: #8c3737;
  --code: #191d1f;
  --content: 850px;
  --wide: 1420px;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    15px/1.58 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}
a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.56rem 0.82rem;
  border: 1px solid var(--action);
  border-radius: 7px;
  background: var(--action);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  font-weight: 650;
  font-size: 0.9rem;
}
button:hover,
.button:hover {
  background: var(--action-dark);
  border-color: var(--action-dark);
  text-decoration: none;
}
button.secondary,
.button.secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-dark);
}
button.danger,
.button.danger {
  background: var(--danger);
  border-color: var(--danger);
}
input,
textarea,
select {
  width: 100%;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  padding: 0.65rem 0.72rem;
}
textarea {
  resize: vertical;
}
h1,
h2,
h3,
h4 {
  line-height: 1.2;
  color: #1e2529;
}
h1 {
  margin: 0 0 0.35rem;
  font-size: 2rem;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 1.35rem;
  margin: 1.65rem 0 0.7rem;
}
h3 {
  font-size: 1.08rem;
  margin: 1.35rem 0 0.55rem;
}
p {
  margin: 0.65rem 0;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.86rem;
}

.site-header {
  background: var(--header);
  color: #fff;
  border-bottom: 3px solid #385d70;
}
.header-inner {
  max-width: var(--wide);
  min-height: 58px;
  margin: auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 30px;
}
.brand {
  color: #fff;
  font:
    700 1.05rem/1 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}
.brand:hover {
  text-decoration: none;
}
.main-nav,
.account-nav {
  display: flex;
  gap: 20px;
  font-size: 0.9rem;
}
.main-nav a,
.account-nav a {
  color: #d9dfe1;
}
.main-nav a:hover,
.account-nav a:hover {
  color: #fff;
  text-decoration: none;
}
.account-nav {
  margin-left: auto;
}

.page {
  max-width: 1180px;
  margin: auto;
  padding: 34px 22px 60px;
}
.page.narrow {
  max-width: 760px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}
.page-heading .muted {
  font-size: 0.86rem;
}
.breadcrumbs,
.crumbs {
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 8px;
}

.board {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
}
.board-header {
  padding: 12px 16px;
  background: var(--header-row);
  color: #466279;
  font-weight: 700;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--line);
}
.board-subheader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 90px 220px;
  gap: 14px;
  padding: 8px 16px;
  background: #f3efe7;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.board-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 90px 220px;
  gap: 14px;
  align-items: center;
  min-height: 82px;
  padding: 14px 16px;
  border-top: 1px solid #e4ded3;
}
.board-header + .board-row,
.board-subheader + .board-row {
  border-top: 0;
}
.board-row:hover {
  background: #fdfbf7;
}
.board-main {
  min-width: 0;
}
.board-title {
  font-weight: 750;
  color: #182a35;
}
.board-title:hover {
  color: var(--link);
}
.board-desc {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.84rem;
}
.board-num {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}
.board-latest {
  font-size: 0.81rem;
  color: var(--muted);
  line-height: 1.45;
}
.board-latest a {
  font-weight: 650;
}
.board-compact .board-row {
  grid-template-columns: minmax(0, 1fr) 125px 160px;
  min-height: 68px;
}
.board-compact .board-subheader {
  grid-template-columns: minmax(0, 1fr) 125px 160px;
}
.board-feed .board-row {
  grid-template-columns: minmax(0, 1fr) 130px;
  min-height: 70px;
}
.board-feed .board-subheader {
  grid-template-columns: minmax(0, 1fr) 130px;
}

.browse-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.browse-tabs a {
  padding: 0.48rem 0.72rem;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--muted);
  border-radius: 7px 7px 0 0;
}
.browse-tabs a.active {
  color: var(--ink);
  background: var(--surface);
  border-bottom-color: var(--surface);
  font-weight: 700;
}

.search-bar {
  display: flex;
  gap: 0.55rem;
  margin-bottom: 18px;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 38px;
  align-items: center;
  padding: 44px 0 34px;
}
.hero h1 {
  font-size: 2.9rem;
}
.hero-actions {
  display: flex;
  gap: 0.65rem;
  margin-top: 18px;
}
.hero-note {
  border-left: 4px solid #587d90;
  background: rgba(255, 253, 248, 0.55);
  padding: 17px 20px;
}
.hero-note dl {
  display: grid;
  grid-template-columns: 85px 1fr;
  gap: 0.5rem 0.8rem;
  margin: 0;
}
.hero-note dt {
  font-weight: 700;
  color: #4e626c;
}
.hero-note dd {
  margin: 0;
  color: #4f5557;
}
.home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 18px 0 30px;
}
.home-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 17px;
}
.home-tile h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.article-shell {
  width: min(var(--wide), calc(100vw - 28px));
  margin: auto;
  padding: 32px 0 60px;
  display: grid;
  grid-template-columns: 220px minmax(0, var(--content)) 220px;
  gap: 30px;
  align-items: start;
}
.article-side {
  grid-column: 1;
}
.article-center {
  grid-column: 2;
  min-width: 0;
}
.toc {
  position: sticky;
  top: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.toc summary {
  cursor: pointer;
  padding: 10px 12px;
  background: var(--header-row);
  color: #48657a;
  font-weight: 700;
  font-size: 0.86rem;
}
.toc nav {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}
.toc a {
  padding: 0.34rem 0.8rem;
  font-size: 0.84rem;
  color: #4b5960;
}
.toc .l3 {
  padding-left: 1.5rem;
  font-size: 0.8rem;
}

.wiki-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 15px;
}
.wiki-tabs a {
  padding: 0.5rem 0.72rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.wiki-tabs a.active {
  color: var(--ink);
  font-weight: 700;
  border-bottom-color: var(--link);
}
.article-title-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}
.article-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.article-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.5rem 0 12px;
}
.article-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 34px 40px 46px;
  line-height: 1.7;
}
.article-body h2 {
  border-bottom: 1px solid #ddd6ca;
  padding-bottom: 0.38rem;
  margin-top: 2rem;
}
.article-body pre {
  background: var(--code);
  color: #eee;
  padding: 14px;
  overflow: auto;
  border-radius: 4px;
}
.article-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #efebe2;
  padding: 0.08rem 0.25rem;
}
.article-body pre code {
  background: transparent;
}
.article-body blockquote {
  border-left: 3px solid #7894a1;
  padding: 0.15rem 1rem;
  margin: 1rem 0;
  color: #555;
}
.article-tools {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 12px 0 16px;
}

.thread-post {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.thread-author {
  padding: 14px;
  background: #f1ede5;
  border-right: 1px solid var(--line);
}
.thread-body {
  padding: 14px 16px;
}
.thread-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.8rem;
  padding-bottom: 8px;
  border-bottom: 1px solid #e7e1d6;
  margin-bottom: 12px;
}
.help-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.profile-header {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-bottom: 18px;
}
.avatar {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  background: #dfe9ed;
  border: 1px solid #a9bbc4;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.8rem;
  color: #355b6e;
}
.profile-grid {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 18px;
}
.profile-sidebar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  height: max-content;
}
.profile-stat {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #ece6dc;
}
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.tabs a {
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  color: var(--muted);
}
.tabs a.active {
  background: #e8eef1;
  color: #294b5d;
  font-weight: 700;
}
.post-board {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.post-row {
  padding: 14px 16px;
  border-top: 1px solid #e5ded3;
}
.post-board .post-row:first-of-type {
  border-top: 0;
}
.post-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}
.post-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.auth-card {
  max-width: 460px;
  margin: 50px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 22px;
}
.form-stack {
  display: grid;
  gap: 13px;
}
.form-row {
  display: grid;
  gap: 5px;
}

.docs-editor {
  width: min(1480px, calc(100vw - 22px));
  margin: auto;
  padding: 24px 0 54px;
}
.docs-frame {
  display: grid;
  grid-template-columns: 220px minmax(0, 930px) 220px;
  gap: 28px;
  align-items: start;
}
.docs-sidebar {
  grid-column: 1;
}
.docs-main {
  grid-column: 2;
  min-width: 0;
}
.docs-chrome {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.docs-topline {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
.docs-document-name {
  flex: 1;
}
.docs-document-name strong {
  display: block;
}
.docs-document-name span {
  font-size: 0.8rem;
  color: var(--muted);
}
.docs-menu {
  display: flex;
  gap: 2px;
  padding: 0 8px;
  min-height: 34px;
  align-items: center;
  border-bottom: 1px solid #e4ded3;
  background: #faf7f1;
}
.docs-menu button {
  background: transparent;
  color: #333;
  border: 0;
  padding: 0.35rem 0.55rem;
}
.docs-toolbar {
  display: flex;
  align-items: center;
  gap: 0.18rem;
  flex-wrap: wrap;
  padding: 6px 8px;
  background: #f1ede5;
  border-bottom: 1px solid var(--line);
}
.docs-toolbar button,
.docs-toolbar select {
  width: auto;
  min-height: 32px;
}
.docs-toolbar button {
  background: transparent;
  color: #222;
  border: 1px solid transparent;
  padding: 0.32rem 0.48rem;
}
.docs-toolbar button:hover {
  background: #e2ddd4;
  border-color: #c8c1b7;
}
.docs-toolbar select {
  background: var(--surface);
  border-color: var(--line-dark);
  padding: 0.3rem 0.42rem;
}
.docs-toolbar .tool-group {
  display: flex;
  gap: 0.1rem;
}
.docs-toolbar .tool-separator {
  width: 1px;
  height: 24px;
  background: #cfc8bd;
  margin: 0 0.25rem;
}
.docs-toolbar .mode-toggle {
  margin-left: auto;
}
.toggle {
  width: 42px;
  height: 22px;
  border-radius: 999px;
  background: #aaa;
  padding: 3px;
  cursor: pointer;
}
.toggle-knob {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: 0.15s;
}
.toggle.on {
  background: #4f7385;
}
.toggle.on .toggle-knob {
  transform: translateX(20px);
}
.docs-canvas {
  background: #dcd6cc;
  padding: 28px 34px 42px;
}
.docs-paper {
  max-width: 760px;
  min-height: 880px;
  margin: auto;
  background: var(--surface);
  border: 1px solid #c8c0b5;
  box-shadow: 0 2px 8px rgba(35, 39, 40, 0.12);
}
.docs-paper textarea {
  width: 100%;
  min-height: 880px;
  border: 0;
  border-radius: 0;
  resize: none;
  outline: 0;
  padding: 56px 62px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1.6;
  background: var(--surface);
}
.docs-rendered {
  min-height: 880px;
  padding: 56px 62px;
}
.docs-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}

.kebab {
  position: relative;
}
.kebab-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  width: 155px;
  background: var(--surface);
  border: 1px solid var(--line-dark);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.12);
  z-index: 30;
}
.kebab-menu a,
.kebab-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  color: var(--ink);
  border: 0;
  border-radius: 0;
  padding: 0.55rem 0.7rem;
}
.hidden {
  display: none !important;
}
.footer {
  max-width: 1180px;
  margin: auto;
  padding: 24px 22px 40px;
  color: #7b7e7d;
  font-size: 0.82rem;
}

@media (max-width: 1050px) {
  .board-subheader,
  .board-row {
    grid-template-columns: minmax(0, 1fr) 70px 70px 170px;
  }
  .article-shell,
  .docs-frame {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .article-center,
  .docs-main {
    grid-column: 2;
  }
  .article-side,
  .docs-sidebar {
    grid-column: 1;
  }
}
@media (max-width: 760px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 10px 14px;
  }
  .main-nav {
    order: 3;
    width: 100%;
    overflow: auto;
  }
  .page {
    padding: 22px 12px 42px;
  }
  .hero,
  .home-grid {
    grid-template-columns: 1fr;
  }
  .board-subheader {
    display: none;
  }
  .board-row,
  .board-compact .board-row,
  .board-feed .board-row {
    grid-template-columns: 1fr;
    gap: 7px;
    min-height: 0;
  }
  .board-num {
    text-align: left;
  }
  .board-latest {
    border-top: 1px dashed #ded7cd;
    padding-top: 6px;
  }
  .article-shell,
  .docs-frame {
    display: block;
    width: calc(100vw - 20px);
  }
  .article-side,
  .docs-sidebar {
    margin-bottom: 12px;
  }
  .toc {
    position: static;
  }
  .article-body {
    padding: 23px;
  }
  .thread-post {
    grid-template-columns: 1fr;
  }
  .thread-author {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .docs-canvas {
    padding: 10px;
  }
  .docs-paper textarea,
  .docs-rendered {
    padding: 30px 24px;
  }
}

/* v9 additions: locked v8 style + homepage random articles + map placeholder */

.home-random-articles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 30px;
}

.home-random-article {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-height: 118px;
}

.home-random-article:hover {
  background: #fdfbf7;
  text-decoration: none;
  border-color: var(--line-dark);
}

.home-random-article strong {
  display: block;
  color: #1d303b;
  font-size: 0.98rem;
  margin-bottom: 5px;
}

.home-random-article span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.map-page {
  max-width: 1380px;
}

.map-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.map-toolbar .search-bar {
  flex: 1;
  margin: 0;
  min-width: 300px;
}

.map-filter-group {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.map-filter {
  padding: 0.45rem 0.66rem;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 6px;
  font-size: 0.84rem;
}

.map-filter.active {
  background: var(--blue-soft);
  color: var(--link-dark);
  border-color: #aebfc7;
  font-weight: 700;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 14px;
}

.map-canvas {
  position: relative;
  min-height: 680px;
  overflow: hidden;
  background: linear-gradient(rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.45)), var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.map-canvas::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(80, 90, 94, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(80, 90, 94, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.map-placeholder-label {
  position: absolute;
  left: 18px;
  top: 15px;
  color: var(--muted);
  font-size: 0.78rem;
  z-index: 2;
}

.map-node {
  position: absolute;
  z-index: 3;
  min-width: 128px;
  max-width: 180px;
  padding: 9px 11px;
  background: var(--surface);
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  box-shadow: 0 2px 7px rgba(30, 35, 38, 0.08);
}

.map-node strong {
  display: block;
  font-size: 0.82rem;
  color: #21333e;
  line-height: 1.3;
}

.map-node span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 3px;
}

.map-node.article {
  border-left: 4px solid #52798b;
}
.map-node.thread {
  border-left: 4px solid #b36a3f;
}
.map-node.post {
  border-left: 4px solid #778b5b;
}

.map-edge {
  position: absolute;
  height: 1px;
  background: #aab1b2;
  transform-origin: left center;
  z-index: 1;
  opacity: 0.9;
}

.map-edge.reference {
  background: #52798b;
  height: 2px;
}

.map-edge.reply {
  background: #b7a998;
}

.map-sidebar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  height: max-content;
}

.map-sidebar-section {
  padding: 14px;
  border-top: 1px solid #e7e1d6;
}

.map-sidebar-section:first-child {
  border-top: 0;
}

.map-sidebar h3 {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.map-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 7px 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.map-dot {
  width: 11px;
  height: 11px;
  border-radius: 2px;
}

.map-dot.article {
  background: #52798b;
}
.map-dot.thread {
  background: #b36a3f;
}
.map-dot.post {
  background: #778b5b;
}

.map-stat {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.map-selected {
  padding: 12px;
  background: #faf7f0;
  border: 1px solid #e1dbd0;
  border-radius: 6px;
  font-size: 0.82rem;
}

.map-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 900px) {
  .home-random-articles {
    grid-template-columns: 1fr;
  }

  .map-layout {
    grid-template-columns: 1fr;
  }

  .map-sidebar {
    order: -1;
  }

  .map-canvas {
    min-height: 560px;
  }
}

/* v10: visual consistency on home + interaction-first map */

.home-random-board {
  max-width: 100%;
  margin: 30px 0 0;
}

.home-random-board .board-row {
  grid-template-columns: minmax(0, 1fr) 180px;
  min-height: 78px;
}

.map-body {
  height: 100vh;
  overflow: hidden;
}

.knowledge-map {
  position: relative;
  height: calc(100vh - 61px);
  overflow: hidden;
  background: linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.35)), var(--paper);
  cursor: grab;
  touch-action: none;
}

.knowledge-map.dragging {
  cursor: grabbing;
}

.map-stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1800px;
  height: 1100px;
  transform-origin: 0 0;
  will-change: transform;
}

.graph-edges {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.edge {
  stroke: #bbb2a6;
  stroke-width: 2;
}

.edge.reference {
  stroke: #55788a;
  stroke-width: 3;
}

.edge.relation {
  stroke: #b29b82;
  stroke-width: 2;
  stroke-dasharray: 7 5;
}

.graph-node {
  position: absolute;
  width: 180px;
  min-height: 70px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-dark);
  box-shadow: 0 2px 8px rgba(30, 35, 38, 0.1);
  text-align: left;
  cursor: pointer;
}

.graph-node:hover {
  background: #fffefb;
  border-color: #8f9da3;
  box-shadow: 0 4px 12px rgba(30, 35, 38, 0.14);
}

.graph-node.article {
  border-left: 5px solid #55788a;
}

.graph-node.thread {
  border-left: 5px solid #bc6b45;
}

.graph-node.post {
  border-left: 5px solid var(--reference-green);
}

.graph-node strong {
  display: block;
  font-size: 0.84rem;
  line-height: 1.3;
}

.node-type {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.node-viewer {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: min(360px, calc(100vw - 40px));
  padding: 17px;
  background: var(--surface);
  border: 1px solid var(--line-dark);
  border-radius: 9px;
  box-shadow: 0 8px 28px rgba(30, 35, 38, 0.18);
  cursor: default;
  z-index: 20;
}

.node-viewer-close {
  position: absolute;
  right: 8px;
  top: 7px;
  width: 30px;
  height: 30px;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 1.35rem;
}

.node-viewer-close:hover {
  background: #eee9e0;
  color: var(--ink);
}

.node-viewer-type {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-right: 28px;
}

.node-viewer h2 {
  margin: 0.3rem 28px 0.55rem 0;
  font-size: 1.15rem;
}

.node-viewer p {
  color: #4c5356;
  font-size: 0.88rem;
}

.node-viewer-meta {
  margin: 12px 0;
  padding-top: 10px;
  border-top: 1px solid #e4ded3;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 700px) {
  .home-random-board .board-row {
    grid-template-columns: 1fr;
  }

  .knowledge-map {
    height: calc(100vh - 105px);
  }

  .node-viewer {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
  }
}

/* v11 functionality prototype additions */

.header-inner {
  gap: 18px;
}

.header-search {
  margin-left: auto;
  width: 210px;
}

.header-search input {
  height: 34px;
  padding: 0.42rem 0.62rem;
  border-color: #4f575b;
  background: #2a3033;
  color: #f4f4f2;
  border-radius: 6px;
  font-size: 0.84rem;
}

.header-search input::placeholder {
  color: #aeb6b9;
}

.account-nav {
  margin-left: 0;
  white-space: nowrap;
}

.notification-link span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  margin-left: 3px;
  border-radius: 999px;
  background: #c95b3d;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
  align-items: center;
}

.utility-link {
  font-size: 0.82rem;
  color: var(--muted);
}

.health-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 7px 0 12px;
}

.health-tag {
  display: inline-block;
  padding: 0.22rem 0.48rem;
  border: 1px solid #c8bfae;
  border-radius: 999px;
  background: #f8f2e7;
  color: #6f5f47;
  font-size: 0.72rem;
}

.health-tag.reviewed {
  border-color: #adc0b4;
  background: #edf4ef;
  color: #466452;
}

.health-tag.warning {
  border-color: #cfb398;
  background: #f8efe3;
  color: #7b5435;
}

.inline-backlinks {
  margin-top: 12px;
  padding: 9px 11px;
  border-left: 3px solid #7f9cac;
  background: #f8f6ef;
  color: var(--muted);
  font-size: 0.8rem;
}

.inline-backlinks a {
  font-weight: 650;
}

.accepted-answer {
  border-color: #99b3a1;
  box-shadow: 0 0 0 2px rgba(94, 132, 104, 0.07);
}

.accepted-answer .thread-meta::before {
  content: 'Accepted answer';
  color: #52725a;
  font-weight: 700;
  margin-right: auto;
}

.thread-meta {
  gap: 12px;
}

.thread-meta span:first-child {
  margin-right: auto;
}

.post-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 14px;
}

.post-tools button {
  padding: 0.42rem 0.62rem;
  font-size: 0.82rem;
}

.answer-candidate {
  color: #52725a;
  font-size: 0.78rem;
  margin-left: auto;
}

.search-results-group {
  margin-bottom: 24px;
}

.result-row {
  padding: 14px 2px;
  border-top: 1px solid #e2dbd0;
}

.result-row:first-child {
  border-top: 0;
}

.result-type {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.result-title {
  font-weight: 750;
}

.result-snippet {
  color: #5f6567;
  margin-top: 3px;
  font-size: 0.86rem;
}

.notification-list,
.log-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.notification-item,
.log-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 14px 16px;
  border-top: 1px solid #e4ded3;
}

.notification-item:first-child,
.log-item:first-child {
  border-top: 0;
}

.notification-item.unread {
  background: #f6fafb;
  border-left: 4px solid #55788a;
  padding-left: 12px;
}

.notification-time,
.log-time {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.saved-type {
  display: inline-block;
  margin-right: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.diff-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.diff-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--header-row);
  border-bottom: 1px solid var(--line);
}

.diff-head > div {
  padding: 10px 14px;
  font-weight: 700;
}

.diff-head > div + div {
  border-left: 1px solid var(--line);
}

.diff-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.diff-col {
  padding: 14px;
  min-height: 460px;
}

.diff-col + .diff-col {
  border-left: 1px solid var(--line);
}

.diff-line {
  padding: 3px 6px;
  margin: 2px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
}

.diff-line.add {
  background: #e9f3eb;
  color: #355d3f;
}

.diff-line.remove {
  background: #f6e7e4;
  color: #7a3b35;
}

.revision-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.editor-checks {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding: 7px 12px;
  background: #f8f5ef;
  border-bottom: 1px solid #ddd7cc;
  color: var(--muted);
  font-size: 0.76rem;
}

.editor-checks .ok {
  color: #52725a;
}

.editor-checks .warn {
  color: #8a603e;
}

.recovery-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: #fff8e8;
  border-bottom: 1px solid #e3d2a8;
  color: #6d5b34;
  font-size: 0.8rem;
}

.shortcut-hint {
  color: var(--muted);
  font-size: 0.74rem;
}

.owner-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 0;
}

.status-pill {
  display: inline-block;
  padding: 0.22rem 0.48rem;
  border-radius: 999px;
  background: #e9f1ea;
  color: #496b51;
  font-size: 0.72rem;
  font-weight: 700;
}

.activity-type {
  color: var(--muted);
  width: 90px;
  font-size: 0.76rem;
  text-transform: uppercase;
}

@media (max-width: 1000px) {
  .header-search {
    display: none;
  }
}

@media (max-width: 700px) {
  .notification-item,
  .log-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .notification-time,
  .log-time {
    white-space: normal;
  }

  .diff-head,
  .diff-body {
    grid-template-columns: 1fr;
  }

  .diff-head > div + div,
  .diff-col + .diff-col {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .revision-nav {
    flex-wrap: wrap;
  }
}

.follow-counts {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 0.82rem;
}
.follow-counts strong {
  color: var(--ink);
}
.profile-follow-panel {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
}
.post-page {
  max-width: 920px;
}
.post-header {
  margin-bottom: 18px;
}
.post-header h1 {
  font-size: 2.15rem;
  margin-bottom: 0.4rem;
}
.post-author-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.84rem;
}
.post-owner-badge {
  display: inline-block;
  padding: 0.18rem 0.42rem;
  border-radius: 999px;
  background: #e8eef1;
  color: #2f5568;
  font-size: 0.7rem;
  font-weight: 700;
}
.post-body-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px 30px;
  line-height: 1.68;
}
.post-body-card h2 {
  margin-top: 1.8rem;
  border-bottom: 1px solid #e2dbd0;
  padding-bottom: 0.32rem;
}
.post-meta-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 12px 0 14px;
  color: var(--muted);
  font-size: 0.8rem;
}
.post-actions-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 16px 0 24px;
}
.comments {
  margin-top: 26px;
}
.comment {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 0;
}
.comment:first-of-type {
  border-top: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
}
.comment:last-of-type {
  border-radius: 0 0 8px 8px;
}
.comment-author {
  padding: 12px;
  background: #f1ede5;
  border-right: 1px solid var(--line);
  font-size: 0.82rem;
}
.comment-body {
  padding: 12px 14px;
}
.comment-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.76rem;
  margin-bottom: 6px;
}
.comment-form {
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.post-list-board .board-row,
.post-list-board .board-subheader {
  grid-template-columns: minmax(0, 1fr) 125px 160px;
}
.follow-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid #e4ded3;
}
.follow-list-row:first-child {
  border-top: 0;
}
.post-editor-wrap {
  max-width: 900px;
  margin: auto;
}
.post-editor-wrap .docs-frame {
  grid-template-columns: minmax(0, 930px);
}
.post-editor-wrap .docs-main {
  grid-column: 1;
}
@media (max-width: 700px) {
  .comment {
    grid-template-columns: 1fr;
  }
  .comment-author {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .post-list-board .board-row {
    grid-template-columns: 1fr;
  }
  .post-list-board .board-subheader {
    display: none;
  }
}

/* Live-site compatibility and v12 behavior */
.wrap {
  max-width: 1180px;
  margin: auto;
  padding-left: 22px;
  padding-right: 22px;
}
.page-content {
  padding-top: 34px;
  padding-bottom: 60px;
}
.site-footer {
  max-width: 1180px;
  margin: auto;
  padding: 24px 22px 40px;
  color: var(--muted);
  font-size: 0.82rem;
}
.footer-inner {
  display: flex;
  gap: 18px;
}
.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
  z-index: 99;
  background: #fff;
  padding: 0.5rem;
}
.inline-form {
  display: inline;
}
.link-button {
  background: transparent !important;
  color: var(--link) !important;
  border-color: transparent !important;
  padding: 0.25rem 0.35rem;
}
.danger-link {
  color: var(--danger) !important;
}
.danger-button {
  background: var(--danger);
  border-color: var(--danger);
}
.messages {
  margin-bottom: 16px;
}
.message {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}
.message.error {
  border-left: 4px solid var(--danger);
}
.message.success {
  border-left: 4px solid #64816c;
}
.toolbar {
  display: flex;
  gap: 0.55rem;
  margin-bottom: 18px;
}
.grow {
  min-width: 0;
  flex: 1;
}
.stats,
.row-meta {
  text-align: right;
  color: var(--muted);
  font-size: 0.78rem;
}
.empty {
  padding: 18px;
  color: var(--muted);
}
.category-row,
.thread-row,
.row {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid #e4ded3;
}
.panel > .panel-title + .category-row,
.panel > .panel-title + .thread-row,
.panel > .panel-title + .row {
  border-top: 0;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
}
.panel-title {
  padding: 12px 16px;
  background: var(--header-row);
  color: #466279;
  font-weight: 700;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--line);
}
.breadcrumbs {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 8px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px 0 8px;
}
.section-heading h2 {
  margin: 0;
}
.text-link {
  font-size: 0.86rem;
}
.profile-heading {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-bottom: 18px;
}
.profile-avatar {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  background: #dfe9ed;
  border: 1px solid #a9bbc4;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.8rem;
  color: #355b6e;
}
.profile-handle,
.profile-bio,
.profile-helped {
  margin: 0.2rem 0;
}
.profile-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.profile-tabs a {
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  color: var(--muted);
}
.profile-tabs a[aria-current='page'] {
  background: #e8eef1;
  color: #294b5d;
  font-weight: 700;
}
.tab-count {
  margin-left: 0.25rem;
  font-size: 0.72rem;
}
.private-label {
  font-size: 0.68rem;
}
.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 245px;
  gap: 18px;
}
.profile-sidebar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  height: max-content;
}
.profile-sidebar > a,
.profile-sidebar > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #ece6dc;
}
.profile-post {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 0;
}
.profile-post:first-child {
  border-top: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
}
.post-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}
.post-meta {
  color: var(--muted);
  font-size: 0.8rem;
}
.post-content {
  white-space: pre-wrap;
}
/* Helpful actions are intentionally neutral so repeated controls do not dominate threads/comments. */
.helpful-button,
.helpful-form button,
.helpful-action {
  background: var(--surface) !important;
  color: var(--ink) !important;
  border-color: var(--line-dark) !important;
}
.helpful-button:hover,
.helpful-form button:hover,
.helpful-action:hover {
  background: #eee9df !important;
  border-color: #aaa096 !important;
}
.backlinks {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.7rem 0;
  font-size: 0.84rem;
}
.backlinks strong {
  color: var(--muted);
}
.internal-ref {
  white-space: normal;
}
.article-wide-frame,
.article-editor-wide-frame {
  width: min(1420px, calc(100vw - 32px));
  margin-left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: minmax(13rem, 1fr) minmax(0, 850px) minmax(13rem, 1fr);
  gap: 30px;
  align-items: start;
}
.article-left-column {
  min-width: 0;
  justify-self: start;
  width: min(15rem, 100%);
}
.article-right-column {
  min-width: 0;
}
.article-centered,
.editor-main-column {
  grid-column: 2;
  width: 100%;
  min-width: 0;
}
.article-toc {
  position: sticky;
  top: 1rem;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.article-toc > summary {
  cursor: pointer;
  padding: 10px 12px;
  background: var(--header-row);
  color: #48657a;
  font-weight: 700;
  font-size: 0.86rem;
}
.article-toc nav {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}
.article-toc a {
  padding: 0.34rem 0.8rem;
  font-size: 0.84rem;
  color: #4b5960;
}
.article-toc .toc-level-2 {
  padding-left: 1.3rem;
}
.article-toc .toc-level-3 {
  padding-left: 2rem;
  font-size: 0.8rem;
}
.article-toc .toc-level-4 {
  padding-left: 2.7rem;
  font-size: 0.78rem;
}
.article-toolbar {
  width: min(1420px, calc(100vw - 32px));
  margin-left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.18rem;
  flex-wrap: wrap;
  padding: 6px 8px;
  background: #f1ede5;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  position: sticky;
  top: 0;
  z-index: 4;
}
.article-toolbar button {
  background: transparent;
  color: #222;
  border: 1px solid transparent;
  padding: 0.32rem 0.48rem;
}
.article-toolbar button:hover {
  background: #e2ddd4;
  border-color: #c8c1b7;
}
.toolbar-divider {
  width: 1px;
  height: 24px;
  background: #cfc8bd;
  margin: 0 0.25rem;
}
.article-writer {
  border: 0;
  background: transparent;
}
.editor-main-column {
  background: var(--surface);
  border: 1px solid var(--line);
}
.editor-view-panel {
  min-height: 38rem;
}
.editor-view-panel[hidden] {
  display: none !important;
}
.article-editor {
  display: block;
  width: 100%;
  min-height: 38rem;
  height: 38rem;
  border: 0;
  border-radius: 0;
  resize: vertical;
  padding: 56px 62px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1.6;
}
.editor-preview {
  min-height: 38rem;
  margin: 0;
  border: 0;
}
.editor-outline {
  position: static;
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  gap: 0.1rem;
}
.outline-link {
  width: 100%;
  border: 0 !important;
  background: transparent !important;
  color: var(--link) !important;
  padding: 0.3rem 0.8rem;
  text-align: left;
  cursor: pointer;
}
.article-editor-title-centered,
.article-editor-footer-centered {
  max-width: 850px;
  margin-left: auto;
  margin-right: auto;
}
.editor-title-field label,
.editor-summary-field label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.editor-submit-row {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin: 1rem 0 2rem;
}
.editor-view-switch {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  cursor: pointer;
}
.editor-view-switch input {
  position: absolute;
  opacity: 0;
}
.switch-track {
  width: 2.6rem;
  height: 1.35rem;
  border-radius: 999px;
  background: #aaa;
  padding: 0.15rem;
}
.switch-knob {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: #fff;
  transition: 0.15s;
}
.editor-view-switch input:checked + .switch-track {
  background: #4f7385;
}
.editor-view-switch input:checked + .switch-track .switch-knob {
  transform: translateX(1.25rem);
}
.reference-dialog {
  width: min(48rem, calc(100% - 2rem));
  max-height: 80vh;
  padding: 0;
  border: 1px solid var(--line-dark);
  background: var(--surface);
}
.reference-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}
.reference-dialog-card {
  padding: 1rem;
}
.reference-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.reference-search-controls {
  display: grid;
  grid-template-columns: auto 10rem auto 1fr;
  gap: 0.5rem;
  align-items: center;
  margin: 1rem 0;
}
.reference-results {
  border: 1px solid var(--line);
  max-height: 28rem;
  overflow: auto;
}
.reference-result {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 0.2rem;
  padding: 0.7rem 0.8rem;
  background: var(--surface);
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.reference-result span {
  color: var(--muted);
  font-size: 0.85rem;
}
.reference-strength {
  padding: 8px 12px;
  margin: 0 auto 12px;
  max-width: 850px;
  border-left: 3px solid #879dac;
  background: #f8f6ef;
  color: var(--muted);
  font-size: 0.82rem;
}
.reference-strength.required {
  border-left-color: #b06b45;
}
.reference-strength.strong {
  border-left-color: #6f8d70;
  color: #4d6850;
}
.diff-view {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #191d1f;
  color: #eee;
  padding: 1rem;
}
.pagination {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 20px 0;
}
.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin: 14px 0;
}
.form-card label {
  display: block;
  font-weight: 700;
  margin-bottom: 5px;
}
@media (max-width: 980px) {
  .article-wide-frame,
  .article-editor-wide-frame {
    width: 100%;
    margin-left: 0;
    transform: none;
    grid-template-columns: 1fr;
  }
  .article-left-column,
  .article-centered,
  .editor-main-column,
  .article-right-column {
    grid-column: 1;
    width: 100%;
  }
  .article-toc {
    position: static;
  }
  .article-right-column {
    display: none;
  }
  .article-toolbar {
    width: 100%;
    margin-left: 0;
    transform: none;
  }
  .profile-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .wrap {
    padding-left: 12px;
    padding-right: 12px;
  }
  .category-row,
  .thread-row,
  .row {
    align-items: flex-start;
    flex-direction: column;
  }
  .stats {
    text-align: left;
  }
  .profile-heading {
    grid-template-columns: 60px 1fr;
  }
  .profile-avatar {
    width: 60px;
    height: 60px;
  }
  .profile-heading > a,
  .profile-heading > form {
    grid-column: 1/-1;
  }
  .article-editor {
    padding: 30px 24px;
  }
  .reference-search-controls {
    grid-template-columns: 1fr;
  }
}

/* v13: Word-like editors, title-first drafts, and draft management */
.editor-full-bleed {
  width: min(1480px, calc(100vw - 22px));
  margin-left: 50%;
  margin-right: 0;
  transform: translateX(-50%);
}
.docs-status-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}
.docs-summary-row {
  padding: 12px;
  background: #faf7f1;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.35rem;
}
.docs-summary-row label {
  font-weight: 700;
  font-size: 0.82rem;
}
.docs-summary-row input {
  background: var(--surface);
}
.docs-view-switch {
  margin-left: auto;
}
.compact-button {
  padding: 0.38rem 0.58rem;
  font-size: 0.8rem;
}
.docs-top-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}
#editor-save-state,
#editor-save-state-bottom,
#post-save-state,
#post-save-state-bottom {
  font-weight: 600;
  color: #586366;
}

.title-prompt-backdrop {
  min-height: 60vh;
  display: grid;
  place-items: center;
  padding: 36px 12px;
}
.title-prompt-card {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(32, 36, 38, 0.1);
}
.title-prompt-card h1 {
  font-size: 1.55rem;
  margin: 0.2rem 0 0.4rem;
}
.title-prompt-kicker {
  font:
    700 0.74rem/1.2 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--link);
}
.title-prompt-form {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}
.title-prompt-form label {
  font-weight: 700;
}
.title-prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 8px;
}

.draft-board {
  overflow: visible;
}
.draft-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid #e4ded3;
  background: var(--surface);
}
.draft-row:first-of-type {
  border-top: 0;
}
.draft-main {
  min-width: 0;
}
.draft-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.draft-actions form {
  margin: 0;
}
.draft-rename {
  position: relative;
}
.draft-rename summary {
  list-style: none;
  cursor: pointer;
}
.draft-rename summary::-webkit-details-marker {
  display: none;
}
.draft-rename-form {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  width: 320px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(30, 35, 38, 0.14);
  display: grid;
  gap: 7px;
}
.draft-rename-form label {
  font-size: 0.78rem;
  font-weight: 700;
}
.danger-text {
  color: var(--danger) !important;
}

@media (max-width: 980px) {
  .editor-full-bleed {
    width: 100%;
    margin-left: 0;
    transform: none;
  }
  .docs-frame {
    grid-template-columns: 1fr;
  }
  .docs-sidebar,
  .docs-main {
    grid-column: 1;
  }
  .docs-sidebar {
    margin-bottom: 10px;
  }
  .docs-toolbar .docs-view-switch {
    margin-left: 0;
  }
}
@media (max-width: 700px) {
  .draft-row {
    grid-template-columns: 1fr;
  }
  .draft-actions {
    justify-content: flex-start;
  }
  .draft-rename-form {
    left: 0;
    right: auto;
    width: min(320px, calc(100vw - 44px));
  }
  .docs-statusbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .docs-status-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .docs-paper textarea,
  .docs-rendered {
    min-height: 68vh;
  }
}

/* v13 editor/draft completion */
.wrap.editor-page-content {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}
.page-content.editor-page-content {
  padding-top: 24px;
}
.title-prompt-page {
  min-height: 60vh;
  display: grid;
  place-items: center;
  padding: 36px 12px;
}
.title-prompt-card {
  display: grid;
  gap: 10px;
}
.title-prompt-card label {
  font-weight: 700;
}
.title-prompt-card input {
  width: 100%;
}
.docs-editor-footer-field {
  max-width: 930px;
  margin: 12px auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.docs-editor-footer-field label {
  display: block;
  font-weight: 700;
  margin-bottom: 5px;
}
.danger-outline {
  background: var(--surface) !important;
  color: var(--danger) !important;
  border-color: #b98f89 !important;
}
.danger-outline:hover {
  background: #f7ece9 !important;
  border-color: #9b625b !important;
}
.docs-paper.editor-view-panel {
  min-height: 880px;
}
.docs-paper .editor-preview {
  min-height: 880px;
}
.docs-main > .docs-statusbar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
}
@media (max-width: 700px) {
  .wrap.editor-page-content {
    padding-left: 0;
    padding-right: 0;
  }
  .docs-editor {
    width: calc(100vw - 14px);
  }
  .title-prompt-page {
    padding: 18px 10px;
  }
}

.editor-menu {
  position: relative;
}
.editor-menu > summary {
  cursor: pointer;
  padding: 6px 10px;
  list-style: none;
}
.editor-menu > summary::-webkit-details-marker {
  display: none;
}
.editor-menu[open] > summary,
.editor-menu > summary:hover {
  background: #eee9e0;
}
.editor-menu-items {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 30;
  min-width: 180px;
  padding: 6px;
  background: #fffdf8;
  border: 1px solid #cbc4b8;
  box-shadow: 0 5px 14px #0002;
}
.docs-menu .editor-menu-items button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
}
.editor-menu-items button:hover {
  background: #eee9e0;
}
.docs-toolbar button:disabled,
.editor-menu-items button:disabled {
  opacity: 0.4;
  cursor: default;
}
.editor-view-panel[hidden] {
  display: none !important;
}
.reference-dialog {
  max-width: min(640px, 92vw);
}
.reference-dialog::backdrop {
  background: #0005;
}
.map-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.knowledge-map {
  touch-action: none;
}
.graph-node:focus,
.graph-node.selected {
  outline: 3px solid #985d30;
  outline-offset: 3px;
}
.comment-reply-context {
  margin: 8px 0;
}

/* Keep browsing and editor controls reachable on narrow screens. */
.browse-tabs,
.wiki-tabs,
.profile-tabs {
  flex-wrap: wrap;
}
.search-bar input,
.header-search input {
  min-width: 0;
}
.board-row > div,
.docs-main {
  min-width: 0;
}
.board-title,
.docs-document-name strong {
  overflow-wrap: anywhere;
}
@media (max-width: 700px) {
  .page-heading,
  .editor-checks {
    flex-wrap: wrap;
  }
  .docs-menu {
    flex-wrap: wrap;
  }
  .docs-toolbar {
    flex-wrap: wrap;
  }
  .docs-paper,
  .docs-paper textarea {
    width: 100%;
    min-width: 0;
  }
  .editor-menu-items {
    max-width: calc(100vw - 30px);
  }
}

.editor-menu:nth-last-child(-n + 2) .editor-menu-items {
  left: auto;
  right: 0;
}

.editor-view-switch {
  position: relative;
}
.editor-view-switch input {
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  left: 0;
  top: 0;
}
.editor-view-switch:focus-within .switch-track {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

/* Alignment stored by the document editor. */
.text-align-left {
  text-align: left;
}
.text-align-center {
  text-align: center;
}
.text-align-right {
  text-align: right;
}
.text-align-justify {
  text-align: justify;
}

.collapsible-heading {
  cursor: pointer;
}
.panel-form {
  padding: 14px;
}
.form-actions-end {
  text-align: right;
  margin-top: 10px;
}

/* Compact, quiet action bars keep forum text in the foreground. */
.interaction-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 6px 12px;
  margin: 0;
  background: var(--surface-alt);
  border-top: 1px solid var(--line);
}
.thread-post > .interaction-bar,
.comment > .interaction-bar {
  grid-column: 1 / -1;
}
.interaction-bar form {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
}
.interaction-bar button,
.interaction-bar a {
  width: auto;
  min-height: 28px;
  padding: 3px 7px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--muted) !important;
  background: transparent !important;
  border: 1px solid transparent;
  border-radius: 4px;
  text-decoration: none;
}
.interaction-bar button:hover,
.interaction-bar a:hover {
  color: var(--ink) !important;
  background: var(--paper-deep) !important;
  border-color: var(--line);
}
.interaction-bar select {
  width: auto;
  max-width: min(230px, 100%);
  min-height: 28px;
  margin: 0;
  padding: 3px 6px;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--surface);
  border-color: var(--line);
}
.thread-heading {
  display: block;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.thread-heading > div:first-child {
  padding: 14px 16px;
}
.thread-heading h1 {
  margin-top: 0;
}
.thread-post .thread-body {
  min-width: 0;
}
@media (pointer: coarse) {
  .interaction-bar button,
  .interaction-bar a,
  .interaction-bar select {
    min-height: 36px;
  }
}

.interaction-bar {
  font-size: 0.75rem;
  line-height: 1.4;
}
.text-item-card {
  padding: 0;
}
.article-body > .text-item-content {
  padding: 34px 40px 46px;
}
.post-body-card > .text-item-content {
  padding: 26px 30px;
}
.text-item-card > .interaction-bar {
  border-radius: 0 0 8px 8px;
}
.interaction-bar :is(button, a, select):focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}
@media (max-width: 800px) {
  .article-body.text-item-card,
  .post-body-card.text-item-card {
    padding: 0;
  }
  .text-item-card > .text-item-content {
    padding: 23px;
  }
}

.article-picker {
  width: min(520px, calc(100vw - 32px));
  max-height: 85dvh;
  overflow-y: auto;
  padding: 24px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.article-picker::backdrop {
  background: #20252988;
}
.article-picker h2 {
  margin-top: 0;
}
.article-picker-results {
  display: grid;
  gap: 6px;
  max-height: 40vh;
  overflow-y: auto;
}
.article-picker-results button {
  justify-content: flex-start;
  text-align: left;
  overflow-wrap: anywhere;
  color: var(--ink);
  background: var(--surface-alt);
  border-color: var(--line);
  font-weight: 500;
}
.article-picker-results button[aria-pressed='true'] {
  background: var(--blue-soft);
  border-color: var(--link);
}
.article-picker-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.article-picker button:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Reference web: circular ideas with readable labels beneath them. */
.knowledge-map .graph-node {
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 8px;
  border: 2px solid var(--line-dark);
  border-radius: 50%;
  text-align: center;
  background: var(--surface);
  box-shadow: 0 0 26px #355f7715;
}
.knowledge-map .graph-node.article {
  border-color: var(--link);
  background: var(--blue-soft);
}
.knowledge-map .graph-node.thread {
  border-color: var(--action);
}
.knowledge-map .graph-node.post {
  border-color: var(--reference-green);
}
.knowledge-map .graph-node.comment,
.knowledge-map .graph-node.reply {
  border-color: var(--muted);
  background: var(--surface-alt);
}
.knowledge-map .graph-node strong {
  position: absolute;
  top: calc(100% + 10px);
  width: 190px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.4;
}
.knowledge-map .graph-node .node-type {
  margin: 0;
  font-size: 10px;
}
.node-count {
  font-size: 12px;
  color: var(--link);
}
.knowledge-map .edge {
  stroke-width: 1.5;
  opacity: 0.55;
}
.knowledge-map .edge.reference {
  stroke-width: 2;
  opacity: 0.7;
}
.knowledge-map .edge.reply {
  stroke-dasharray: 5 5;
}

.map-page {
  max-width: none;
  width: 100%;
  padding: 24px;
}
.map-page .knowledge-map {
  height: max(480px, calc(100dvh - 260px));
  border: 1px solid var(--line);
  border-radius: 8px;
}
.map-page .map-controls button {
  background: var(--surface);
  color: var(--muted);
  border-color: var(--line);
  padding: 5px 10px;
  font-size: 0.8rem;
}

/* Text-backed figures and their accessible data tables. */
.document-graph {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid #d1d8df;
  border-radius: 8px;
  background: #fff;
  color: #253343;
  scroll-margin-top: 2rem;
}
.document-graph img {
  display: block;
  width: 100%;
  height: auto;
}
.document-graph figcaption {
  font-weight: 650;
  margin: 0.6rem 0;
}
.document-graph:target {
  outline: 3px solid #447da5;
  outline-offset: 3px;
}
.document-graph summary {
  cursor: pointer;
}
.graph-data {
  max-height: 26rem;
  overflow: auto;
  margin: 0.75rem 0;
}
.graph-data table {
  border-collapse: collapse;
  width: 100%;
}
.graph-data th,
.graph-data td {
  padding: 0.4rem 0.7rem;
  border: 1px solid #d1d8df;
  text-align: left;
}
.graph-error {
  color: #9d281d;
  font-weight: 600;
}

/* Focus follows incoming and outgoing references; unrelated ideas remain in the background. */
.knowledge-map .graph-node.unconnected {
  opacity: 0.18;
  filter: blur(3px);
}
.knowledge-map .graph-node.connected {
  z-index: 2;
}
.knowledge-map .graph-node.selected {
  outline: 3px solid var(--action);
  outline-offset: 5px;
  border-color: var(--action);
}
.knowledge-map .has-focus .edge {
  opacity: 0.08;
}
.knowledge-map .has-focus .edge.highlighted {
  stroke: var(--action);
  stroke-width: 3;
  opacity: 1;
}

/* Reading pages share the forum's central column and content sizing. */
.post-page {
  width: 100%;
  max-width: none;
}
.reading-layout {
  position: relative;
  width: 100%;
  margin: 0;
}
.reading-layout > .text-item-card {
  width: 100%;
  min-width: 0;
}
.article-heading,
.post-header {
  padding: 14px 16px;
  margin: 0 0 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.article-heading h1,
.post-header h1,
.thread-heading h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 0.35rem;
}
.reading-layout .text-item-content {
  padding: 26px 30px;
  line-height: 1.7;
}
.reading-layout .text-item-content > :first-child {
  margin-top: 0;
}
.reading-layout .text-item-content :is(h2, h3) {
  margin-top: 1.65rem;
}
.reading-layout .text-item-content h2 {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.32rem;
}
.reading-contents {
  margin: 0 0 16px;
  text-align: left;
}
.reading-toc {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.reading-toc summary {
  padding: 10px 12px;
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--link);
  cursor: pointer;
  text-align: left;
}
.reading-toc nav {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}
.reading-toc a {
  display: block;
  padding: 5px 12px;
  color: var(--link);
  font-size: 0.84rem;
  text-align: left;
  overflow-wrap: anywhere;
}
.reading-toc .toc-level-2 {
  padding-left: 22px;
}
.reading-toc .toc-level-3 {
  padding-left: 32px;
}
.reading-toc :is(.toc-level-4, .toc-level-5, .toc-level-6) {
  padding-left: 40px;
}
@media (min-width: 1680px) {
  .reading-contents {
    position: absolute;
    right: calc(100% + 24px);
    top: 0;
    width: 210px;
  }
}
@media (max-width: 700px) {
  .reading-layout .text-item-content {
    padding: 20px 16px;
  }
  .article-heading h1,
  .post-header h1,
  .thread-heading h1 {
    font-size: 1.65rem;
  }
}
.reading-layout .text-item-content {
  min-width: 0;
  overflow-wrap: anywhere;
}
.reading-layout .text-item-content pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 14px;
  background: var(--code);
  color: #fff;
  border-radius: 6px;
}
.reading-layout .text-item-content pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}
.reading-layout .text-item-content img {
  max-width: 100%;
  height: auto;
}

.wiki-tabs[data-content-tabs] {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  width: 100%;
}
.wiki-tabs[data-content-tabs] a {
  padding: 10px 12px;
}
#document-section {
  min-width: 0;
}
#document-section[aria-busy='true'] {
  opacity: 0.65;
}
.post-revision {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.post-revision summary {
  cursor: pointer;
}
.post-revision pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.85rem;
}

.mail-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.mail-row > div {
  min-width: 0;
}
.mail-unread > div > a {
  font-weight: 700;
}
.mail-row time {
  flex-shrink: 0;
  font-size: 0.8rem;
}
.mail-recipient-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.mail-recipient-row input {
  flex: 1 1 240px;
  min-width: 0;
  margin: 0;
}
.mail-recipient-row button {
  flex: 0 0 auto;
  margin: 0;
}
.mail-compose textarea {
  min-height: 280px;
}
.mail-reference-picker {
  margin: 16px 0;
}
.mail-reference-picker summary {
  cursor: pointer;
  color: var(--link);
}
#mail-reference-results {
  display: grid;
  gap: 6px;
  max-height: 300px;
  overflow: auto;
}
#mail-reference-results button {
  justify-content: flex-start;
  text-align: left;
}
.mail-body {
  overflow-wrap: anywhere;
}
.mail-body pre {
  overflow-x: auto;
}
@media (max-width: 700px) {
  .mail-row {
    flex-direction: column;
    gap: 4px;
  }
}

.knowledge-map .has-focus .edge.outgoing {
  stroke: var(--reference-green);
  stroke-width: 3;
  opacity: 1;
}
.map-reference-incoming { color: var(--action); font-weight: 600; }
.map-reference-outgoing { color: var(--reference-green); font-weight: 600; }

.map-heading-help { position: relative; display: flex; align-items: center; gap: .7rem; }
.map-heading-help h1 { margin: 0; }
.map-help-button { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; padding: 0; border-radius: 50%; font-weight: 700; }
.map-help-tooltip { position: absolute; left: 0; top: 100%; z-index: 20; width: min(30rem, calc(100vw - 3rem)); padding: 1rem; background: var(--surface); color: var(--ink); border: 1px solid var(--line-dark); border-radius: .4rem; box-shadow: 0 4px 16px #20252926; font-size: .9rem; line-height: 1.6; }
.map-help-tooltip[hidden] { display: none; }

#download-progress { display: block; width: 100%; margin-top: 1rem; }
#download-progress[hidden] { display: none; }
#download-upload input[type="file"] { max-width: 100%; }

.downloads-page .form-card { overflow-wrap: anywhere; }

#download-cancel[hidden] { display: none; }
