/* forums.free — Mailchimp-inspired: Cavendish yellow, warm ink, cream paper,
   chunky Fraunces serif headlines, solid black buttons, highlighter accents. */
:root {
  --paper: #fffaf0;      /* warm cream canvas */
  --ink: #241c15;        /* Mailchimp near-black */
  --ink-soft: #4a4139;
  --yellow: #ffe01b;     /* Cavendish yellow */
  --yellow-dk: #f2d000;
  --mint: #d9f3ea;       /* soft secondary tints */
  --peach: #ffe6d5;
  --muted: #8b8378;
  --card: #ffffff;
  --line: #e7e0d3;       /* warm hairline border */
  --line-2: #d8cfbe;
  --radius: 14px;
  --shadow: 0 2px 0 var(--line-2);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }

/* topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px clamp(16px, 5vw, 40px);
  position: sticky; top: 0; z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 900; font-size: 1.3rem; }
.brand b { position: relative; font-weight: 900; }
.brand b::after { content: ""; position: absolute; left: -2px; right: -2px; bottom: 2px; height: 8px; background: var(--yellow); z-index: -1; border-radius: 2px; }
.topnav { display: flex; align-items: center; gap: 10px; }
.nav-link { text-decoration: none; color: var(--ink); font-weight: 700; font-size: .95rem; padding: 6px 4px; }
.nav-link:hover { text-decoration: underline; text-decoration-color: var(--yellow-dk); text-decoration-thickness: 2px; }
.whoami { color: var(--ink-soft); font-weight: 600; font-size: .92rem; }
.nav-bell { display: inline-flex; align-items: center; gap: 2px; }
.bell-badge { background: #e23d6a; color: #fff; border-radius: 999px; font-size: .66rem; font-weight: 800; padding: 0 5px; min-width: 16px; text-align: center; margin-left: 3px; }
.nav-div { width: 1px; align-self: stretch; background: var(--line); margin: 4px 4px; }
.topnav { flex-wrap: wrap; row-gap: 6px; }

/* notifications page */
.note-list { display: grid; gap: 8px; }
.note { display: flex; gap: 11px; align-items: flex-start; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.note:hover { border-color: var(--ink); }
.note.unread { background: #fffdf3; border-color: var(--ink); }
.note-av { flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: .9rem; color: var(--ink); background: var(--yellow); border: 1.5px solid var(--ink); }
.note-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.note-snippet { color: var(--ink-soft); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-time { color: var(--muted); font-size: .76rem; }
.note .unread-dot { color: var(--yellow-dk); font-size: .6rem; margin-top: 6px; }
.inline { display: inline; margin: 0; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-weight: 700; cursor: pointer; line-height: 1.1;
  border: 2px solid var(--ink); border-radius: 10px; padding: 9px 17px;
  text-decoration: none; color: var(--ink); background: #fff;
  transition: transform .1s ease, box-shadow .1s ease, background .1s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 3px 3px 0 var(--ink); }
.btn:active { transform: translateY(0); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-yellow:hover { background: var(--yellow-dk); }
.btn-ghost { border-color: var(--line-2); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); box-shadow: none; transform: translateY(-1px); }
.btn-lg { padding: 13px 26px; font-size: 1.05rem; }
.btn-tiny { padding: 5px 11px; font-size: .82rem; border-radius: 8px; border-width: 1.5px; }
.btn-danger { border-color: #e2b8b8; color: #b23b3b; }
.btn-danger:hover { background: #fbeaea; box-shadow: 3px 3px 0 #e2b8b8; }
.badge { background: var(--ink); color: var(--yellow); border-radius: 999px; padding: 0 7px; font-size: .72rem; font-weight: 800; }

/* layout */
.wrap { max-width: 960px; margin: 0 auto; padding: 24px clamp(16px, 5vw, 24px) 56px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 18px 20px; }

/* flashes */
.flashes { max-width: 960px; margin: 14px auto 0; padding: 0 16px; display: grid; gap: 8px; }
.flash { padding: 11px 16px; border-radius: 10px; font-weight: 600; border: 1px solid var(--ink); }
.flash-success { background: var(--mint); }
.flash-error { background: #ffe0e0; }
.flash-info { background: #fff6cc; }

/* hero */
.hero { text-align: center; padding: 34px 0 26px; }
.mascot { display: block; width: 150px; height: auto; margin: 0 auto 6px; transform-origin: 50% 100%; animation: bob 4s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-8px) rotate(1.5deg); } }
@media (prefers-reduced-motion: reduce) { .mascot { animation: none; } }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 900; margin: 0 0 14px; line-height: 1.05; }
.wiggle { position: relative; white-space: nowrap; }
.wiggle::after { content: ""; position: absolute; left: -4px; right: -4px; bottom: 4px; height: 14px; background: var(--yellow); z-index: -1; transform: rotate(-1deg); border-radius: 3px; }
.lede { color: var(--ink-soft); font-size: 1.15rem; max-width: 540px; margin: 0 auto 24px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* error pages (404 / 500) */
.errpage { text-align: center; padding: 40px 20px 48px; max-width: 560px; margin: 0 auto; }
.errpage .mascot { width: 118px; }
.errcode { position: relative; display: inline-block; font-family: var(--serif); font-weight: 900;
           font-size: clamp(3.6rem, 15vw, 6rem); line-height: .9; margin: 4px 0 6px; letter-spacing: -.02em; }
.errcode::after { content: ""; position: absolute; left: -8px; right: -8px; bottom: 10px; height: 20px;
                  background: var(--yellow); z-index: -1; transform: rotate(-1.5deg); border-radius: 4px; }
.errpage h1 { font-size: clamp(1.5rem, 5vw, 2.1rem); font-weight: 900; margin: 6px 0 12px; line-height: 1.1; }
.errpage p { color: var(--ink-soft); font-size: 1.1rem; max-width: 440px; margin: 0 auto 24px; }

/* sections + grid */
.section { margin-top: 34px; }
.section-title { font-size: 1.3rem; font-weight: 600; margin: 0 0 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }

/* forum cards */
.forum-card { display: flex; gap: 12px; padding: 16px; text-decoration: none; color: var(--ink); align-items: flex-start; }
.forum-card:hover { transform: translateY(-2px); box-shadow: 4px 4px 0 var(--ink); border-color: var(--ink); }
.forum-emoji { font-size: 1.8rem; line-height: 1; flex-shrink: 0; }
.forum-emoji.big { font-size: 1.9rem; width: 54px; height: 54px; display: grid; place-items: center; background: var(--yellow); border: 1.5px solid var(--ink); border-radius: 13px; }
.forum-meta h3 { margin: 0 0 3px; font-size: 1.1rem; }
.forum-meta p { margin: 0 0 8px; color: var(--ink-soft); font-size: .9rem; font-family: var(--sans); }
.stat-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--muted); font-size: .82rem; font-weight: 600; }
.stat-row > span { white-space: nowrap; }

/* pills + chips */
.pill { display: inline-block; font-size: .7rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; border: 1.5px solid var(--ink); text-transform: uppercase; letter-spacing: .02em; }
.pill-public { background: var(--mint); color: var(--ink); }
.pill-private { background: var(--peach); color: var(--ink); }
.pill-role { background: #fff; color: var(--ink); }
.role-owner { background: var(--yellow); }
.role-moderator { background: var(--mint); }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #fff; color: var(--ink); text-decoration: none; font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1.5px solid var(--line-2); }
.chip:hover { border-color: var(--ink); background: #fffbea; }
.chip-topic { background: var(--yellow); border-color: var(--ink); }
.chip-lg { font-size: .95rem; padding: 7px 14px; }
.count { background: rgba(0,0,0,.07); border-radius: 999px; padding: 0 7px; font-size: .75rem; }

/* auth/forms */
.auth-card { max-width: 410px; margin: 34px auto; padding: 30px; text-align: center; }
.auth-card.wide { max-width: 540px; text-align: left; }
.auth-emoji { font-size: 2.3rem; margin-bottom: 4px; }
.auth-card h1 { margin: 0 0 5px; font-size: 1.7rem; font-weight: 900; }
.stack { display: grid; gap: 13px; text-align: left; margin-top: 16px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 700; font-size: .88rem; }
.field-check { grid-auto-flow: column; justify-content: start; align-items: center; gap: 10px; }
input, textarea, select {
  font: inherit; width: 100%; padding: 11px 13px; border: 2px solid var(--line-2);
  border-radius: 10px; background: #fff; color: var(--ink); transition: border-color .12s;
}
input[type="checkbox"] { width: auto; accent-color: var(--ink); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--yellow); }
textarea { resize: vertical; }
.err { color: #b23b3b; font-size: .82rem; font-style: normal; }
.muted { color: var(--muted); }
.center { text-align: center; }
a { color: var(--ink); text-decoration-color: var(--yellow-dk); text-decoration-thickness: 2px; text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--ink); }

/* forum chrome */
.forum-head { display: flex; gap: 14px; padding: 18px 20px; align-items: center; margin-bottom: 14px; }
.forum-head-meta { flex: 1; min-width: 0; }
.forum-head-meta h1 { margin: 0 0 5px; font-size: 1.45rem; font-weight: 900; line-height: 1.15; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tagline { color: var(--ink-soft); margin: 0 0 6px; font-size: .92rem; }
.rss-link { text-decoration: none; color: var(--muted); font-weight: 700; font-size: .8rem; }
.rss-link:hover { color: var(--ink); }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; border-bottom: 2px solid var(--line); padding-bottom: 0; }
.tab { text-decoration: none; color: var(--ink-soft); font-weight: 700; font-size: .92rem; padding: 8px 14px; border-radius: 8px 8px 0 0; margin-bottom: -2px; border-bottom: 3px solid transparent; }
.tab:hover { color: var(--ink); background: #fffbea; }
.tab.on { color: var(--ink); border-bottom-color: var(--yellow); }

/* composer */
.composer { padding: 14px; margin-bottom: 14px; }
.composer textarea { margin-bottom: 9px; }
.composer-row { display: flex; gap: 8px; flex-wrap: wrap; }
.composer-row input { flex: 1; min-width: 120px; padding: 9px 12px; }
.composer-row .btn { flex-shrink: 0; }

/* messages wall */
.wall { display: grid; gap: 9px; }
.msg { display: flex; gap: 11px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.msg:hover { border-color: var(--line-2); }
.msg-avatar { flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: .95rem; color: var(--ink); background: var(--yellow); border: 1.5px solid var(--ink); }
.msg-avatar.small { width: 30px; height: 30px; font-size: .82rem; }
.msg-body { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 3px; }
.msg-author { font-weight: 800; }
.msg-time { color: var(--muted); font-size: .78rem; }
.msg-text { white-space: normal; word-wrap: break-word; }
.msg-text > br:first-child { display: none; }
/* rendered markdown */
.msg-text code { background: rgba(0,0,0,.06); border-radius: 5px; padding: 1px 5px; font-size: .9em; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.msg-text pre.code-block { background: #2b2115; color: #fdf6e3; padding: 11px 13px; border-radius: 10px; overflow-x: auto; margin: 8px 0; }
.msg-text pre.code-block code { background: none; color: inherit; padding: 0; }
.msg-text blockquote { margin: 6px 0; padding: 4px 12px; border-left: 3px solid var(--yellow); color: var(--ink-soft); }
.msg-text a { text-decoration-color: var(--yellow-dk); }
.msg-text .mention { color: var(--ink); font-weight: 700; background: var(--mint); border-radius: 5px; padding: 0 3px; }
.msg-edit { background: none; border: none; cursor: pointer; font-size: .85rem; border-radius: 8px; width: 26px; height: 26px; opacity: .5; }
.msg-edit:hover { opacity: 1; background: #fffbea; }
/* inline editor */
.edit-box { margin-top: 6px; display: grid; gap: 8px; }
.edit-ta { width: 100%; min-height: 70px; }
.edit-actions { display: flex; gap: 8px; }
.msg-tags { margin-top: 7px; display: flex; gap: 6px; flex-wrap: wrap; }
.msg-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.msg-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: .9rem; border-radius: 8px; width: 26px; height: 26px; }
.msg-del:hover { background: #ffe0e0; color: #b23b3b; }
.pin-btn { background: none; border: none; cursor: pointer; font-size: .95rem; line-height: 1; padding: 4px; border-radius: 8px; opacity: .4; filter: grayscale(1); }
.pin-btn:hover { opacity: 1; filter: none; background: #fffbea; }
.pin-btn.on { opacity: 1; filter: none; }
.chip-pin { background: var(--yellow); border-color: var(--ink); font-weight: 800; }
.thread-card.pinned { border-color: var(--ink); box-shadow: 2px 2px 0 var(--line-2); }

/* wall toolbar: in-forum search + new message */
.wall-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.wall-search { flex: 1; }
.new-msg-btn { flex-shrink: 0; }
.chip-reply { background: var(--mint); border-color: var(--ink); }

/* new message page */
.new-message-page .section-title { margin-bottom: 14px; }
.new-msg-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.new-msg-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
@media (max-width: 560px) {
  .new-msg-meta { grid-template-columns: 1fr; }
  .wall-toolbar { flex-wrap: wrap; }
}

/* wall sort control */
.wall-sort { display: flex; gap: 4px; margin-bottom: 12px; }
.sort-link { text-decoration: none; color: var(--ink-soft); font-weight: 700; font-size: .88rem; padding: 5px 12px; border-radius: 999px; border: 1.5px solid transparent; }
.sort-link:hover { background: #fffbea; color: var(--ink); }
.sort-link.on { background: var(--ink); color: #fff; }

/* wall: clickable thread cards */
.thread-card { display: flex; gap: 11px; text-decoration: none; color: var(--ink); padding: 13px 15px; }
.thread-card:hover { transform: translateY(-2px); box-shadow: 4px 4px 0 var(--ink); border-color: var(--ink); }
.tc-body { flex: 1; min-width: 0; }
.tc-snippet { margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tc-foot { margin-top: 9px; color: var(--muted); font-weight: 700; font-size: .82rem; }
.thread-card .chip { pointer-events: none; }

/* thread detail page */
.back-link { display: inline-block; margin-bottom: 12px; font-weight: 700; text-decoration: none; color: var(--ink-soft); }
.back-link:hover { color: var(--ink); }
.thread-detail .msg.thread { margin-bottom: 4px; }
.thread-replies { margin-top: 12px; }

/* like / save actions */
.msg-social { display: flex; gap: 8px; margin-top: 9px; }
.react-btn { display: inline-flex; align-items: center; gap: 5px; background: #fff; border: 1.5px solid var(--line-2); border-radius: 999px; padding: 4px 11px; font: inherit; font-size: .82rem; font-weight: 700; color: var(--ink-soft); cursor: pointer; line-height: 1.1; transition: background .1s, border-color .1s, color .1s; }
.react-btn:hover { border-color: var(--ink); background: #fffbea; }
.react-btn.static { cursor: default; }
.react-btn.static:hover { border-color: var(--line-2); background: #fff; }
.react-ic { font-size: .98rem; line-height: 1; }
.react-btn.like.on { color: #e23d6a; border-color: #e23d6a; background: #ffeef2; }
.react-btn.save.on { color: var(--ink); border-color: var(--ink); background: var(--yellow); }
.react-btn.report { margin-left: auto; }
.react-btn.report.on { color: #b23b3b; border-color: #e2b8b8; background: #fbeaea; }
.member-handle { color: var(--muted); font-weight: 600; font-size: .85rem; }
.report-row { flex-wrap: wrap; gap: 8px; }
.report-info { flex: 1; min-width: 0; }

/* threaded replies */
.msg.thread { display: block; }
.msg-row { display: flex; gap: 11px; }
.msg-avatar.tiny { width: 28px; height: 28px; font-size: .76rem; border-radius: 8px; }
.replies { margin: 10px 0 0 47px; display: grid; gap: 8px; }
.replies:empty { margin: 0; }
.reply { display: flex; gap: 9px; padding: 9px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 11px; position: relative; }
.reply .msg-text { font-size: .95rem; }
.reply .msg-time { font-size: .74rem; }
.reply-form { margin: 14px 0 0 47px; }
.reply-compose { display: flex; flex-direction: column; gap: 8px; }
.reply-compose .reply-input { padding: 8px 13px; }
.reply-send { align-self: flex-end; }
@media (max-width: 560px) {
  .replies, .reply-form { margin-left: 16px; }
}

/* Lexical rich editor */
.ed-host { width: 100%; }
.ed-shell { border: 2px solid var(--line-2); border-radius: 12px; background: #fff; }
.ed-shell:focus-within { border-color: var(--ink); }
.ed-toolbar { display: flex; align-items: center; gap: 2px; padding: 5px 6px; border-bottom: 1px solid var(--line); background: var(--paper); border-radius: 10px 10px 0 0; flex-wrap: wrap; }
.ed-btn { border: none; background: none; cursor: pointer; font: inherit; font-size: .9rem; font-weight: 700; min-width: 30px; height: 28px; border-radius: 7px; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.ed-btn:hover { background: #fffbea; }
.ed-sep { width: 1px; height: 18px; background: var(--line-2); margin: 0 4px; }
.ed-mono { font-family: ui-monospace, Menlo, monospace; font-size: .76rem; }
.ed-input-wrap { position: relative; }
.ed-input { min-height: 64px; padding: 10px 13px; outline: none; line-height: 1.55; }
.ed-placeholder { position: absolute; top: 10px; left: 13px; color: var(--muted); pointer-events: none; user-select: none; }
.ed-p { margin: 0 0 6px; } .ed-p:last-child { margin-bottom: 0; }
.ed-bold { font-weight: 800; } .ed-italic { font-style: italic; }
.ed-code { background: rgba(0,0,0,.06); border-radius: 5px; padding: 1px 5px; font-family: ui-monospace, Menlo, monospace; font-size: .9em; }
.ed-quote { border-left: 3px solid var(--yellow); margin: 4px 0; padding: 2px 12px; color: var(--ink-soft); }
.ed-ul, .ed-ol { margin: 4px 0; padding-left: 22px; }
.ed-link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--yellow-dk); }

/* rendered markdown lists inside messages */
.msg-text ul.md-list, .msg-text ol.md-list { margin: 6px 0; padding-left: 22px; }
.msg-text li { margin: 2px 0; }

/* @mention autocomplete menu */
.mention-menu { position: absolute; top: 100%; left: 0; z-index: 60; margin-top: 4px; min-width: 210px; max-width: 300px; background: #fff; border: 1.5px solid var(--ink); border-radius: 11px; box-shadow: 4px 4px 0 var(--line-2); overflow: hidden; }
.mention-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; cursor: pointer; }
.mention-item.on { background: #fffbea; }
.mention-av { flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px; background: var(--yellow); border: 1.5px solid var(--ink); display: grid; place-items: center; font-weight: 800; font-size: .72rem; }
.mention-name { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mention-user { color: var(--muted); font-size: .8rem; margin-left: auto; white-space: nowrap; }

/* lists */
.label-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.label-list li { display: flex; justify-content: space-between; padding: 10px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.label-list a { text-decoration: none; font-weight: 700; }
.tag-cloud { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.member-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.member-name { font-weight: 700; }
.member-actions { margin-left: auto; display: flex; gap: 6px; }

/* forum dashboard — topic areas */
.dash-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.dash-head .dash-intro { min-width: 0; }
.dash-head .section-title { margin: 0; }
.dash-head .dash-intro .muted { margin: 5px 0 0; }
.dash-head .btn { flex: none; margin-top: 2px; }
.dash-head-actions { display: flex; gap: 8px; flex: none; margin-top: 2px; }

/* topic reordering (moderator) */
.reorder-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.reorder-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.reorder-row.dragging { opacity: .5; border-style: dashed; }
.drag-handle { cursor: grab; color: var(--muted); font-size: 1.2rem; line-height: 1; user-select: none; }
.reorder-row .topic-emoji { font-size: 1.3rem; }
.reorder-name { display: flex; flex-direction: column; font-weight: 700; min-width: 0; }
.reorder-name small { font-weight: 500; }
.reorder-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.move-btn { width: 28px; height: 28px; border: 1px solid var(--line-2); background: #fff; border-radius: 8px; cursor: pointer; font-size: .9rem; line-height: 1; color: var(--ink-soft); }
.move-btn:hover { border-color: var(--ink); background: #fffbea; }
.reorder-status { margin: 12px 0 0; color: #2e7d32; font-weight: 700; font-size: .9rem; opacity: 0; transition: opacity .2s ease; }
.reorder-status.show { opacity: 1; }
.topic-empty { text-align: center; padding: 44px 24px; display: flex; flex-direction: column; align-items: center; }
.topic-empty-emoji { font-size: 2.6rem; line-height: 1; }
.topic-empty h3 { font-family: var(--serif); font-weight: 900; font-size: 1.5rem; margin: 12px 0 0; }
.topic-empty p { color: var(--ink-soft); max-width: 430px; margin: 8px 0 18px; line-height: 1.6; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 4px; }
.topic-card { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; text-decoration: none; color: inherit; transition: transform .12s ease, box-shadow .12s ease; }
.topic-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(36,28,21,.10); }
.topic-card-head { display: flex; align-items: center; gap: 10px; }
.topic-emoji { font-size: 1.5rem; line-height: 1; }
.topic-name { font-family: var(--serif); font-weight: 900; font-size: 1.2rem; }
.topic-desc { color: var(--ink-soft); margin: 0; font-size: .95rem; line-height: 1.5; }
.topic-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: auto; padding-top: 6px; color: var(--muted); font-size: .86rem; font-weight: 600; }
.topic-header { margin-bottom: 16px; }
.topic-header .topic-title { margin: 0; font-size: 1.7rem; }
.topic-header .topic-desc { margin: 8px 0 0; font-size: 1.05rem; }
.topic-header .topic-stats { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .92rem; }
.topic-toolbar { justify-content: space-between; }
.topic-toolbar .wall-sort { margin-bottom: 0; }

/* topic form */
.topic-name-row { display: flex; gap: 12px; align-items: flex-start; }
.field-emoji { width: 84px; flex: none; }
.field-emoji input { text-align: center; font-size: 1.2rem; }
.locked-topic { display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; font-weight: 700; }

/* pages */
.page-list .count.page-edit { text-decoration: none; font-weight: 700; opacity: .7; }
.page-list .count.page-edit:hover { opacity: 1; }
.forum-page .page-title { margin: 0; font-size: 1.6rem; }
.forum-page .page-actions { display: flex; gap: 6px; align-items: center; }
.page-body { margin-top: 14px; font-size: 1rem; line-height: 1.7; }
.page-meta { margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: .82rem; }

/* settings */
.settings-grid { display: grid; gap: 16px; }
.danger-zone { border: 1.5px solid #eabcb3; background: #fdf6f4; }
.danger-zone .section-title { color: #b3261e; }
.danger-zone code { background: #fff; border: 1px solid var(--line-2); padding: 1px 6px; border-radius: 5px; font-size: .9em; }
.danger-zone .btn-danger[disabled] { opacity: .5; cursor: not-allowed; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.req-list, .invite-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.req-row, .invite-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; flex-wrap: wrap; }
.req-actions { margin-left: auto; display: flex; gap: 6px; }
.invite-url { flex: 1; min-width: 200px; font-size: .82rem; font-family: ui-monospace, monospace; }

/* analytics */
.an-wrap > .section-title { margin-bottom: 16px; }
.an-block { margin-bottom: 16px; }
.an-h3 { margin: 0 0 12px; font-size: 1.05rem; font-family: var(--sans); font-weight: 800; }
.an-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.an-stat { text-align: center; padding: 16px 10px; }
.an-num { font-family: var(--serif); font-weight: 900; font-size: 1.9rem; line-height: 1; }
.an-label { color: var(--muted); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; margin-top: 6px; }
.an-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.an-grid .an-block { margin-bottom: 0; }

.an-legend { color: var(--muted); font-size: .82rem; font-weight: 600; margin-bottom: 10px; }
.an-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; border: 1px solid var(--ink); vertical-align: middle; }
.dot-msg { background: var(--yellow); }
.dot-usr { background: var(--mint); }
.an-chart { display: flex; align-items: flex-end; gap: 5px; height: 140px; }
.an-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.an-bars { flex: 1; display: flex; align-items: flex-end; gap: 2px; width: 100%; justify-content: center; }
.an-bar { width: 42%; min-height: 2px; border: 1px solid var(--ink); border-bottom: none; border-radius: 3px 3px 0 0; }
.bar-msg { background: var(--yellow); }
.bar-usr { background: var(--mint); }
.an-x { font-size: .68rem; color: var(--muted); margin-top: 4px; }

.an-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.an-table th { text-align: left; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; padding-bottom: 6px; }
.an-table td { padding: 6px 0; border-top: 1px solid var(--line); }
.an-td-num { text-align: right; font-weight: 700; white-space: nowrap; }
.an-list { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 7px; }
.an-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.an-list a, .an-query { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-list ol, ol.an-list { counter-reset: rank; }
.an-pill { flex-shrink: 0; background: var(--paper); border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 9px; font-size: .76rem; font-weight: 700; color: var(--ink-soft); }
.an-meter-row { display: grid; grid-template-columns: 108px 1fr 42px; align-items: center; gap: 10px; font-size: .9rem; margin-bottom: 8px; }
.an-meter-row b { text-align: right; }
.an-meter { height: 12px; background: var(--paper); border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; }
.an-meter > span { display: block; height: 100%; background: var(--yellow); }
.an-note { margin: 10px 0 0; font-size: .84rem; }
@media (max-width: 700px) {
  .an-stats { grid-template-columns: 1fr 1fr; }
  .an-grid { grid-template-columns: 1fr; }
}

/* dashboard */
.wrap.wrap-wide { max-width: 1000px; }
.dash-layout { display: grid; grid-template-columns: 220px 1fr; gap: 26px; align-items: start; }
.dash-greeting { margin: 2px 0 14px; }

/* dashboard tabs */
.dash-tabbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--line); margin-bottom: 16px; }
.dash-tabs { display: flex; gap: 4px; }
.dash-tab { background: none; border: none; font: inherit; font-weight: 700; font-size: .95rem; color: var(--ink-soft); padding: 9px 14px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; border-radius: 8px 8px 0 0; }
.dash-tab:hover { color: var(--ink); background: #fffbea; }
.dash-tab.on { color: var(--ink); border-bottom-color: var(--yellow); }
.tab-count { background: rgba(0,0,0,.07); border-radius: 999px; padding: 0 7px; font-size: .78rem; font-weight: 800; }
.mark-read-form { margin-bottom: 7px; }
.dash-panel.is-hidden { display: none; }

/* sidebar */
.dash-sidebar { position: sticky; top: 78px; }
.side-title { font-family: var(--sans); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 10px; padding-left: 10px; }
.side-list { display: grid; gap: 2px; margin-bottom: 12px; }
.side-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .92rem; }
.side-item:hover { background: #fffbea; }
.side-item.unread { font-weight: 800; }
.side-emoji { font-size: 1.15rem; line-height: 1; flex-shrink: 0; }
.side-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item .unread-dot { color: var(--yellow-dk); font-size: .6rem; }
.side-new { display: block; padding: 8px 10px; border-radius: 10px; border: 2px dashed var(--line-2); text-decoration: none; color: var(--ink-soft); font-weight: 700; font-size: .9rem; text-align: center; }
.side-new:hover { border-color: var(--ink); color: var(--ink); }

/* welcome / empty state */
.welcome { text-align: center; padding: 32px 28px; margin-bottom: 30px; }
.welcome-mascot { display: block; margin: 0 auto 6px; }
.welcome h1 { margin: 0 0 8px; font-size: 1.7rem; font-weight: 900; }
.welcome-lede { color: var(--ink-soft); max-width: 460px; margin: 0 auto 20px; }

@media (max-width: 720px) {
  .dash-layout { grid-template-columns: 1fr; gap: 16px; }
  .dash-sidebar { position: static; }
  .side-list { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; gap: 6px; }
  .side-new { display: none; }
}

.dash-head { margin-bottom: 22px; }
.dash-head .section-title { margin-bottom: 6px; }
.dash-section { margin-bottom: 30px; }
.dash-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dash-section-head .section-title { margin: 0; }
.dash-sub { margin: -6px 0 12px; }
.dash-list { display: grid; gap: 9px; }
.dash-item { display: flex; gap: 11px; text-decoration: none; color: var(--ink); padding: 12px 14px; }
.dash-item:hover { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); transform: translateY(-1px); }
.dash-item.unread { border-color: var(--ink); background: #fffdf3; }
.dash-forum { font-weight: 700; font-size: .82rem; color: var(--ink-soft); }
.unread-dot { color: var(--yellow-dk); margin-left: auto; font-size: .7rem; }
.chip-new { background: var(--yellow); border-color: var(--ink); text-transform: uppercase; font-size: .68rem; letter-spacing: .03em; }
.dash-item .msg-head { align-items: center; }

/* template gallery + preview */
.tmpl-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tmpl-card { display: block; padding: 18px; text-decoration: none; color: var(--ink); }
.tmpl-card:hover { transform: translateY(-2px); box-shadow: 4px 4px 0 var(--ink); border-color: var(--ink); }
.tmpl-emoji { font-size: 2rem; line-height: 1; }
.tmpl-card h3 { margin: 8px 0 3px; font-size: 1.15rem; }
.tmpl-tagline { margin: 0 0 12px; color: var(--ink-soft); font-size: .92rem; }
.tmpl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-more { background: var(--paper); color: var(--muted); border-color: var(--line); }
.tmpl-scratch { text-align: center; margin-top: 24px; }
.tmpl-preview-head { display: flex; gap: 16px; align-items: center; margin-bottom: 6px; }
.tmpl-preview-meta h1 { margin: 0 0 2px; font-size: 1.6rem; font-weight: 900; }
.tmpl-desc { color: var(--ink-soft); }
.tmpl-sub { margin: 20px 0 10px; font-size: 1.05rem; }
.tmpl-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 24px; }
.tmpl-banner { background: #fff6cc; border: 1.5px solid var(--ink); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; font-size: .9rem; }

/* public profile */
.profile-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 20px; }
.profile-av { flex-shrink: 0; width: 64px; height: 64px; border-radius: 16px; background: var(--yellow); border: 2px solid var(--ink); display: grid; place-items: center; font-family: var(--serif); font-weight: 900; font-size: 1.8rem; }
.profile-meta { flex: 1; min-width: 0; }
.profile-meta h1 { margin: 0 0 2px; font-size: 1.5rem; font-weight: 900; }
.profile-handle { color: var(--muted); margin: 0 0 8px; font-weight: 600; font-size: .9rem; }
.profile-bio { margin: 0 0 10px; color: var(--ink-soft); }
.profile-stats { display: flex; gap: 16px; color: var(--muted); font-size: .9rem; }
.profile-stats b { color: var(--ink); }
.profile-edit { flex-shrink: 0; }
.msg-author a, a.msg-author { color: inherit; text-decoration: none; }
.msg-author a:hover, a.msg-author:hover { text-decoration: underline; text-decoration-color: var(--yellow-dk); }

/* account settings */
.settings-wrap { max-width: 560px; margin: 0 auto; }
.settings-wrap .section-title { margin-bottom: 14px; }
.settings-wrap .tabs { margin-bottom: 18px; }

/* directory extras: trending, categories, sort */
.trending { margin-bottom: 20px; }
.trending-title { font-size: 1.05rem; font-weight: 800; font-family: var(--sans); margin: 0 0 10px; }
.trending-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.trending-card { flex: 0 0 auto; width: 165px; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; background: var(--card); border: 1.5px solid var(--ink); border-radius: 13px; box-shadow: 3px 3px 0 var(--yellow); text-decoration: none; color: var(--ink); }
.trending-card:hover { box-shadow: 4px 4px 0 var(--yellow-dk); transform: translateY(-1px); }
.trending-emoji { font-size: 1.5rem; line-height: 1; }
.trending-name { font-weight: 800; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trending-recent { color: var(--muted); font-size: .78rem; font-weight: 600; }

.cat-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.cat-chip { text-decoration: none; color: var(--ink); font-weight: 700; font-size: .84rem; padding: 5px 12px; border-radius: 999px; border: 1.5px solid var(--line-2); background: #fff; }
.cat-chip:hover { border-color: var(--ink); background: #fffbea; }
.cat-chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.cat-n { opacity: .6; font-size: .78rem; }
.cat-chip.on .cat-n { color: var(--yellow); opacity: 1; }

.dir-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.dir-controls .result-note { margin: 0; }
.dir-sort { display: flex; align-items: center; gap: 4px; font-size: .86rem; }
.card-cat { margin-top: 8px; color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }

/* directory + search */
.dir-head { margin-bottom: 20px; }
.dir-head .section-title { margin-bottom: 4px; }
.dir-head .muted { margin: 0 0 14px; }
.search { display: flex; align-items: center; gap: 8px; position: relative; }
.search-icon { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search input[type="search"] { flex: 1; padding: 12px 14px 12px 40px; border-radius: 999px; }
.search .btn { flex-shrink: 0; }
.result-note { margin: 0 0 14px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 22px; }
.pager-info { color: var(--muted); font-weight: 600; font-size: .9rem; }

/* misc */
.filter-note { background: #fff6cc; border: 1.5px solid var(--ink); border-radius: 10px; padding: 8px 14px; margin-bottom: 14px; font-size: .9rem; }
.empty { text-align: center; color: var(--ink-soft); padding: 14px 18px; background: var(--paper); border: 1px dashed var(--line-2); border-radius: 12px; font-weight: 600; font-size: .92rem; }
.empty.small { padding: 12px; }
/* the "log in / request to post" prompt above the wall */
.post-prompt { margin-bottom: 14px; }
.foot { text-align: center; color: var(--muted); padding: 28px; font-size: .85rem; }

/* animations */
.pop-in { animation: pop .22s ease; }
@keyframes pop { from { transform: translateY(-4px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.fade-out { opacity: 0; transform: translateX(12px); transition: opacity .2s, transform .2s; }

@media (max-width: 560px) {
  .forum-head { flex-direction: column; text-align: center; }
  .member-actions, .req-actions { margin-left: 0; }
}
