:root {
  --bg: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --border: #dfe3ea;
  --text: #1d2330;
  --muted: #687185;
  --link: #1f5d99;
  --link-hover: #c2417e;
  --brand: #f49ac1;
  --verified: #e0457f; /* deep enough for the white check */
  --brand-ink: #3a1027;
  --sky: #cadceb;
  --sticky: #fff8e6;
  --announce: #fdeef5;
  --quote-bg: #f1f5fa;
  --code-bg: #f4f4f6;
  --alert-bg: #fdecec;
  --alert-ink: #8a1f1f;
  --radius: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Open Sans", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

/* Dark theme: follows the device unless the user saved a preference,
   which the server renders as data-theme on <html>. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161b;
    --surface: #1c1f26;
    --surface-2: #22262e;
    --border: #2e333d;
    --text: #e4e7ee;
    --muted: #9aa2b2;
    --link: #8cbcf0;
    --link-hover: #f49ac1;
    --brand-ink: #2b0b1c;
    --sky: #2a3846;
    --sticky: #2a2618;
    --announce: #2c1d25;
    --quote-bg: #232a33;
    --code-bg: #191b20;
    --alert-bg: #3a1d1d;
    --alert-ink: #f3b4b4;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #14161b;
  --surface: #1c1f26;
  --surface-2: #22262e;
  --border: #2e333d;
  --text: #e4e7ee;
  --muted: #9aa2b2;
  --link: #8cbcf0;
  --link-hover: #f49ac1;
  --brand-ink: #2b0b1c;
  --sky: #2a3846;
  --sticky: #2a2618;
  --announce: #2c1d25;
  --quote-bg: #232a33;
  --code-bg: #191b20;
  --alert-bg: #3a1d1d;
  --alert-ink: #f3b4b4;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

h1 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 0 0 .5rem;
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 .75rem;
}

img {
  max-width: 100%;
  height: auto;
}

.wrap {
  max-width: calc(100% - 1rem);
  margin: 0 auto;
  padding: 0 16px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: .85em;
}

.center {
  text-align: center;
}

.empty {
  color: var(--muted);
  padding: 1.5rem;
  text-align: center;
}

.inline {
  display: inline;
}

/* Header */
.site-header {
  background: var(--sky);
  border-bottom: 3px solid var(--brand);
  margin-bottom: 1.25rem;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: .75rem;
  padding-bottom: .5rem;
}

.brand img {
  display: block;
  max-height: 90px;
  width: auto;
}

.brand-name {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
}

.header-search input {
  width: 220px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem 1.1rem;
  padding-top: .35rem;
  padding-bottom: .5rem;
  font-weight: 600;
}

.nav a {
  color: var(--text);
}

.nav a:hover {
  color: var(--link-hover);
}

.nav-spacer {
  flex: 1;
}

/* Header menus (Forums and account): <details> dropdowns, so they work
   without JavaScript. */
.nav-menu {
  position: relative;
}

.nav-menu summary {
  display: flex;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.nav-menu summary::-webkit-details-marker {
  display: none;
}

.nav-menu summary::after {
  content: "";
  width: .4em;
  height: .4em;
  margin-left: .1rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-.15em) rotate(45deg);
  transition: transform .15s;
}

.nav-menu[open] summary::after {
  transform: translateY(.1em) rotate(-135deg);
}

.nav-menu summary:hover {
  color: var(--link-hover);
}

.forums-menu .menu-panel {
  min-width: 240px;
  max-height: min(70vh, 34rem);
  overflow-y: auto;
}

.menu-panel.menu-left {
  left: 0;
  right: auto;
}

.menu-label {
  padding: .5rem .7rem .2rem;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.user-menu .menu-label {
  text-transform: none;
  letter-spacing: 0;
  font-size: .85rem;
}

.nav .menu-panel a.depth-1,
.menu-label.depth-1 {
  padding-left: 1.5rem;
}

.nav .menu-panel a.depth-2,
.menu-label.depth-2 {
  padding-left: 2.3rem;
}

.nav .menu-panel a.depth-3,
.nav .menu-panel a.depth-4 {
  padding-left: 3.1rem;
}

/* The account menu's button is the viewer's avatar in a circle, with the
   unread message count tucked onto its corner. */
.user-menu summary {
  position: relative;
}

.nav-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  box-sizing: border-box;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--surface);
}

.nav-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-menu summary:hover .nav-avatar,
.user-menu[open] .nav-avatar {
  box-shadow: 0 0 0 2px var(--link-hover);
}

