: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;
  --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:.35rem;
  padding:.56rem .82rem;
  border:1px solid var(--action);
  border-radius:7px;
  background:var(--action);
  color:#fff;
  cursor:pointer;
  text-decoration:none;
  font-weight:650;
  font-size:.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:.65rem .72rem;
}
textarea{resize:vertical}
h1,h2,h3,h4{line-height:1.2;color:#1e2529}
h1{margin:0 0 .35rem;font-size:2rem;letter-spacing:-.02em}
h2{font-size:1.35rem;margin:1.65rem 0 .7rem}
h3{font-size:1.08rem;margin:1.35rem 0 .55rem}
p{margin:.65rem 0}
.muted{color:var(--muted)}
.small{font-size:.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:.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:.86rem}
.breadcrumbs,.crumbs{color:var(--muted);font-size:.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:.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:.76rem;
  text-transform:uppercase;
  letter-spacing:.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:.84rem}
.board-num{text-align:center;color:var(--muted);font-size:.82rem}
.board-latest{font-size:.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:.48rem .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:.55rem;margin-bottom:18px}

.hero{
  display:grid;
  grid-template-columns:1.2fr .9fr;
  gap:38px;
  align-items:center;
  padding:44px 0 34px;
}
.hero h1{font-size:2.9rem}
.hero-actions{display:flex;gap:.65rem;margin-top:18px}
.hero-note{
  border-left:4px solid #587d90;
  background:rgba(255,253,248,.55);
  padding:17px 20px;
}
.hero-note dl{display:grid;grid-template-columns:85px 1fr;gap:.5rem .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 .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:.86rem;
}
.toc nav{display:flex;flex-direction:column;padding:6px 0}
.toc a{padding:.34rem .8rem;font-size:.84rem;color:#4b5960}
.toc .l3{padding-left:1.5rem;font-size:.8rem}

.wiki-tabs{
  display:flex;
  gap:0;
  border-bottom:1px solid var(--line);
  margin-bottom:15px;
}
.wiki-tabs a{
  padding:.5rem .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:.45rem;flex-wrap:wrap}
.article-meta{
  display:flex;
  gap:16px;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:.8rem;
  padding:.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:.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:.08rem .25rem}
.article-body pre code{background:transparent}
.article-body blockquote{border-left:3px solid #7894a1;padding:.15rem 1rem;margin:1rem 0;color:#555}
.article-tools{
  display:flex;
  gap:.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:.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:.5rem 0;border-bottom:1px solid #ece6dc}
.tabs{display:flex;gap:4px;margin-bottom:12px}
.tabs a{padding:.5rem .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:.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:.35rem .55rem}
.docs-toolbar{display:flex;align-items:center;gap:.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:.32rem .48rem}
.docs-toolbar button:hover{background:#e2ddd4;border-color:#c8c1b7}
.docs-toolbar select{background:var(--surface);border-color:var(--line-dark);padding:.3rem .42rem}
.docs-toolbar .tool-group{display:flex;gap:.1rem}.docs-toolbar .tool-separator{width:1px;height:24px;background:#cfc8bd;margin: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:.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,.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:.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,.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:.55rem .7rem}.hidden{display:none!important}
.footer{max-width:1180px;margin:auto;padding:24px 22px 40px;color:#7b7e7d;font-size:.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:.98rem;
  margin-bottom:5px;
}

.home-random-article span{
  display:block;
  color:var(--muted);
  font-size:.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:.45rem .66rem;
  background:var(--surface);
  border:1px solid var(--line);
  color:var(--muted);
  border-radius:6px;
  font-size:.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,.45),rgba(255,255,255,.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,.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(80,90,94,.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:.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,.08);
}

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

.map-node span{
  display:block;
  color:var(--muted);
  font-size:.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:.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:.9rem;
}

.map-legend-row{
  display:flex;
  align-items:center;
  gap:8px;
  margin:7px 0;
  color:var(--muted);
  font-size:.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:.82rem;
}

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

.map-note{
  margin-top:12px;
  color:var(--muted);
  font-size:.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,.35),rgba(255,255,255,.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,.1);
  text-align:left;
  cursor:pointer;
}

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

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

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

.graph-node.post{
  border-left:5px solid #7e8e5f;
}

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

.node-type{
  display:block;
  margin-bottom:4px;
  color:var(--muted);
  font-size:.69rem;
  text-transform:uppercase;
  letter-spacing:.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,.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:.72rem;
  text-transform:uppercase;
  letter-spacing:.05em;
  padding-right:28px;
}

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

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

.node-viewer-meta{
  margin:12px 0;
  padding-top:10px;
  border-top:1px solid #e4ded3;
  color:var(--muted);
  font-size:.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:.42rem .62rem;
  border-color:#4f575b;
  background:#2a3033;
  color:#f4f4f2;
  border-radius:6px;
  font-size:.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:.68rem;
  font-weight:700;
}

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

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

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

.health-tag{
  display:inline-block;
  padding:.22rem .48rem;
  border:1px solid #c8bfae;
  border-radius:999px;
  background:#f8f2e7;
  color:#6f5f47;
  font-size:.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:.8rem;
}

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

.accepted-answer{
  border-color:#99b3a1;
  box-shadow:0 0 0 2px rgba(94,132,104,.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:.42rem .62rem;
  font-size:.82rem;
}

.answer-candidate{
  color:#52725a;
  font-size:.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:.72rem;
  text-transform:uppercase;
  letter-spacing:.04em;
  margin-bottom:2px;
}

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

.result-snippet{
  color:#5f6567;
  margin-top:3px;
  font-size:.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:.78rem;
  white-space:nowrap;
}

.saved-type{
  display:inline-block;
  margin-right:7px;
  color:var(--muted);
  font-size:.72rem;
  text-transform:uppercase;
  letter-spacing:.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:.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:.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:.8rem;
}

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

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

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

.activity-type{
  color:var(--muted);
  width:90px;
  font-size:.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:.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:.4rem}
.post-author-line{display:flex;align-items:center;gap:10px;flex-wrap:wrap;color:var(--muted);font-size:.84rem}
.post-owner-badge{display:inline-block;padding:.18rem .42rem;border-radius:999px;background:#e8eef1;color:#2f5568;font-size:.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:.32rem}
.post-meta-bar{display:flex;gap:16px;flex-wrap:wrap;margin:12px 0 14px;color:var(--muted);font-size:.8rem}
.post-actions-row{display:flex;gap:.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:.82rem}.comment-body{padding:12px 14px}
.comment-meta{display:flex;justify-content:space-between;color:var(--muted);font-size:.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}}
.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:.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:.5rem}.home-random-board{margin-top:30px}.home-random-board .board-row{grid-template-columns:minmax(0,1fr) 180px;min-height:78px}.home-grid{grid-template-columns:repeat(4,1fr)}@media(max-width:850px){.home-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:600px){.wrap{padding-left:12px;padding-right:12px}.home-grid{grid-template-columns:1fr}.home-random-board .board-row{grid-template-columns:1fr}}

/* Functional editor menus and status. */
.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: .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; }

/* Keep all header controls on a common vertical center and text baseline. */
.site-header .main-nav,
.site-header .account-nav {
  align-items: center;
}
.site-header .main-nav > a,
.site-header .account-nav > a,
.site-header .account-nav .link-button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.4;
}
.site-header .account-nav form,
.site-header .header-search {
  display: flex;
  align-items: center;
  margin-top: 0;
  margin-bottom: 0;
}
.site-header .header-search input {
  margin: 0;
}
.site-header .account-nav .link-button {
  color: #d9dfe1 !important;
  border: 0;
}
.site-header .account-nav .link-button:hover {
  color: #fff !important;
  text-decoration: underline;
}

.hero.home-hero { grid-template-columns: 1fr; }
