/* ════════════════════════════════════════════════════════════════
   St. Francis Forum — forum-specific components.
   Inherits the civic brand tokens + base from ../style.css
   (maroon / paper, Libre Franklin, IBM Plex Mono, arched emblem).
   This file adds old-school forum density on top of that skin.
   ════════════════════════════════════════════════════════════════ */

/* ── Layout shell ── */
body { background: var(--paper); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 1.6rem); }
main.forum { padding-top: 4.9rem; padding-bottom: 4rem; }   /* clear the fixed header */
/* "mono" here just means tabular figures in the brand sans — not a monospace face */
.mono { font-family: 'Libre Franklin', system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.muted { color: var(--gray); }

/* ── Header (forum variant — always solid, paper bg) ── */
header.fb-header {
  position: fixed; inset: 0 0 auto 0; z-index: 1500;
  display: flex; align-items: center; gap: 1rem;
  padding: 0.6rem clamp(1rem, 4vw, 1.6rem);
  background: rgba(250, 246, 243, 0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
/* pin brand colors — `header.fb-header` out-specifies the sister site's
   `header:not(.scrolled) …` transparent-hero rules so the brand stays legible */
header.fb-header .nav-brand .wm-name { font-size: 1rem; color: var(--ink); }
header.fb-header .nav-brand .wm-eyebrow { color: var(--gray); }
/* the emblem itself is the SF sign mark — see .nav-brand .emblem in style.css */
.fb-header .spacer { flex: 1; }
.fb-header .fb-actions { display: flex; align-items: center; gap: 0.5rem; }
.fb-search {
  display: flex; align-items: center; gap: 0.4rem;
  background: var(--white); border: 1px solid var(--border); border-radius: 999px;
  padding: 0.35rem 0.85rem; max-width: 280px;
}
.fb-search input { border: none; outline: none; background: none; font: inherit; font-size: 0.85rem; width: 14ch; color: var(--ink); }
.fb-search .ic { color: var(--gray); font-size: 0.9rem; }
@media (max-width: 720px) { .fb-search { display: none; } }
.btn-sm { padding: 0.45rem 0.95rem; font-size: 0.82rem; border-radius: 999px; }

/* ── Breadcrumb ── */
.crumbs { font-size: 0.82rem; color: var(--gray); margin: 0.2rem 0 1.4rem; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.crumbs a { color: var(--maroon); text-decoration: none; font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { color: var(--border); }
.crumbs .sep::before { content: '\203A'; }   /* › */

/* ── Manifesto / landing band ── */
.manifesto {
  position: relative; background: var(--maroon); color: var(--maroon-on);
  margin-top: 3.4rem; padding: clamp(2rem, 4vw, 2.8rem) 0 clamp(1.8rem, 3.5vw, 2.4rem); overflow: hidden;
}
.manifesto::after { content: ''; position: absolute; inset: 12px; border: 1.5px solid rgba(255,255,255,.24); border-radius: 4px; pointer-events: none; }
.manifesto .eyebrow { color: var(--gold); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.16em; margin-bottom: 0.9rem; }
.manifesto h1 { color: var(--white); font-size: clamp(1.7rem, 4vw, 2.5rem); max-width: 18ch; margin-bottom: 0.6rem; }
.manifesto p.lede { font-size: clamp(1rem, 1.8vw, 1.18rem); color: rgba(255,255,255,.9); max-width: 56ch; font-weight: 500; line-height: 1.45; margin-bottom: 0; }
.manifesto-link { display: inline-block; margin-top: 0.95rem; color: var(--gold); font-weight: 600; font-size: 0.82rem; text-decoration: none; }
.manifesto-link:hover { color: #ffd56b; text-decoration: underline; }

/* About / forum-design overview */
.about { max-width: 720px; margin: 0 auto; padding: 1.6rem 0 1rem; }
.about .crumbs { margin-top: 0; }
.about h3 { margin: 1.9rem 0 0.45rem; }
.about p { color: #3a3338; }
.about .about-lead { font-size: 1.08rem; color: var(--ink); }
.about .about-note { margin-top: 2rem; font-size: 0.85rem; color: var(--gray); border-top: 1px solid var(--border); padding-top: 1.2rem; }
.pillars { display: grid; gap: 1rem; margin-top: 2rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .pillars { grid-template-columns: repeat(3, 1fr); } }
.pillar { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: 12px; padding: 1.1rem 1.2rem; }
.pillar h3 { color: var(--white); font-size: 1rem; margin: 0 0 0.35rem; }
.pillar p { color: rgba(255,255,255,.82); font-size: 0.88rem; margin: 0; line-height: 1.55; }

/* ── Section heading on the index ── */
.index-intro { margin: 2.2rem 0 1rem; }
.index-intro h2 { font-size: 1.5rem; margin-bottom: 0.3rem; }
.index-intro p { color: #4a4247; max-width: 64ch; margin: 0; }

/* search, moved out of the nav into the board space */
.board-search { display: flex; align-items: center; gap: 0.5rem; background: var(--white);
  border: 1px solid var(--border); border-radius: 999px; padding: 0.55rem 1.05rem; max-width: 440px;
  margin: clamp(1.6rem, 4vw, 2.4rem) 0 1.5rem; box-shadow: var(--shadow); }
.board-search .ic { color: var(--gray); font-size: 1rem; }
.board-search input { border: none; outline: none; background: none; font: inherit; font-size: 0.92rem; width: 100%; color: var(--ink); }

/* ════════════════ Board list (section → subsection rows) ════════════════ */
/* One continuous bordered structure; the maroon section bands are the dividers
   (classic phpBB / city-data feel), not separate floating cards. */
.boards { background: var(--white); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
/* <section class="board"> would otherwise inherit the sister site's global
   section box model (huge padding, max-width, centering) — neutralize it.
   Selector is `.boards .board` (0,2,0) so it also beats `section:last-of-type`
   (0,1,1), which was adding big padding-bottom inside the last section. */
.boards .board { background: var(--white); max-width: none; margin: 0; padding: 0; }
.board + .board .board-head { border-top: 1px solid var(--maroon-deep); }
.board-head { background: var(--maroon); color: var(--maroon-on); padding: 0.85rem 1.2rem; display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap; }
.board-head h2 { color: var(--white); font-size: 1.12rem; margin: 0; }
.board-head h2 a { color: var(--white); text-decoration: none; }
.board-head h2 a:hover { text-decoration: underline; }
.board-head .board-desc { color: var(--maroon-on); opacity: .8; font-size: 0.82rem; margin: 0; flex-basis: 100%; }
/* collapse / expand a whole section */
.board-toggle { background: none; border: none; cursor: pointer; color: var(--maroon-on);
  font-size: 0.95rem; line-height: 1; padding: 0.1rem 0.5rem 0.1rem 0; align-self: center;
  transition: transform var(--dur) var(--ease); }
.board-toggle:hover { color: var(--white); }
.board.collapsed .board-toggle { transform: rotate(-90deg); }
.board.collapsed .row-head, .board.collapsed .srow { display: none; }
.board.collapsed .board-head .board-desc { opacity: 0.85; }

/* column header row */
.row-head, .srow, .trow { display: grid; align-items: center; }
.srow, .row-head.sub { grid-template-columns: 1fr 64px 64px 256px; }
.row-head {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--gray);
  font-weight: 700; padding: 0.5rem 1.2rem; background: var(--paper-2); border-bottom: 1px solid var(--border);
}
.row-head .num, .srow .num, .trow .num { text-align: center; }
.srow { padding: 0.85rem 1.2rem; border-bottom: 1px solid var(--border); gap: 0.5rem; }
.srow:last-child { border-bottom: none; }
.srow:hover { background: var(--maroon-tint); }
.srow .sub-name { font-weight: 700; color: var(--ink); text-decoration: none; font-size: 0.98rem; }
.srow .sub-name:hover { color: var(--maroon); }
.srow .sub-desc { font-size: 0.8rem; color: var(--gray); margin-top: 0.1rem; }
.sub-school-links { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; }
.sub-school-link { font-size: 0.72rem; color: var(--accent); text-decoration: none; }
.sub-school-link:hover { text-decoration: underline; }
.srow .num { font-size: 0.92rem; color: var(--ink); }
.srow .last { font-size: 0.78rem; color: var(--gray); line-height: 1.35; }
.srow .last a { color: var(--maroon); text-decoration: none; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.srow .last .when { display: block; }
@media (max-width: 680px) {
  .srow, .row-head.sub { grid-template-columns: 1fr 52px; }
  .srow .last, .row-head .last, .srow .num.posts, .row-head .num.posts { display: none; }
}

/* ════════════════ Topic list ════════════════ */
.list-toolbar { display: flex; align-items: center; gap: 0.8rem; margin: 0.2rem 0 1rem; flex-wrap: wrap; }
.list-toolbar h1 { font-size: 1.55rem; margin: 0; }
.list-toolbar .count { color: var(--gray); font-size: 0.85rem; }
.list-toolbar .grow { flex: 1; }
/* shared sort dropdown (topic list + thread view) */
.sortbox { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray); font-weight: 700; display: inline-flex; align-items: center; gap: 0.45rem; }
.sortbox select { font: inherit; font-size: 0.82rem; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink); background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 0.32rem 0.5rem; cursor: pointer; }
.topiclist { background: var(--white); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.trow { grid-template-columns: 1fr 84px 84px 132px; padding: 0.8rem 1.2rem; border-bottom: 1px solid var(--border); gap: 0.6rem; }
.trow:last-child { border-bottom: none; }
.trow:hover { background: var(--maroon-tint); }
.trow .t-title { font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1rem; line-height: 1.3; }
.trow .t-title:hover { color: var(--maroon); }
.trow .t-meta { font-size: 0.78rem; color: var(--gray); margin-top: 0.15rem; }
.trow .num { font-size: 0.92rem; }
.trow .last { font-size: 0.78rem; color: var(--gray); }
.trow .last a { color: var(--maroon); text-decoration: none; font-weight: 600; }
@media (max-width: 680px) {
  .trow { grid-template-columns: 1fr 52px; }
  .trow .last, .row-head .last, .trow .num.posts, .row-head .num.posts { display: none; }
}

/* top nav (header link to the Polls page) — .fb-header prefix outranks the
   reference site's transparent-hero rule (header:not(.scrolled) nav a) */
.fb-header .top-nav { margin-right: 0.9rem; position: static; width: auto; height: auto; background: none; box-shadow: none; padding: 0; overflow: visible; }
.fb-header .top-nav a { font-size: 0.88rem; font-weight: 700; color: var(--ink); text-decoration: none; padding: 0.35rem 0.6rem; border-radius: 6px; border-bottom: 0; }
.fb-header .top-nav a:hover { color: var(--maroon); background: var(--maroon-tint); padding-left: 0.6rem; }

/* role pill — flags moderator/admin authorship wherever it appears */
.role-pill { display: inline-block; font-size: 0.58rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--maroon); background: var(--maroon-tint); border-radius: 999px; padding: 0.1rem 0.45rem; vertical-align: middle; margin-left: 0.15rem; }

/* badges */
.badge { display: inline-block; font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.12rem 0.45rem; border-radius: 999px; vertical-align: middle; margin-right: 0.35rem; }
.badge.pin { background: var(--gold); color: #4a2c00; }
.badge.locked { background: var(--paper-2); color: var(--gray); border: 1px solid var(--border); }

/* ════════════════ Thread (posts) ════════════════ */
.thread-head { margin-bottom: 1.2rem; }
.thread-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.15; margin-bottom: 0.4rem; }
.thread-head .sub { color: var(--gray); font-size: 0.85rem; }
.thead-actions { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.9rem; }
.thead-actions .thead-note { font-size: 0.76rem; color: var(--gray); }

/* ── Moderation tools (mods/admins only; role is always visible) ── */
.mod-tools { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; margin-top: 0.7rem; }
.mod-tools .mod-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray); }

/* ── Thread toolbar: sort only ── */
.thread-toolbar { display: flex; align-items: center; gap: 0.7rem 0.9rem; flex-wrap: wrap; margin: 0 0 0.9rem; }

/* ── Pager ── */
.pager { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; margin: 0 0 0.9rem; }
.thread + .pager { margin: 0.9rem 0 0; }
.page-btn { font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--maroon); background: var(--white); border: 1px solid var(--border);
  cursor: pointer; padding: 0.3rem 0.6rem; border-radius: 8px; min-width: 2rem; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.page-btn.on { background: var(--maroon); color: var(--maroon-on); border-color: var(--maroon); }
.page-btn.nav { color: var(--gray); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-btn:not(:disabled):hover { border-color: var(--maroon); }
.pager-info { font-size: 0.74rem; color: var(--gray); margin-left: auto; }

/* Posts in one continuous bordered frame, divided by hairlines (matches the boards). */
.thread { background: var(--white); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 1.4rem; }
.post { display: grid; grid-template-columns: 184px 1fr; scroll-margin-top: 72px; }
.post + .post { border-top: 1px solid var(--border); }
.post.target { animation: postflash 1.8s var(--ease); }
@keyframes postflash { 0%, 30% { background: var(--maroon-tint); } 100% { background: transparent; } }
.post .who { background: var(--paper-2); border-right: 1px solid var(--border); padding: 1.1rem 1rem; }
.post .who .avatar { width: 44px; height: 46px; background: url("sf-sign.svg") center / contain no-repeat; margin-bottom: 0.6rem; }
.post .who .handle { font-weight: 800; color: var(--ink); font-size: 0.88rem; overflow-wrap: anywhere; word-break: normal; line-height: 1.25; }
.post .who .role { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--maroon); font-weight: 700; margin-top: 0.15rem; }
/* Every author is a verified resident — said plainly under each name. Softened
   a touch so official roles (moderator/admin, future alderman etc.) read as
   the exception above it. */
.post .who .role.resident { opacity: 0.72; }
.post .who .joined { font-size: 0.72rem; color: var(--gray); margin-top: 0.35rem; }
.post .body { padding: 1.1rem 1.3rem; min-width: 0; }
.post .body .pmeta { display: flex; align-items: center; gap: 0.7rem; font-size: 0.74rem; color: var(--gray); border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; margin-bottom: 0.8rem; }
.post .body .pmeta .grow { flex: 1; }
.post .body .pmeta .op-badge { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--maroon); background: var(--maroon-tint); padding: 0.12rem 0.45rem; border-radius: 999px; }
.post .body .pmeta .post-num { color: var(--gray); text-decoration: none; font-weight: 600; }
.post .body .pmeta .post-num:hover { color: var(--maroon); }
.post .body .ptext { font-size: 0.97rem; line-height: 1.65; color: var(--ink); }
.post .body .ptext p { margin-bottom: 0.9rem; }
.post .body .ptext p:last-child { margin-bottom: 0; }
.post .body .pfoot { margin-top: 1rem; display: flex; align-items: center; gap: 0.6rem; }
@media (max-width: 620px) {
  .post { grid-template-columns: 1fr; }
  .post .who { display: flex; align-items: center; gap: 0.7rem; border-right: none; border-bottom: 1px solid var(--border); padding: 0.7rem 1rem; }
  .post .who .avatar { width: 30px; height: 34px; margin: 0; }
  .post .who .joined { display: none; }
}

/* support button (the scarce endorsement) */
.support-btn {
  display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 0.8rem;
  padding: 0.4rem 0.85rem; border-radius: 999px;
  background: var(--white); color: var(--maroon); border: 1.5px solid var(--maroon);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.support-btn:hover:not(:disabled) { background: var(--maroon-tint); }
.support-btn.supported { background: var(--maroon); color: var(--maroon-on); }
.support-btn:disabled { opacity: 0.5; cursor: not-allowed; border-color: var(--border); color: var(--gray); }
.support-btn .cnt { font-variant-numeric: tabular-nums; }
/* subtle divider between the label and the count; currentColor adapts to state */
.support-btn .div { width: 1px; height: 1.05em; background: currentColor; opacity: 0.3; }

/* Quote / Edit buttons (ghost style) */
.quote-btn, .edit-btn { display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 0.78rem; padding: 0.38rem 0.8rem; border-radius: 999px;
  background: none; color: var(--gray); border: 1px solid var(--border);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.quote-btn:hover, .edit-btn:hover { color: var(--maroon); border-color: #ECD9DD; background: var(--maroon-tint); }

/* Edit note: a brief author addendum shown under the (immutable) body */
.post .body .edit-note { margin: 0 0 0.9rem; padding: 0.5rem 0.85rem; background: var(--paper-2);
  border-left: 3px solid var(--slate); border-radius: 0 8px 8px 0; font-size: 0.9rem; color: #4a4247; }
.post .body .edit-note .edit-label { display: block; font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 700; color: var(--slate); margin-bottom: 0.2rem; }

/* Inline edit-note editor */
.edit-editor { margin-top: 0.8rem; background: var(--paper); border: 1px solid var(--border); border-radius: 10px; padding: 0.8rem 0.9rem; }
.edit-editor label { display: block; font-size: 0.78rem; font-weight: 700; color: var(--maroon); margin-bottom: 0.4rem; }
.edit-editor label .muted { font-weight: 400; }
.edit-editor textarea { width: 100%; font: inherit; font-size: 0.92rem; line-height: 1.5; color: var(--ink);
  background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.65rem; resize: vertical; }
.edit-editor .edit-foot { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.5rem; }
.edit-editor .edit-foot .grow { flex: 1; }

/* Word counter under compose fields / editors */
.wc { font-size: 0.72rem; color: var(--gray); margin: -0.55rem 0 0.85rem; }
.edit-editor .wc { margin: 0; }
.wc.over { color: var(--maroon); font-weight: 700; }

/* Quoted block inside a post body */
.post .body .ptext .post-quote { border-left: 3px solid var(--maroon); background: var(--paper-2);
  margin: 0 0 0.9rem; padding: 0.55rem 0.9rem; border-radius: 0 8px 8px 0; }
.post .body .ptext .post-quote cite { display: block; font-style: normal; font-weight: 700;
  font-size: 0.76rem; color: var(--maroon); margin-bottom: 0.3rem; }
.post .body .ptext .post-quote p { font-size: 0.9rem; color: #4a4247; margin-bottom: 0.4rem; }
.post .body .ptext .post-quote p:last-child { margin-bottom: 0; }

/* ════════════════ Compose ════════════════ */
.compose { background: var(--white); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 1.2rem 1.3rem; margin: 1.4rem 0; }
.compose h3 { margin: 0 0 0.8rem; font-size: 1.05rem; }
.compose label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--maroon); font-weight: 700; margin-bottom: 0.3rem; }
.compose input[type=text], .compose textarea, .compose select {
  width: 100%; font: inherit; font-size: 0.95rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.75rem; margin-bottom: 0.9rem;
}
.compose textarea { min-height: 130px; resize: vertical; line-height: 1.55; }
.compose .compose-foot { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.compose .grow { flex: 1; }
.compose .gate-note { font-size: 0.78rem; color: var(--gray); }
.compose .gate-note strong { color: var(--maroon); }

/* sign-in nudge in place of compose */
.signin-nudge { background: var(--paper-2); border: 1px dashed var(--border); border-radius: 12px; padding: 1.1rem 1.3rem; margin: 1.4rem 0; font-size: 0.9rem; color: #4a4247; text-align: center; }
.signin-nudge a { font-weight: 700; }

/* ════════════════ Profile cooldown grid ════════════════ */
.profile-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.6rem; }
.profile-head .avatar { width: 58px; height: 62px; background: url("sf-sign.svg") center / contain no-repeat; }
.profile-head h1 { font-size: 1.7rem; margin: 0; }
.profile-head .joined { color: var(--gray); font-size: 0.85rem; }

.cooldowns { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .cooldowns { grid-template-columns: 1fr 1fr; } }
.cd-card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 1.1rem 1.2rem; position: relative; overflow: hidden; padding-top: 1.35rem; }
.cd-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px; background: var(--maroon); }
.cd-pace { font-weight: 600; font-size: 0.7rem; color: var(--gray); white-space: nowrap; }
.cd-note { font-size: 0.78rem; color: var(--gray); line-height: 1.45; margin: 0.75rem 0 0; }
.cd-card.unlimited::before { background: var(--slate); }
.cd-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.7rem; }
.cd-card h3 { font-size: 1.05rem; margin: 0; }
.cd-cadence { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700;
  color: var(--maroon); background: var(--maroon-tint); padding: 0.2rem 0.5rem; border-radius: 999px; white-space: nowrap; }
.cd-card.unlimited .cd-cadence { color: var(--slate); background: var(--paper-2); }
.cd-grid { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 1rem; align-items: center; }
.cd-grid .label { font-size: 0.85rem; color: #4a4247; }
.cd-grid .state { font-family: 'Libre Franklin', system-ui, sans-serif; font-variant-numeric: tabular-nums; font-size: 0.86rem; font-weight: 700; letter-spacing: -0.005em; text-align: right; }
.cd-grid .state.ready { color: #2e7d32; }
.cd-grid .state.wait { color: var(--maroon); }
.cd-grid .state.none { color: var(--gray); }

/* ── Empty states & utility ── */
.empty { text-align: center; color: var(--gray); padding: 3rem 1rem; }
.empty .big { font-size: 1.1rem; color: var(--ink); font-weight: 700; margin-bottom: 0.4rem; }
/* quiet, dismissible preview note (not the loud gold bar) */
.sample-banner { background: var(--paper-2); color: var(--gray); text-align: center; font-size: 0.72rem;
  padding: 0.3rem 1rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: center; gap: 0.7rem; }
.sample-banner button { background: none; border: none; color: var(--gray); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 0.2rem; }
.sample-banner button:hover { color: var(--ink); }
.spin { text-align: center; color: var(--gray); padding: 3rem 1rem; font-size: 0.9rem; }
.btn.btn-block { width: 100%; justify-content: center; }

/* ════════════════ Attachments ════════════════ */
.pattach { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.9rem 0 0.2rem; }
.img-frame { display: block; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--paper-2); overflow: hidden; cursor: zoom-in; }
.img-frame:hover { border-color: var(--maroon); }
.img-frame img { display: block; max-width: 220px; max-height: 160px; }
.pdf-card { display: inline-flex; align-items: center; gap: 0.55rem; border: 1px solid var(--border); border-radius: 8px; background: var(--paper-2); padding: 0.55rem 0.8rem; font-size: 0.84rem; color: var(--ink); text-decoration: none; }
a.pdf-card:hover { border-color: var(--maroon); }
.pdf-ic { background: var(--maroon); color: var(--white); font-size: 0.6rem; font-weight: 800; letter-spacing: 0.05em; padding: 0.18rem 0.4rem; border-radius: 4px; }
.pdf-size { color: var(--gray); font-size: 0.74rem; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(20, 16, 14, 0.82); display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 2vmin; }
.lightbox img { max-width: 94vw; max-height: 94vh; border-radius: 6px; background: var(--white); }

/* compose: your own timer, shown before you write (server still enforces) */
.cd-wait-note { font-size: 0.84rem; line-height: 1.45; color: var(--ink); background: var(--maroon-tint); border: 1px solid var(--border); border-radius: 8px; padding: 0.55rem 0.8rem; margin: 0.2rem 0 0.9rem; }

/* profile: your threads + new-reply marker */
.mythreads .prop-row .when { color: var(--gray); font-size: 0.78rem; white-space: nowrap; }
.mythreads .prop-row a { color: var(--maroon); text-decoration: none; font-weight: 600; }
.mythreads .prop-row a:hover { text-decoration: underline; }
/* A link, not just a marker: it jumps to the first unread post (#/t/:id/unread). */
.new-pill { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--maroon-on); background: var(--maroon); border-radius: 999px; padding: 0.14rem 0.5rem; vertical-align: 1px; text-decoration: none; white-space: nowrap; }
a.new-pill:hover { text-decoration: none; filter: brightness(1.18); }
.mythreads .prop-row a.new-pill { color: var(--maroon-on); font-weight: 800; }

/* ════════════════ Invites (profile) + sign-in code step ════════════════ */
.invite-box { border: 1px solid var(--border); border-radius: 10px; background: var(--white); padding: 1rem 1.2rem; }
.mint-out .mint-row { display: flex; gap: 0.5rem; }
.mint-out .mint-row input { flex: 1; font-size: 0.8rem; color: var(--gray); background: var(--paper-2); border: 1px solid var(--border); border-radius: 6px; padding: 0.45rem 0.6rem; }
/* in-person handoff: the neighbor scans the inviter's screen */
.mint-qr { margin-top: 0.8rem; }
.mint-qr-img { display: inline-block; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.mint-qr-img svg { display: block; width: 190px; height: 190px; }
.invite-box .bestow { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: 0.9rem; }
.invite-box .bestow h3 { font-size: 0.95rem; margin: 0; }
.bestow-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.bestow-row input[type="text"] { flex: 1; min-width: 160px; }
.bestow-row input[type="number"] { width: 80px; }
.otp-step input { letter-spacing: 0.35em; font-size: 1.1rem; text-align: center; }

/* ════════════════ Community notes ════════════════ */
.cnote { border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: 8px; background: var(--paper-2); padding: 0.7rem 0.9rem; margin: 0.9rem 0 0.2rem; font-size: 0.88rem; }
.cnote.voting { border-left-color: var(--slate); }
.cnote.proposed { border-left-color: var(--border); }
.cnote.accepted.secondary { border-left-color: var(--border); opacity: 0.85; font-size: 0.84rem; }
.cnote-head { font-weight: 800; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink); display: flex; align-items: baseline; gap: 0.45rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.cnote-ic { color: var(--maroon); }
.cnote-sub { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--gray); font-size: 0.76rem; }
.cnote-cat { font-weight: 700; text-transform: none; letter-spacing: 0.01em; font-size: 0.68rem; color: var(--maroon); background: var(--maroon-tint); border-radius: 999px; padding: 0.12rem 0.5rem; }
/* placement notes: the proposed destination, ratified by the same vote */
.cnote-dest { font-weight: 700; text-transform: none; letter-spacing: 0.01em; font-size: 0.68rem; color: var(--ink); background: var(--white); border: 1px solid var(--border); border-radius: 999px; padding: 0.1rem 0.5rem; }
.mod-tools .mod-move-sel { font: inherit; font-size: 0.8rem; color: var(--ink); background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 0.3rem 0.5rem; cursor: pointer; max-width: 240px; }
.note-editor .note-cat { display: block; font: inherit; font-size: 0.84rem; margin: 0 0 0.55rem; padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: 6px; background: var(--white); color: var(--ink); }
.note-editor .note-cat[hidden] { display: none; }   /* display:block above would otherwise beat the hidden attribute */
.cnote-body { line-height: 1.5; }
.cnote-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.6rem; }
.cnote-actions .btn.on { background: var(--maroon-tint); color: var(--maroon); border-color: #ECD9DD; font-weight: 700; }
.cnote-q { font-size: 0.78rem; color: var(--gray); }
.cnote-done { font-size: 0.78rem; color: var(--gray); font-style: italic; }

/* ════════════════ Polls page ════════════════ */
.polls-h { font-size: 1.05rem; margin: 1.6rem 0 0.8rem; }
.poll-card { border: 1px solid var(--border); border-radius: 10px; background: var(--white); padding: 1rem 1.2rem; margin-bottom: 1rem; }
.poll-head { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.poll-head h3 { font-size: 1.05rem; margin: 0; }
.poll-kind { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.16rem 0.5rem; border-radius: 999px; background: var(--maroon-tint); color: var(--maroon); }
.poll-kind.governance { background: var(--paper-2); color: var(--gray); border: 1px solid var(--border); }
.poll-desc { color: var(--gray); font-size: 0.86rem; margin: 0.45rem 0 0; }
.poll-context { color: var(--gray); font-size: 0.82rem; margin: 0.45rem 0 0; }
.poll-context a { color: var(--maroon); font-weight: 600; }
.polis-embed { width: 100%; height: 560px; border: 1px solid var(--border); border-radius: 8px; margin-top: 0.8rem; background: var(--paper-2); }
.polis-placeholder { border: 1px dashed var(--border); border-radius: 8px; background: var(--paper-2); color: var(--gray); font-size: 0.85rem; text-align: center; padding: 2.2rem 1rem; margin-top: 0.8rem; }
.polis-teaser { border: 1px dashed var(--border); border-radius: 8px; background: var(--paper-2); text-align: center; padding: 1.8rem 1rem; margin-top: 0.8rem; }
.polis-teaser p { color: var(--gray); font-size: 0.86rem; margin: 0 0 0.8rem; }
.poll-admin { border: 1px solid var(--border); border-radius: 10px; background: var(--white); padding: 1rem 1.2rem; margin-top: 1.8rem; }
.poll-admin h3 { font-size: 0.95rem; margin: 0; }
.poll-admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.poll-admin-grid input, .poll-admin-grid select { font: inherit; font-size: 0.86rem; padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; background: var(--white); color: var(--ink); }
.poll-body { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.8rem; }
.poll-body.live { display: block; }
.poll-join-hint { font-size: 0.78rem; color: var(--gray); }
.poll-close { margin-top: 0.7rem; font-size: 0.82rem; }
.poll-close summary { cursor: pointer; color: var(--gray); }
.poll-close textarea { width: 100%; min-height: 70px; margin: 0.5rem 0; font: inherit; font-size: 0.85rem; padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; }
.poll-close input { width: 100%; font: inherit; font-size: 0.85rem; padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 0.5rem; }
.poll-summary { margin-top: 0.7rem; font-size: 0.9rem; line-height: 1.55; }
.poll-closed-tag { display: inline-block; font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray); background: var(--paper-2); border: 1px solid var(--border); border-radius: 999px; padding: 0.14rem 0.55rem; margin-bottom: 0.4rem; }
.prop-list { border: 1px solid var(--border); border-radius: 10px; background: var(--white); overflow: hidden; }
.prop-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 1.1rem; border-bottom: 1px solid var(--border); }
.prop-row:last-child { border-bottom: 0; }
.poll-progress { font-size: 0.8rem; color: var(--gray); white-space: nowrap; }

/* composer attachment row */
.attach-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.7rem; margin-bottom: 0.9rem; }
.attach-hint { font-size: 0.76rem; color: var(--gray); }
.attach-list { display: flex; flex-wrap: wrap; gap: 0.5rem; flex-basis: 100%; }
.attach-list:empty { display: none; }
.attach-chip { display: inline-flex; align-items: center; gap: 0.5rem; border: 1px solid var(--border); border-radius: 8px; background: var(--paper-2); padding: 0.3rem 0.5rem; font-size: 0.8rem; }
.attach-chip img { width: 44px; height: 34px; object-fit: cover; border-radius: 4px; }
.attach-chip .attach-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip button { border: 0; background: none; cursor: pointer; font-size: 1rem; color: var(--gray); padding: 0 0.2rem; }
.attach-chip button:hover { color: var(--maroon); }