.user-menu summary > .count {
  position: absolute;
  top: -4px;
  left: 22px;
  min-width: 1.15em;
  padding: 0 .3em;
  font-size: .62rem;
  line-height: 1.5;
  box-shadow: 0 0 0 2px var(--sky);
}

.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + .5rem);
  z-index: 50;
  min-width: 200px;
  padding: .35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  font-weight: 500;
}

.menu-panel form {
  margin: 0;
}

.nav .menu-panel a,
.menu-panel button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: .45rem .7rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.nav .menu-panel a:hover,
.menu-panel button:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.menu-panel hr {
  margin: .3rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.crumbs {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  padding: 0;
  margin: 0 0 1rem;
  font-size: .9rem;
}

.crumbs li+li::before {
  content: "›";
  margin-right: .25rem;
  color: var(--muted);
}

.site-footer {
  color: var(--muted);
  font-size: .85rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
  text-align: center;
}

/* Blocks and lists */
.block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

section.block:not(:has(> table)),
.narrow.block,
.result.block {
  padding: 1rem 1.25rem;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: .75rem;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .5rem;
}

.filter-note {
  margin: -.25rem 0 .75rem;
}

.forum-desc {
  color: var(--muted);
}

table.list {
  width: 100%;
  border-collapse: collapse;
}

.list th {
  text-align: left;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--brand-ink);
  background: var(--brand);
  padding: .55rem .9rem;
}

.list th a {
  color: inherit;
}

.list thead tr th:first-child {
  border-top-left-radius: calc(var(--radius) - 1px);
}

.list thead tr th:last-child {
  border-top-right-radius: calc(var(--radius) - 1px);
}

.list td {
  padding: .7rem .9rem;
  border-top: 1px solid var(--border);
  vertical-align: top;
}

.list tbody tr:first-child td {
  border-top: 0;
}

.list tbody + tbody tr:first-child td {
  border-top: 1px solid var(--border);
}

.list tr:hover td {
  background: var(--surface-2);
}

.col-num {
  width: 80px;
  text-align: center !important;
  white-space: nowrap;
}

.col-last {
  width: 210px;
  font-size: .9rem;
}

.col-date {
  width: 190px;
  font-size: .9rem;
}

.forum-name,
/* Member names in topic and forum lists. */
tr.topic .username,
tr.forum-row .username {
  font-weight: 700;
}

.topic-title {
  font-weight: 650;
  font-size: 1.02rem;
}

.topic-subtitle {
  color: var(--muted);
  font-size: .9rem;
  margin: .1rem 0 0;
}

.page-head .topic-subtitle {
  font-size: 1rem;
  margin-top: -.25rem;
}

.last-subject {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.subforums {
  font-size: .88rem;
  margin-top: .2rem;
}

tr.sticky td {
  background: var(--sticky);
}

tr.announce td {
  background: var(--announce);
}

.last-post-icon,
.topic-last-short,
.pages-short {
  display: none;
}

/* Bookmarks */
.bookmark-toggle.is-on {
  color: var(--link-hover);
  border-color: var(--brand);
}

.unbookmark {
  display: block;
  margin-top: .15rem;
}

.link-like {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: .82rem;
  font-weight: 400;
  cursor: pointer;
}

.link-like:hover {
  filter: none;
  color: var(--link-hover);
  text-decoration: underline;
}

/* Collapsible sticky topics on forum pages */
.list tr.group-toggle td {
  padding: 0;
  background: var(--sticky);
}

.group-toggle button {
  display: flex;
  align-items: center;
  gap: .4rem;
  width: 100%;
  padding: .45rem .9rem;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .03em;
  cursor: pointer;
}

.group-toggle button:hover {
  filter: none;
  background: var(--surface-2);
}

.group-toggle button::before {
  content: "";
  width: .4em;
  height: .4em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .15s;
}

.sticky-group.collapsed .group-toggle button::before {
  transform: rotate(-45deg);
}

.sticky-group.collapsed tr.topic {
  display: none;
}

.mini-pages a {
  margin-left: .2rem;
}

.mini-pages::before {
  content: "· pages:";
}

.clip {
  font-size: .85em;
}

.badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: .05rem .4rem;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  vertical-align: 2px;
}

/* New posts since this browser last saw a topic (app.js). */
.badge-new {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  text-decoration: none;
}

a.badge-new {
  margin-right: .3rem;
}

a.badge-new:hover {
  filter: brightness(1.1);
}

tr.topic.unread .topic-title {
  font-weight: 800;
}

.post-new-tag {
  margin-left: .35rem;
  vertical-align: 1px;
}

.badge-sticky {
  color: #8a5a00;
  border-color: #e7c66e;
}

.badge-announce {
  color: #a3245f;
  border-color: var(--brand);
}

.badge-locked {
  color: #8a1f1f;
  border-color: #e3a5a5;
}

.badge-hot {
  color: #b2400f;
  border-color: #f0b190;
}

/* Topics the viewer has hidden stay in the list (so pages don't shift) but
   are collapsed until "Show" under the list is ticked. */
tr.topic.is-hidden {
  display: none;
}

table:has(.show-hidden:checked) tr.topic.is-hidden {
  display: table-row;
  opacity: .6;
}

.hidden-toggle td {
  padding: .5rem .9rem;
  font-size: .85rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.hidden-toggle label {
  cursor: pointer;
}

.hidden-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.hidden-toggle .when-off,
.hidden-toggle .when-on {
  color: var(--link);
  text-decoration: underline;
}

.hidden-toggle .when-on,
.hidden-toggle input:checked ~ .when-off {
  display: none;
}

.hidden-toggle input:checked ~ .when-on {
  display: inline;
}

.hidden-toggle input:focus-visible ~ span {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.unhide {
  display: block;
  margin-top: .15rem;
}

.badge-frosty {
  color: #1f6f99;
  border-color: #9fd3ef;
  background: #eef8fd;
}

:root[data-theme="dark"] .badge-frosty {
  color: #9fd8f5;
  border-color: #2f6683;
  background: #15303e;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge-frosty {
    color: #9fd8f5;
    border-color: #2f6683;
    background: #15303e;
  }
}

.badge-very-hot {
  background: #fff1e8;
  border-color: #e8803f;
}

:root[data-theme="dark"] .badge-very-hot {
  background: #3a2418;
  color: #ffb38a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge-very-hot {
    background: #3a2418;
    color: #ffb38a;
  }
}

.online {
  padding: 1rem 1.25rem;
}

.online p {
  margin: .35rem 0;
}

.stats {
  color: var(--muted);
  text-align: center;
  padding: .5rem;
}

/* Pager */
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  justify-content: flex-end;
  margin: .5rem 0 1rem;
}

.pager a,
.pager span {
  min-width: 2rem;
  padding: .2rem .55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
  font-size: .9rem;
}

.pager .current {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
}

.pager .gap {
  border: 0;
  background: none;
}

/* Posts */
.post {
  display: grid;
  grid-template-columns: 170px 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .9rem;
  overflow: hidden;
}

/* An open post menu can be taller than a short post; let it spill out. */
.post:has(.post-menu[open]),
.post:has(.reaction-picker[open]),
.post:has(.reaction-wrap:hover),
.post:has(.reaction-wrap.show-who) {
  overflow: visible;
}

.post:target {
  outline: 2px solid var(--brand);
}

.post-author {
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  padding: 1rem;
  text-align: center;
  font-size: .88rem;
  overflow-wrap: anywhere;
}

.avatar {
  display: block;
  margin: 0 auto .5rem;
  max-width: 120px;
  max-height: 120px;
  border: 2px solid transparent; /* the user's name colour, when they have one */
  border-radius: 6px;
}

.avatar.large {
  max-width: 160px;
  max-height: 160px;
}

.author-name {
  font-weight: 700;
  font-size: 1rem;
}

.rank {
  color: var(--muted);
  font-size: .85rem;
}

.rank-img {
  display: block;
  margin: .25rem auto;
}

.author-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 .5rem;
  text-align: left;
  margin: .75rem 0 0;
  font-size: .82rem;
}

.author-meta dt {
  color: var(--muted);
}

.author-meta dd {
  margin: 0;
}

.post-main {
  padding: .8rem 1.1rem 1rem;
  min-width: 0;
}

.post-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: .5rem;
  margin-bottom: .75rem;
}

.post-actions {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: .75rem;
  font-size: .88rem;
}

/* Per-post friend/foe menu */
.post-menu {
  position: relative;
}

.post-menu summary {
  padding: 0 .35rem;
  border-radius: 4px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .05em;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.post-menu summary::-webkit-details-marker {
  display: none;
}

.post-menu summary:hover,
.post-menu[open] summary {
  background: var(--surface-2);
  color: var(--text);
}

.post-menu .menu-panel {
  min-width: 230px;
  font-size: .9rem;
}

.friend-badge {
  display: inline-block;
  margin-top: .2rem;
  padding: 0 .45rem;
  border-radius: 999px;
  background: var(--sky);
  color: var(--text);
  font-size: .75rem;
  font-weight: 700;
}

.warned-badge {
  display: inline-block;
  margin-top: .2rem;
  padding: 0 .45rem;
  border: 1px solid #e0a100;
  border-radius: 999px;
  background: #fff4cc;
  color: #7a5200;
  font-size: .75rem;
  font-weight: 700;
}

:root[data-theme="dark"] .warned-badge {
  background: #3a2f0b;
  color: #ffd666;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .warned-badge {
    background: #3a2f0b;
    color: #ffd666;
  }
}

/* Moderating a user */
.mod-banned {
  color: var(--alert-ink);
}

.warning-list {
  list-style: none;
  margin: .5rem 0 0;
  padding: 0;
}

.warning-list li {
  padding: .5rem 0;
  border-top: 1px solid var(--border);
}

.warning-remove {
  margin-top: .4rem;
}

.mod-form {
  padding: 1rem 1.25rem;
}

.mod-form > label {
  display: grid;
  gap: .25rem;
  margin-bottom: .75rem;
  font-weight: 600;
}

.mod-form .inline-check {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-weight: 400;
}

button.danger {
  background: #c0392b;
  color: #fff;
}

button.danger:hover {
  color: #fff;
}

.post-menu .menu-panel a {
  display: block;
  padding: .45rem .7rem;
  border-radius: 6px;
  color: var(--text);
}

.post-menu .menu-panel a:hover {
  background: var(--surface-2);
  text-decoration: none;
}

/* Posts by foes, collapsed until asked for */
.foe-post {
  margin-bottom: .9rem;
}

.foe-post > summary {
  padding: .6rem .9rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: .9rem;
  cursor: pointer;
  list-style: none;
}

.foe-post > summary::-webkit-details-marker {
  display: none;
}

.foe-show {
  color: var(--link);
  font-weight: 600;
}

.foe-post[open] > summary {
  margin-bottom: .5rem;
}

.foe-post[open] .foe-show {
  display: none;
}

.content {
  overflow-wrap: anywhere;
  line-height: 1.6;
}

.content img {
  max-height: 800px;
}

/* Embeds (YouTube, SoundCloud, Instagram...) come with fixed pixel widths
   from the board's BBCode templates; keep them inside the post on narrow
   screens. YouTube players also keep their 16:9 shape as they shrink. */
.content iframe {
  max-width: 100%;
}

.content iframe[src*="youtube.com/embed/"] {
  height: auto;
  aspect-ratio: 16 / 9;
}

.content blockquote {
  margin: .6rem 0;
  padding: .6rem .9rem;
  background: var(--quote-bg);
  border-left: 3px solid var(--brand);
  border-radius: 4px;
}

.content blockquote cite {
  display: block;
  font-style: normal;
  font-weight: 700;
  font-size: .88rem;
  margin-bottom: .25rem;
}

.content blockquote blockquote {
  background: var(--surface);
}

/* [spoiler]: hidden until the reader asks, no JavaScript needed */
.content details.spoiler {
  margin: .4rem 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
}

.content details.spoiler:not([open]) {
  display: inline-block;
}

.content details.spoiler > summary {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .2rem .7rem;
  color: var(--text);
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.content details.spoiler > summary::-webkit-details-marker {
  display: none;
}

.content details.spoiler > summary::before {
  content: "";
  width: .4em;
  height: .4em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .15s;
}

.content details.spoiler[open] > summary::before {
  transform: rotate(45deg);
}

.content details.spoiler > summary:hover {
  color: var(--link-hover);
}

.spoiler-hide,
details.spoiler[open] > summary .spoiler-show {
  display: none;
}

details.spoiler[open] > summary .spoiler-hide {
  display: inline;
}

.spoiler-body {
  padding: .5rem .8rem .65rem;
  border-top: 1px solid var(--border);
}

.codebox {
  margin: .6rem 0;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: auto;
  max-height: 420px;
}

.codebox-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  padding: .3rem .6rem;
  border-bottom: 1px solid var(--border);
}

.codebox code {
  display: block;
  padding: .5rem .6rem;
  font: .85rem/1.45 var(--mono);
  white-space: nowrap;
}

.content ul,
.content ol {
  margin: .4rem 0;
  padding-left: 1.6rem;
}

.attachments {
  margin-top: 1rem;
  padding: .6rem .8rem;
  border: 1px dashed var(--border);
  border-radius: 6px;
  font-size: .9rem;
}

.attachments-label {
  font-weight: 700;
  font-size: .8rem;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .3rem;
}

.attachment-img img {
  max-height: 400px;
  border-radius: 4px;
}

.edited {
  margin-top: .75rem;
  font-style: italic;
}

.signature {
  margin-top: 1rem;
  padding-top: .6rem;
  border-top: 1px solid var(--border);
  font-size: .88rem;
  color: var(--muted);
  max-height: 220px;
  overflow: hidden;
}

.signature img {
  max-height: 160px;
}

/* Polls */
.poll-row {
  display: grid;
  grid-template-columns: minmax(120px, 2fr) 3fr 110px;
  gap: .75rem;
  align-items: center;
  margin-bottom: .4rem;
}

.poll-bar {
  height: .75rem;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.poll-bar span {
  display: block;
  height: 100%;
  background: var(--brand);
}

.poll-count {
  font-size: .9rem;
}

.poll-label {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.poll-label input {
  flex: none;
  accent-color: var(--brand);
}

.poll-row.chosen .poll-label {
  font-weight: 650;
}

.poll-foot {
  margin-top: .5rem;
}

.poll-foot span + span::before {
  content: " · ";
}

.poll .form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: .75rem;
}

/* "Add a poll" on the new topic form */
.poll-create {
  margin: 1rem 0 0;
  padding: .6rem .9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.poll-create summary {
  font-weight: 650;
  cursor: pointer;
}

.poll-create[open] summary {
  margin-bottom: .75rem;
}

.poll-create > label,
.poll-settings label {
  display: grid;
  gap: .25rem;
  margin-bottom: .75rem;
  font-weight: 600;
}

.poll-create textarea {
  min-height: 6rem;
}

.poll-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0 1rem;
}

.poll-create .inline-check {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-weight: 400;
}

/* Forms */
input[type=text],
input[type=search],
input[type=email],
input[type=password],
input[type=number],
textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .5rem .65rem;
}

input:focus,
textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: -1px;
  border-color: transparent;
}

textarea {
  resize: vertical;
  min-height: 8rem;
}

button,
.button {
  display: inline-block;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--brand);
  color: var(--brand-ink);
  padding: .45rem 1rem;
  border-radius: 6px;
  white-space: nowrap;
}

button:hover,
.button:hover {
  filter: brightness(1.05);
  text-decoration: none;
  color: var(--brand-ink);
}

button.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: .75rem;
}

.stack {
  display: grid;
  gap: .8rem;
}

.stack label,
.posting>label {
  display: grid;
  gap: .25rem;
  font-weight: 600;
}

.narrow {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.posting {
  padding: 1rem 1.25rem;
}

.posting>label {
  margin-bottom: .75rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-bottom: .4rem;
}

.toolbar button {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
  padding: .2rem .6rem;
  font-size: .85rem;
  font-weight: 600;
}

.topic-type {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem 1.2rem;
  margin: 0 0 .75rem;
  padding: 0;
  border: 0;
  font-size: .95rem;
}

.topic-type legend {
  float: left;
  margin-right: .4rem;
  font-weight: 600;
}

.options {
  border: 0;
  padding: 0;
  margin: .6rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.2rem;
  font-size: .9rem;
}

.preferences {
  margin-top: 1.2rem;
}

.preferences legend {
  float: left;
  margin-right: .4rem;
  font-weight: 600;
}

.alert {
  background: var(--alert-bg);
  color: var(--alert-ink);
  border-radius: 6px;
  padding: .6rem .9rem;
  margin-bottom: 1rem;
}

.notice {
  background: var(--sky);
  color: var(--text);
  border-left: 3px solid var(--brand);
  border-radius: 6px;
  padding: .6rem .9rem;
  margin-bottom: 1rem;
}

/* Edit profile */
.profile-edit .field-static {
  margin-bottom: .75rem;
}

.profile-edit .field-label {
  font-weight: 600;
  margin-right: .4rem;
}

.profile-edit label[for="signature"] {
  display: block;
  margin: .25rem 0 .35rem;
  font-weight: 600;
}

.colour-field {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 400;
}

.colour-field input[type=text] {
  width: 8.5rem;
  font-family: var(--mono);
}

.colour-swatch {
  flex: none;
  width: 2.4rem;
  height: 2.2rem;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}

.colour-preview {
  font-weight: 700;
}

.small-button {
  margin-top: .5rem;
  padding: .3rem .75rem;
  font-size: .85rem;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  padding: .75rem 1rem;
}

.search-form input[type=search] {
  flex: 1 1 240px;
  width: auto;
}

.inline-check {
  font-size: .9rem;
  white-space: nowrap;
}

.results {
  list-style: none;
  padding: 0;
  margin: 0;
}

.result p {
  margin: .35rem 0 0;
}

.result-head {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .75rem;
  align-items: baseline;
}

.review {
  margin-top: 1.5rem;
}

.preview {
  border-color: var(--brand);
}

/* Members / profile */
.letters {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem;
  margin-bottom: .75rem;
  font-size: .9rem;
}

.letters a {
  padding: .1rem .4rem;
  border-radius: 4px;
}

.letters a.current {
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
}

.profile {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
}

.profile-side {
  text-align: center;
}

.profile-side h1 {
  margin-top: .25rem;
}

.profile-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .45rem 1.25rem;
  margin: 0;
}

.profile-facts dt {
  color: var(--muted);
  font-weight: 600;
}

.profile-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.return-link {
  margin: 1rem 0 0;
  font-weight: 600;
}

/* Private messages */
.nav .count {
  display: inline-block;
  min-width: 1.3em;
  padding: 0 .35em;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: .75rem;
  text-align: center;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  margin-bottom: .75rem;
}

.tabs a {
  padding: .3rem .8rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
}

.tabs a.current {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}

tr.pm.unread .topic-title {
  font-weight: 800;
}

.pm-meta {
  margin: 0;
}

.pm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}

.button.secondary-button {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

/* Tweets before (or without) Twitter's widget: a plain card, not a quote */
.content blockquote.twitter-tweet {
  max-width: 550px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* Rich editor (SCEditor's "modern" theme, recoloured to the site tokens) */
.toolbar.rich .builtin {
  display: none;
}

.sceditor-container {
  border-color: var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
}

.sceditor-container iframe,
.sceditor-container textarea {
  background: var(--surface);
  color: var(--text);
}

.sceditor-container textarea {
  font: .9rem/1.5 var(--mono);
}

div.sceditor-toolbar {
  background: var(--surface-2);
  border-bottom-color: var(--border);
}

div.sceditor-group {
  background: none;
  border: 0;
  box-shadow: none;
}

.sceditor-button svg {
  fill: var(--text);
}

.sceditor-button-upload.busy {
  opacity: .45;
  cursor: progress;
  animation: upload-pulse 1s ease-in-out infinite alternate;
}

@keyframes upload-pulse {
  to {
    opacity: .9;
  }
}

.sceditor-button.active,
.sceditor-button:active,
.sceditor-button:hover {
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
}

div.sceditor-dropdown {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  font-family: var(--font);
}

div.sceditor-dropdown a,
div.sceditor-dropdown a:link,
div.sceditor-dropdown label {
  color: var(--text);
}

div.sceditor-dropdown input,
div.sceditor-dropdown textarea {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

div.sceditor-dropdown .button {
  background: var(--brand);
  color: var(--brand-ink);
  border-color: transparent;
}

.sceditor-dropdown a:hover {
  background: var(--surface-2);
}

/* Narrow screens */
@media (max-width: 760px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .header-search input {
    width: 100%;
  }

  .brand img {
    max-height: 64px;
    margin: 0 auto;
  }

  .wrap {
    max-width: calc(100% - .05rem);
    padding: 8px;
  }

  .col-num,
  .col-date:last-child {
    display: none;
  }

  .col-last {
    width: 130px;
    font-size: .8rem;
  }

  .last-subject {
    max-width: 120px;
  }

  /* Topic lists: the title uses the full width; the last post is one tap
     away via the icon at the end of the row. */
  .list.topics .col-last {
    display: none;
  }

  .list.topics td.col-main {
    position: relative;
    padding-right: 3rem;
  }

  /* Rows read: title, subtitle, "by name · Oct. 3", "last post: name",
     then the page links on their own line. */
  .list.topics .muted.small:not(.pages-short) .mini-pages {
    display: none;
  }

  .list.topics .topic-last-short,
  .list.topics .pages-short {
    display: block;
  }

  .pages-short .mini-pages::before {
    content: "pages:";
  }

  .last-post-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    right: .5rem;
    width: 2.2rem;
    height: 2.2rem;
    transform: translateY(-50%);
    border-radius: 6px;
    color: var(--muted);
  }

  .last-post-icon:hover {
    background: var(--surface-2);
    color: var(--link-hover);
  }

  /* Posts: author and post header share one bar (avatar, name, date,
     actions); everything else runs full width beneath it. */
  .post {
    grid-template-columns: auto 1fr;
  }

  .post-main {
    display: contents;
  }

  .post-author {
    grid-column: 1;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .5rem .55rem .8rem;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    text-align: left;
  }

  .post-author .avatar {
    width: 48px;
    height: 48px;
    object-fit: cover;
    margin: 0;
  }

  .post-head {
    grid-column: 2;
    align-items: center;
    align-content: center;
    gap: .15rem .6rem;
    margin: 0;
    padding: .55rem .8rem .55rem .2rem;
    background: var(--surface-2);
  }

  .post-main > :not(.post-head) {
    grid-column: 1 / -1;
    margin-left: .9rem;
    margin-right: .9rem;
  }

  .post-main > .content {
    margin-top: .75rem;
  }

  .post-main > :last-child {
    margin-bottom: .9rem;
  }

  .author-meta,
  .rank,
  .rank-img {
    display: none;
  }

  .profile {
    grid-template-columns: 1fr;
  }

  .poll-row {
    grid-template-columns: 1fr 90px;
  }

  .poll-label {
    grid-column: 1 / -1;
  }
}
/* Drafts */
.drafts-load {
  padding: .6rem .9rem;
  margin-bottom: 1rem;
}

.drafts-load summary {
  cursor: pointer;
  font-weight: 650;
}

.drafts-load ul {
  margin: .5rem 0 .25rem;
  padding-left: 1.2rem;
}

.drafts-load li {
  margin: .2rem 0;
}

table.drafts .col-saved {
  white-space: nowrap;
  width: 8rem;
}

table.drafts .col-actions {
  white-space: nowrap;
  text-align: right;
  width: 1%;
}

table.drafts .col-actions form {
  display: inline;
}

@media (max-width: 640px) {
  table.drafts thead {
    display: none;
  }

  table.drafts tr {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  table.drafts .col-saved {
    grid-column: 1;
    width: auto;
    padding-top: 0;
  }

  table.drafts .col-actions {
    grid-row: 1 / span 2;
    grid-column: 2;
    align-self: center;
  }
}

/* Reactions */
.reactions {
  margin-top: .75rem;
}

.reaction-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
}

.reaction,
.reactions button.reaction {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .15rem .55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: .85rem;
  line-height: 1.5;
}

.reactions button.reaction.mine {
  border-color: var(--brand);
  background: var(--sky);
}

.reaction-emoji {
  font-size: 1rem;
  line-height: 1;
}

.reaction-count {
  font-variant-numeric: tabular-nums;
}

.reaction-wrap {
  position: relative;
  display: inline-flex;
  -webkit-touch-callout: none;
  user-select: none;
}

.reactions .reaction-wrap + .reaction-wrap {
  margin-left: .1rem;
}

/* Who reacted: shown on hover, keyboard focus, or a long press (app.js). */
.reaction-who {
  display: none;
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: calc(100% + .4rem);
  transform: translateX(-50%);
  width: max-content;
  max-width: min(18rem, 80vw);
  padding: .35rem .6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 4px 14px rgb(0 0 0 / .15);
  font-size: .8rem;
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
}

.reaction-who-emoji {
  font-size: 1rem;
}

.reaction-wrap:hover .reaction-who,
.reaction-wrap:has(:focus-visible) .reaction-who,
.reaction-wrap.show-who .reaction-who {
  display: block;
}

.reaction-picker[open] ~ * .reaction-who,
.reactions:has(.reaction-picker[open]) .reaction-who {
  display: none;
}

.reaction-full {
  align-self: center;
  padding: 0 .4rem;
  white-space: nowrap;
}

.reaction-picker {
  position: relative;
}

.reaction-picker summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 1.75rem;
  border: 1px dashed var(--border);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
}

.reaction-picker summary::-webkit-details-marker {
  display: none;
}

.reaction-picker summary:hover,
.reaction-picker[open] summary {
  color: var(--text);
  border-style: solid;
}

.reaction-picker .menu-panel {
  position: absolute;
  left: 0;
  right: auto;
  top: auto;
  bottom: calc(100% + .35rem);
  width: max-content;
  display: flex;
  gap: .15rem;
  padding: .3rem;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 4px 16px rgb(0 0 0 / .15);
  z-index: 20;
}

.reaction-picker .menu-panel button {
  display: inline-flex;
  width: auto;
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: .2rem .35rem;
  font-size: 1.3rem;
  line-height: 1;
  color: inherit;
}

.reaction-picker .menu-panel button:hover {
  background: var(--surface-2);
  transform: scale(1.15);
}

.reaction-picker .menu-panel button.mine {
  border-color: var(--brand);
  background: var(--sky);
}

/* The full emoji picker is script-only. */
.reaction-picker .menu-panel .reaction-more {
  display: none;
  align-items: center;
  color: var(--muted);
  border-left: 1px solid var(--border);
  border-radius: 0 999px 999px 0;
  margin-left: .1rem;
  padding: .2rem .45rem;
}

html.js .reaction-picker .menu-panel .reaction-more {
  display: inline-flex;
}

.reaction-picker .menu-panel .reaction-more:hover {
  color: var(--text);
  transform: none;
}

.emoji-dialog {
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: 0 12px 40px rgb(0 0 0 / .3);
}

.emoji-dialog::backdrop {
  background: rgb(0 0 0 / .35);
}

.emoji-dialog emoji-picker {
  --background: var(--surface);
  --border-color: var(--border);
  --indicator-color: var(--brand);
  --input-border-color: var(--border);
  --input-font-color: var(--text);
  --outline-color: var(--brand);
  --button-hover-background: var(--surface-2);
  --button-active-background: var(--sky);
  width: min(380px, calc(100vw - 32px));
  height: min(440px, 75vh);
}

/* Verified badge (users.user_verified) */
.verified-badge {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-left: .25em;
  vertical-align: -.14em;
  flex-shrink: 0;
}

.profile h1 .verified-badge {
  width: .8em;
  height: .8em;
  vertical-align: -.06em;
}

.profile-side form.inline {
  display: inline;
}

/* Avatar upload on the edit profile page. */
.avatar-edit {
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.avatar-edit h2 {
  margin-top: 0;
}

.avatar-edit-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.avatar-edit-row .avatar {
  margin: 0;
}

.avatar-none {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  background: var(--border);
  color: var(--muted);
  font-size: 2.5rem;
  font-weight: 700;
}

.avatar-edit-actions {
  flex: 1;
  min-width: 14rem;
}

.avatar-edit-actions form {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}

.avatar-edit-actions input[type="file"] {
  max-width: 100%;
}

/* Admin pages. */
.admin-tabs {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
  border-bottom: 1px solid var(--border);
}

.admin-tabs a {
  padding: .5rem .9rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.admin-tabs a[aria-current="page"] {
  color: inherit;
  border-bottom-color: currentColor;
}

.admin-forums td {
  vertical-align: middle;
}

.admin-forums .admin-actions {
  text-align: right;
  white-space: nowrap;
}

/* Choice lists on the admin pages: one option per line under a heading. */
.admin-settings fieldset.topic-type {
  display: block;
}

.admin-settings fieldset.topic-type legend {
  float: none;
  margin: 0 0 .4rem;
}

.admin-settings fieldset.topic-type label {
  display: block;
  margin-bottom: .35rem;
}

.admin-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: .75rem;
}

.admin-forums .admin-actions a {
  margin-left: .6rem;
}

.admin-forums form.inline {
  display: inline-flex;
  gap: .2rem;
}

.icon-button {
  padding: .1rem .45rem;
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  font-weight: 600;
  line-height: 1.3;
}

.icon-button:disabled {
  opacity: .35;
  cursor: default;
}

.danger-link {
  color: #d9534f;
}

.form-actions .admin-delete {
  margin-right: auto;
  align-self: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.admin-settings select {
  width: 100%;
  font: inherit;
  padding: .45rem .55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

.admin-settings form > label {
  display: grid;
  gap: .25rem;
  margin-bottom: .75rem;
  font-weight: 600;
}

.admin-settings .access-group select {
  display: inline-block;
  width: auto;
  min-width: 12rem;
  margin: 0 .3rem;
  padding: .25rem .45rem;
}

.admin-members {
  padding: 1rem 1.25rem;
}

.admin-members h2 {
  margin-top: 0;
}

.admin-add-members {
  margin-top: 1rem;
}

.admin-add-members > label:not(.inline-check) {
  display: grid;
  gap: .25rem;
  font-weight: 600;
}

.leader-badge {
  display: inline-block;
  padding: .05rem .5rem;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: .8rem;
  font-weight: 700;
}

/* Role controls on a profile, for admins. */
.profile-roles {
  display: grid;
  gap: .4rem;
  justify-items: center;
  margin: .6rem 0;
}

.profile-roles form {
  display: flex;
  gap: .4rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.role-on {
  font-weight: 700;
  font-size: .9rem;
}
