:root {
  --bg: #101114;
  --surface: #181a20;
  --surface-2: #22252d;
  --line: #343946;
  --text: #f4f0e8;
  --muted: #aeb4bd;
  --gold: #d6a84f;
  --teal: #4aa69b;
  --rose: #ce6672;
  --blue: #6c93c9;
  --green: #79b66d;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(214, 168, 79, 0.07), transparent 260px),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

:root[data-theme="light"] {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #e9edf2;
  --line: #c8d0dc;
  --text: #111827;
  --muted: #5c6675;
}

:root[data-theme="midnight"] {
  --bg: #070b16;
  --surface: #101729;
  --surface-2: #17213a;
  --line: #293553;
  --text: #eef4ff;
  --muted: #9dabca;
  --gold: #8fc7ff;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  overflow-x: clip;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(180px, 0.7fr);
  gap: 18px;
  align-items: center;
  padding: 14px clamp(16px, 3vw, 38px);
  border-bottom: 1px solid var(--line);
  background: rgba(16, 17, 20, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(214, 168, 79, 0.45);
  border-radius: var(--radius-md);
  background: #2b261d;
  object-fit: cover;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
}

.main-nav {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.nav-link,
.ghost-action,
.primary-action,
.danger-action {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.nav-link {
  padding: 0 13px;
  background: transparent;
  color: var(--muted);
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--surface-2);
  color: var(--text);
}

.primary-action {
  padding: 0 15px;
  border-color: rgba(214, 168, 79, 0.35);
  background: var(--gold);
  color: #17130b;
  font-weight: 800;
}

.danger-action {
  padding: 0 15px;
  border-color: rgba(206, 102, 114, 0.4);
  background: rgba(206, 102, 114, 0.12);
  color: #ffc4cb;
}

.ghost-action {
  padding: 0 15px;
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}

.primary-action:hover,
.danger-action:hover,
.ghost-action:hover,
.nav-link:hover {
  transform: translateY(-1px);
}

.account-switcher {
  justify-self: end;
  display: grid;
  gap: 4px;
  min-width: 190px;
}

.account-switcher label,
form label {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 700;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111318;
  color: var(--text);
  outline: none;
}

select,
input {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 96px;
  padding: 10px 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(214, 168, 79, 0.13);
}

input[type="file"] {
  display: flex;
  align-items: center;
  height: auto;
  min-height: 42px;
  padding: 8px;
}

main {
  padding: 26px clamp(16px, 3vw, 38px) 48px;
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.forum-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid rgba(214, 168, 79, 0.25);
  background:
    radial-gradient(circle at 88% 14%, rgba(74, 166, 155, 0.14), transparent 25%),
    linear-gradient(135deg, #1d1b17, #171b21 54%, #141416);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 940px;
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.forum-hero p:not(.eyebrow) {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.6;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 10px;
}

.hero-stats span {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(24, 26, 32, 0.8);
  color: var(--muted);
}

.hero-stats strong {
  color: var(--text);
  font-size: 1.45rem;
}

.toolbar,
.section-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.announcement-strip {
  display: grid;
  gap: 8px;
  margin: -2px 0 12px;
}

.announcement-item {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid rgba(214, 168, 79, 0.38);
  border-radius: var(--radius-md);
  background: rgba(214, 168, 79, 0.1);
  color: var(--text);
}

.announcement-item strong {
  color: var(--gold);
  text-transform: uppercase;
  font-size: 0.78rem;
}

.announcement-item.is-alert {
  border-color: rgba(206, 102, 114, 0.52);
  background: rgba(206, 102, 114, 0.12);
}

.announcement-delete {
  display: grid;
  width: 24px;
  height: 24px;
  margin-left: auto;
  place-items: center;
  border: 1px solid rgba(206, 102, 114, 0.4);
  border-radius: 50%;
  background: transparent;
  color: #ffc4cb;
  font-weight: 900;
}

.announcement-delete:hover {
  background: rgba(206, 102, 114, 0.16);
}

.section-heading h1 {
  margin-bottom: 0;
  font-size: clamp(1.9rem, 4vw, 3.4rem);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 540px);
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.search-box span {
  color: var(--gold);
  font-size: 1.35rem;
}

.search-box input {
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.forum-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.category-block {
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.rules-thread-card {
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid rgba(214, 168, 79, 0.38);
  background: linear-gradient(135deg, rgba(214, 168, 79, 0.09), rgba(74, 166, 155, 0.05)), var(--surface);
}

.service-thread-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.service-thread-list .rules-thread-card {
  margin-bottom: 0;
}

.rules-thread-open {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 68px;
  padding: 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.rules-thread-open:hover {
  background: rgba(214, 168, 79, 0.08);
}

.rules-thread-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(214, 168, 79, 0.35);
  border-radius: 6px;
  background: #14161b;
}

.rules-thread-mark .pin-badge {
  margin: 0;
}

.rules-thread-copy strong,
.rules-thread-copy small,
.rules-thread-meta small {
  display: block;
}

.rules-thread-copy strong {
  font-size: 1.05rem;
}

.rules-thread-copy small,
.rules-thread-meta small {
  color: var(--muted);
}

.rules-thread-meta {
  min-width: 74px;
  text-align: right;
}

.category-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  background: #202026;
}

.category-header h2 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.category-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.category-tools {
  display: flex;
  gap: 8px;
}

.tiny-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #14161b;
  color: var(--muted);
}

.tiny-button:hover {
  color: var(--text);
  border-color: var(--gold);
}

.danger-mini {
  border-color: rgba(206, 102, 114, 0.5);
  color: #ffc4cb;
}

.message-delete {
  display: block;
  margin-top: 4px;
  border: 0;
  background: transparent;
  color: #ffc4cb;
  font-size: 0.72rem;
  text-align: right;
}

.context-menu {
  position: fixed;
  z-index: 1000;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111318;
  box-shadow: var(--shadow);
}

.context-menu button {
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.context-menu button:hover {
  background: var(--surface-2);
}

.context-menu button.danger {
  color: #ffc4cb;
}

.forum-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 126px minmax(180px, 0.34fr);
  gap: 15px;
  align-items: center;
  min-height: 104px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.forum-row:hover {
  background: rgba(214, 168, 79, 0.06);
}

.forum-row:last-child {
  border-bottom: 0;
}

.forum-icon {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(214, 168, 79, 0.88), rgba(74, 166, 155, 0.68)),
    #292315;
}

.forum-title-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.forum-main h3 {
  margin: 0;
  font-size: 1.06rem;
}

.forum-main p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.access-badge,
.role-pill,
.status-pill,
.custom-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.custom-label {
  margin-left: 7px;
  border-color: rgba(74, 166, 155, 0.45);
  background: rgba(74, 166, 155, 0.1);
  color: #bfe4df;
}

.pin-badge {
  display: inline-block;
  width: 17px;
  height: 17px;
  margin-right: 7px;
  background: url("/assets/pinned.png") center / contain no-repeat;
  vertical-align: -3px;
}

.role-admin {
  border-color: rgba(214, 168, 79, 0.5);
  color: var(--gold);
}

.role-moderator {
  border-color: rgba(108, 147, 201, 0.5);
  color: var(--blue);
}

.role-member {
  border-color: rgba(121, 182, 109, 0.48);
  color: var(--green);
}

.subforum-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.subforum-list button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(74, 166, 155, 0.35);
  border-radius: 999px;
  background: rgba(74, 166, 155, 0.09);
  color: #bfe4df;
}

.forum-counts {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.forum-counts strong {
  color: var(--text);
}

.last-post {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.last-post strong {
  display: block;
  color: var(--text);
}

.side-panel {
  display: grid;
  gap: 16px;
}

.panel-block,
.admin-card,
.members-table-wrap,
.chat-room {
  border: 1px solid var(--line);
  background: var(--surface);
}

.panel-block {
  padding: 16px;
}

.panel-block h2,
.admin-card h2 {
  margin-bottom: 14px;
  font-size: 1rem;
}

.thread-stack,
.moderation-brief,
.queue-list {
  display: grid;
  gap: 10px;
}

.thread-card,
.queue-item {
  padding: 12px;
  border: 1px solid var(--line);
  background: #14161b;
}

.thread-card strong,
.queue-item strong {
  display: block;
  margin-bottom: 6px;
}

.thread-card span,
.queue-item span {
  color: var(--muted);
  font-size: 0.86rem;
}

.log-sort {
  max-width: 260px;
}

.admin-log-item {
  display: grid;
  gap: 4px;
}

.admin-log-item small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.chat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.chat-room {
  display: grid;
  min-height: 330px;
  grid-template-rows: auto 1fr auto;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.chat-head h2 {
  margin: 0;
  font-size: 1rem;
}

.messages {
  display: grid;
  align-content: start;
  gap: 10px;
  max-height: 310px;
  overflow: auto;
  padding: 14px;
}

.message {
  padding: 10px;
  border-radius: 6px;
  background: #121419;
}

.message strong {
  color: var(--gold);
}

.message p {
  margin: 5px 0 0;
  color: var(--text);
  line-height: 1.35;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.forum-screen,
.thread-screen {
  border: 1px solid var(--line);
  background: var(--surface);
}

.forum-screen-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #202026;
}

.forum-screen-head h2 {
  margin: 0 0 4px;
}

.forum-screen-head p {
  margin: 0;
  color: var(--muted);
}

.subforum-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.thread-list,
.post-list {
  display: grid;
}

.thread-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 82px 130px;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 76px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.thread-row:hover {
  background: rgba(214, 168, 79, 0.07);
}

.thread-status {
  display: grid;
  min-height: 32px;
  place-items: center;
  border: 1px solid rgba(74, 166, 155, 0.38);
  border-radius: 6px;
  color: #bfe4df;
  font-size: 0.73rem;
  font-weight: 900;
}

.thread-status.is-pinned .pin-badge {
  width: 18px;
  height: 18px;
  margin: 0;
}

.thread-copy strong,
.thread-copy small,
.thread-count small {
  display: block;
}

.thread-copy small,
.thread-last,
.thread-count small {
  color: var(--muted);
}

.thread-count {
  text-align: right;
  font-weight: 900;
}

.post-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.post-card aside {
  display: grid;
  align-content: start;
  gap: 8px;
  color: var(--muted);
}

.post-card p {
  margin: 0;
  line-height: 1.6;
}

.post-card small {
  color: var(--muted);
}

.reply-form {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.reply-form button {
  justify-self: end;
}

.chat-grid {
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 0;
  min-height: min(740px, calc(100vh - 210px));
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 16% 10%, rgba(206, 102, 114, 0.18), transparent 26%),
    linear-gradient(135deg, #4c0731 0%, #1b0d56 48%, #182536 100%);
}

.chat-sidebar {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100%;
  border-right: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(16, 23, 31, 0.92);
}

.chat-sidebar-head {
  display: flex;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-room-list {
  display: grid;
  align-content: start;
  overflow: auto;
}

.chat-room-link {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.chat-room-link.is-active,
.chat-room-link:hover {
  background: rgba(67, 136, 198, 0.26);
}

.chat-avatar,
.message-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: #061219;
  object-fit: cover;
  overflow: hidden;
  flex: 0 0 auto;
  font-size: 1rem;
  font-weight: 900;
}

.message-row.is-mine .message-avatar {
  order: 2;
}

.chat-avatar.large {
  width: 46px;
  height: 46px;
}

.chat-room-copy {
  min-width: 0;
}

.chat-room-copy strong,
.chat-room-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-room-copy small,
.chat-room-meta,
.chat-title span {
  color: #92a7b7;
  font-size: 0.84rem;
}

.messenger {
  min-height: 100%;
  border: 0;
  background: transparent;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.messenger .chat-head {
  min-height: 72px;
  border-bottom-color: rgba(255, 255, 255, 0.09);
  background: rgba(20, 30, 41, 0.92);
}

.chat-title {
  display: flex;
  gap: 12px;
  align-items: center;
}

.chat-title h2 {
  margin-bottom: 3px;
  font-size: 1.05rem;
}

.chat-date {
  justify-self: center;
  margin-top: 12px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(32, 20, 78, 0.66);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 800;
}

.not-found-screen {
  display: grid;
  min-height: calc(100vh - 130px);
  place-items: center;
  padding: clamp(24px, 6vw, 72px);
}

.not-found-card {
  display: grid;
  justify-items: center;
  width: min(760px, 100%);
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid rgba(220, 171, 75, 0.34);
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 12%, rgba(220, 171, 75, 0.17), transparent 28%),
    linear-gradient(145deg, rgba(27, 31, 39, 0.98), rgba(14, 20, 23, 0.98));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
  text-align: center;
}

.not-found-card h1 {
  max-width: 620px;
  margin: 8px 0;
  font-size: clamp(2rem, 4vw, 4.4rem);
  line-height: 1.02;
}

.not-found-card p {
  margin: 0 0 20px;
  color: var(--muted);
}

.not-found-cat {
  display: block;
  width: min(520px, 92vw);
  margin: 10px auto 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 20px 32px rgba(0, 0, 0, 0.32));
  transition: transform 160ms ease, filter 160ms ease;
}

.not-found-cat:hover {
  transform: translateY(-3px) scale(1.015);
  filter: drop-shadow(0 26px 38px rgba(0, 0, 0, 0.42));
}

.not-found-cat:active,
.not-found-cat.is-petted {
  transform: translateY(2px) scale(0.985);
}

.not-found-cat.is-petted {
  animation: cat-pet 260ms ease;
}

.not-found-cat img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}

@keyframes cat-pet {
  0% {
    transform: translateY(0) scale(1);
  }

  45% {
    transform: translateY(16px) scale(0.985, 0.97);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

.not-found-home {
  text-decoration: none;
}

.messenger .messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: none;
  padding: 18px clamp(12px, 3vw, 34px);
}

.message-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: min(78%, 680px);
}

.message-row.is-mine {
  align-self: flex-end;
}

.message-row.is-theirs {
  align-self: flex-start;
}

.messenger .message {
  min-width: 120px;
  padding: 9px 11px 7px;
  border-radius: 15px 15px 15px 4px;
  background: #22547c;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.message-row.is-mine .message {
  border-radius: 15px 15px 4px 15px;
  background: #2b628d;
}

.messenger .message strong {
  display: block;
  margin-bottom: 3px;
  color: #a8e7ff;
  font-size: 0.8rem;
}

.messenger .message p {
  margin: 0;
  color: #fff;
  line-height: 1.35;
}

.message-time {
  display: block;
  margin-top: 3px;
  color: #a8c5d9;
  font-size: 0.75rem;
  text-align: right;
}

.read-checks {
  display: inline-block;
  width: 16px;
  height: 12px;
  margin-left: 3px;
  object-fit: contain;
  vertical-align: -1px;
}

.message-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
  opacity: 0;
  transition: opacity 140ms ease;
}

.message:hover .message-actions {
  opacity: 1;
}

.message-actions button {
  border: 0;
  background: transparent;
  color: #b9d8ea;
  font-size: 0.72rem;
  font-weight: 800;
}

.chat-reply-preview {
  margin-bottom: 6px;
  border-color: rgba(168, 231, 255, 0.25);
  border-left-color: #a8e7ff;
  background: rgba(168, 231, 255, 0.08);
}

.messenger .chat-form {
  grid-template-columns: 42px minmax(0, 1fr) 42px 46px;
  align-items: center;
  gap: 4px;
  min-height: 58px;
  padding: 8px 10px;
  border-top-color: rgba(255, 255, 255, 0.09);
  background: rgba(17, 28, 38, 0.97);
}

.chat-reply-target {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.messenger .chat-form input {
  border: 0;
  background: transparent;
}

.chat-icon-button,
.send-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #8ea3b4;
  font-size: 1.35rem;
}

.send-button {
  background: #3b90cf;
  color: white;
  font-size: 1rem;
}

.empty-chat {
  padding: 24px;
  color: var(--muted);
}

.auth-panel {
  display: grid;
  gap: 6px;
  justify-self: end;
  min-width: min(100%, 560px);
}

.auth-panel form {
  display: grid;
  grid-template-columns: minmax(84px, 1fr) minmax(92px, 1fr) auto;
  gap: 6px;
}

.auth-panel input {
  height: 36px;
}

.auth-tabs {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #111318;
}

.auth-tabs button {
  min-height: 28px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.auth-tabs button.is-active {
  background: var(--surface-2);
  color: var(--text);
}

.auth-message {
  min-height: 18px;
  margin: 0;
  color: #ffc4cb;
  font-size: 0.82rem;
}

.auth-message[data-type="ok"] {
  color: #bfe4df;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
}

.profile-avatar-preview {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: 999px;
  object-fit: cover;
}

.profile-avatar-fallback {
  background: #232323;
  color: #d7d7d7;
  font-size: 3.8rem;
  font-weight: 900;
  line-height: 1;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  border: 1px solid rgba(214, 168, 79, 0.42);
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 22%, rgba(214, 168, 79, 0.34), transparent 32%),
    linear-gradient(135deg, #222831, #12312f 52%, #2b2416);
  color: #f1d48b;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.message-avatar.avatar-fallback {
  font-size: 0.74rem;
}

.comment-author-avatar.avatar-fallback,
.comment-avatar.avatar-fallback,
.member-avatar.avatar-fallback {
  font-size: 0.72rem;
}

.profile-avatar-preview.avatar-fallback {
  font-size: 1.5rem;
}

.avatar-editor {
  display: grid;
  grid-template-columns: 96px minmax(0, 220px);
  gap: 12px;
  align-items: center;
}

.profile-avatar-picker-preview,
.avatar-crop-preview {
  position: relative;
  display: grid;
  width: 96px;
  height: 96px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #232323;
  color: var(--gold);
  font-size: 4rem;
  font-weight: 900;
}

.profile-avatar-picker-preview img,
.avatar-crop-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-crop-stage img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;
}

.profile-avatar-picker-preview img.hidden,
.profile-avatar-picker-preview span.hidden,
.avatar-crop-preview img.hidden,
.avatar-crop-preview span.hidden {
  display: none;
}

.avatar-file-button {
  display: grid;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(214, 168, 79, 0.45);
  border-radius: var(--radius-sm);
  background: var(--gold);
  color: #17130b;
  cursor: pointer;
  font-weight: 900;
}

.avatar-file-button span {
  display: block;
  font-size: 0.92rem;
  line-height: 1;
  text-align: center;
}

.avatar-file-button input {
  display: none;
}

.avatar-crop-body {
  width: min(470px, calc(100vw - 28px));
}

.avatar-crop-stage {
  position: relative;
  width: min(360px, 100%);
  aspect-ratio: 1;
  margin: 0 auto 14px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #171b1f;
}

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

.avatar-crop-circle {
  position: absolute;
  inset: 32px;
  border: 4px solid rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.18);
}

.avatar-crop-tools {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.avatar-crop-pan {
  display: grid;
  gap: 8px;
}

.avatar-crop-tools input,
.avatar-crop-pan input {
  height: 26px;
  padding: 0;
}

.muted-line {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.profile-link {
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 900;
  padding: 0;
  text-align: left;
}

.profile-link:hover {
  color: var(--gold);
  text-decoration: underline;
}

.profile-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.profile-avatar-fallback {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--gold);
  font-size: 2rem;
  font-weight: 900;
}

.profile-section {
  margin-top: 18px;
}

.profile-section h3 {
  margin-bottom: 10px;
}

.comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.post-media {
  display: block;
  max-width: min(720px, 100%);
  max-height: 420px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: #050608;
}

.rep-row,
.media-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.media-fields input {
  flex: 1 1 260px;
}

.media-fields select {
  width: 140px;
}

.user-panel {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}

.user-panel strong,
.user-panel small {
  display: block;
}

.user-panel small {
  color: var(--muted);
}

.forum-row {
  width: 100%;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.forum-main {
  display: grid;
  gap: 7px;
}

.forum-main > span:not(.forum-title-line):not(.subforum-list) {
  color: var(--muted);
}

.subforum-list span {
  display: inline-flex;
  margin-right: 6px;
  padding: 4px 8px;
  border: 1px solid rgba(74, 166, 155, 0.35);
  border-radius: 999px;
  color: #bfe4df;
  font-size: 0.78rem;
}

.screen-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #202026;
}

.screen-head h2,
.screen-head p {
  margin: 0;
}

.screen-head p {
  color: var(--muted);
}

.empty-state {
  padding: 18px;
  color: var(--muted);
}

.editor-toolbar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 7px 0 8px;
}

.editor-toolbar button {
  display: inline-grid;
  width: auto;
  height: 30px;
  min-height: 30px;
  place-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #121419;
  color: var(--text);
  font-weight: 800;
}

.editor-toolbar button:hover {
  border-color: var(--gold);
}

.emoji-asset-button {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
}

.emoji-asset-button img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
}

.custom-emoji {
  width: 1.35em;
  height: 1.35em;
  object-fit: contain;
  vertical-align: -0.25em;
}

.emoji-menu-button {
  width: 32px;
  padding: 0;
}

.emoji-picker {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(8, 30px);
  gap: 5px;
  width: max-content;
  max-width: min(330px, calc(100vw - 48px));
  max-height: 220px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111318;
  box-shadow: var(--shadow);
}

.emoji-picker.hidden {
  display: none !important;
}

.emoji-picker .emoji-asset-button {
  background: #171a20;
}

.rich-text {
  display: grid;
  gap: 8px;
}

.rich-text h2,
.rich-text h3,
.rich-text h4,
.rich-text p,
.rich-text blockquote {
  margin: 0;
}

.rich-text h2 {
  font-size: 1.45rem;
}

.rich-text h3 {
  font-size: 1.2rem;
}

.rich-text h4 {
  font-size: 1.05rem;
}

.rich-text blockquote {
  padding: 8px 10px;
  border-left: 3px solid var(--gold);
  background: rgba(214, 168, 79, 0.08);
  color: #ead9b8;
}

.rich-text code {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0e1014;
  color: #bfe4df;
}

.spoiler {
  border-radius: 4px;
  background: #050608;
  color: transparent;
}

.spoiler:hover {
  color: var(--text);
}

.ts-badge {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--gold);
  color: #16120a;
  font-size: 0.7rem;
  font-weight: 900;
  vertical-align: middle;
}

.post-card {
  animation: rise-in 220ms ease both;
}

.message-row {
  animation: chat-pop 180ms ease both;
}

.chat-login-note {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(17, 28, 38, 0.97);
  color: var(--muted);
}

.fatal {
  padding: 32px;
}

@keyframes chat-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.members-table th,
.members-table td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.members-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.members-table tr:last-child td {
  border-bottom: 0;
}

.member-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.member-avatar,
.comment-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--teal));
  color: #101014;
  font-size: 0.95rem;
  font-weight: 900;
  object-fit: cover;
  overflow: hidden;
  flex: 0 0 auto;
}

.profile-comment {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
}

.profile-comment strong,
.profile-comment span {
  display: block;
}

.profile-comment span {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 3px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.admin-tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-tabs button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.admin-tabs button.is-active {
  background: var(--surface-2);
  color: var(--text);
}

.admin-card {
  display: grid;
  gap: 13px;
  align-content: start;
  padding: 16px;
}

.admin-card.wide {
  grid-column: 1 / -1;
}

.report-item {
  display: grid;
  gap: 7px;
}

.report-target {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid rgba(74, 166, 155, 0.28);
  border-radius: 7px;
  background: rgba(74, 166, 155, 0.06);
}

.report-target a,
.report-target button {
  width: fit-content;
  color: #bfe4df;
  font-weight: 900;
}

.report-target small {
  color: var(--muted);
}

.modal {
  width: min(540px, calc(100vw - 28px));
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 0;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.66);
}

.post-edit-modal {
  width: min(760px, calc(100vw - 28px));
}

.action-modal {
  width: min(500px, calc(100vw - 28px));
}

.modal-body {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-body menu {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.post-edit-modal textarea {
  min-height: 220px;
  line-height: 1.5;
}

.action-fields {
  display: grid;
  gap: 10px;
}

.action-modal .muted-line:empty {
  display: none;
}

.icon-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111318;
  color: var(--text);
  font-size: 1.2rem;
}

/* Compact forum density pass. */
main {
  padding: 18px clamp(14px, 2vw, 28px) 34px;
}

.topbar {
  gap: 12px;
  padding-block: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
}

.forum-hero {
  gap: 16px;
  margin-bottom: 14px;
  padding: 18px 20px;
}

h1,
.section-heading h1 {
  font-size: clamp(1.55rem, 3vw, 2.75rem);
  line-height: 1.06;
}

.forum-hero p:not(.eyebrow) {
  font-size: 0.92rem;
  line-height: 1.45;
}

.hero-stats span {
  min-height: 56px;
  padding: 10px 12px;
}

.hero-stats strong {
  font-size: 1.15rem;
}

.toolbar,
.section-heading {
  margin-bottom: 12px;
}

.search-box {
  width: min(100%, 520px);
  height: 38px;
}

.forum-layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.side-panel {
  gap: 12px;
}

.panel-block,
.admin-card {
  padding: 12px;
}

.category-block {
  margin-bottom: 12px;
}

.category-header,
.screen-head {
  padding: 11px 12px;
}

.forum-row {
  grid-template-columns: 38px minmax(0, 1fr) 86px minmax(150px, 0.28fr);
  gap: 11px;
  min-height: 82px;
  padding: 11px 12px;
}

.forum-icon {
  width: 34px;
  height: 34px;
}

.subforum-list {
  gap: 5px;
  margin-top: 6px;
}

.subforum-list span {
  padding: 2px 7px;
}

.thread-row {
  grid-template-columns: 46px minmax(0, 1fr) 66px 112px;
  min-height: 62px;
  padding: 10px 12px;
}

.post-card {
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

.post-card aside {
  gap: 6px;
}

.post-card p,
.rich-text {
  line-height: 1.45;
}

.rich-text {
  gap: 5px;
}

.rich-text h2 {
  font-size: 1.2rem;
}

.rich-text h3 {
  font-size: 1.08rem;
}

.rich-text h4 {
  font-size: 1rem;
}

.rep-row,
.media-fields {
  gap: 6px;
  margin-top: 7px;
}

.reply-form {
  gap: 8px;
  padding: 12px;
}

.reply-form textarea {
  min-height: 74px;
}

.editor-toolbar {
  gap: 4px;
  margin: 3px 0 6px;
}

.editor-toolbar button,
.tiny-button {
  min-height: 28px;
  padding: 0 8px;
}

.editor-toolbar .emoji-asset-button,
.editor-toolbar .emoji-menu-button {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
}

.admin-grid {
  gap: 12px;
}

.punishment-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: end;
}

.punishment-form label {
  min-width: 0;
}

.queue-list {
  margin-top: 8px;
}

/* Thread comment feed layout. */
.thread-start {
  display: grid;
  grid-template-columns: auto 54px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #20242b;
}

.thread-start-score {
  display: grid;
  justify-items: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.thread-start-score strong {
  color: var(--text);
  font-size: 1.35rem;
}

.thread-start-main h2 {
  margin: 6px 0 0;
  font-size: 1.08rem;
  line-height: 1.35;
}

.thread-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.thread-meta-line strong {
  color: var(--gold);
}

.comment-sort {
  display: flex;
}

.comment-sort .is-hot {
  border-color: rgba(152, 111, 255, 0.7);
  color: #d4c8ff;
}

.comment-feed {
  gap: 0;
}

.comment-post {
  position: relative;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 16px 14px 22px;
  border-bottom: 0;
  background: #20242b;
}

.comment-post::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 16px;
  width: 2px;
  background: var(--gold);
}

.vote-rail {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  padding-left: 6px;
  z-index: 1;
}

.post-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
  font-size: 1.25rem;
}

.comment-author-avatar {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
  font-size: 0.9rem;
  flex: 0 0 auto;
}

.vote-rail strong {
  color: #dfe8ff;
  font-size: 1.1rem;
  line-height: 1;
}

.rep-button {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(152, 111, 255, 0.55);
  border-radius: 50%;
  background: rgba(152, 111, 255, 0.16);
  color: #d4c8ff;
  font-weight: 900;
}

.rep-button:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.comment-body {
  min-width: 0;
  padding-left: 4px;
}

.comment-head,
.comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.comment-head {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.comment-author {
  color: var(--gold);
}

.post-id {
  color: #9b78ff;
  text-decoration: none;
}

.comment-text {
  margin-bottom: 12px;
}

.reply-preview,
.reply-target {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 7px 10px;
  border: 1px solid rgba(214, 168, 79, 0.28);
  border-left: 3px solid var(--gold);
  border-radius: 7px;
  background: rgba(214, 168, 79, 0.08);
  color: var(--muted);
  font-size: 0.84rem;
  text-align: left;
}

.reply-preview:hover {
  border-color: rgba(214, 168, 79, 0.48);
  color: var(--text);
}

.reply-target button {
  float: right;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.comment-actions {
  margin-top: 10px;
}

.comment-actions .tiny-button {
  min-height: 24px;
  padding: 0 6px;
  border-color: transparent;
  background: transparent;
  color: #dce8ff;
  font-size: 0.78rem;
}

.comment-actions .tiny-button:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.comment-actions small {
  color: var(--muted);
}

.inline-reply {
  border-bottom: 1px solid var(--line);
  background: #20242b;
}

.reply-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.reply-tools .editor-toolbar {
  margin: 0;
}

.file-icon-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #111318;
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

.file-icon-button:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.file-icon-button input {
  display: none;
}

.file-chip {
  min-height: 24px;
  max-width: 220px;
  overflow: hidden;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-tools .primary-action {
  margin-left: auto;
}

/* Soft forum rounding pass. */
.brand-mark,
.main-nav,
.forum-hero,
.hero-stats span,
.search-box,
.category-block,
.rules-thread-card,
.forum-icon,
.rules-thread-mark,
.panel-block,
.admin-card,
.members-table-wrap,
.chat-grid,
.chat-room,
.forum-screen,
.thread-screen,
.profile-card,
.profile-section,
.profile-avatar-preview,
.thread-card,
.queue-item,
.modal,
.modal-body,
.context-menu,
.emoji-picker,
.chat-login-note {
  border-radius: var(--radius-md);
}

.forum-hero,
.category-block,
.rules-thread-card,
.panel-block,
.admin-card,
.members-table-wrap,
.chat-grid,
.chat-room,
.forum-screen,
.thread-screen,
.profile-card,
.profile-section {
  overflow: hidden;
}

button,
input,
select,
textarea,
.nav-link,
.ghost-action,
.primary-action,
.danger-action,
.tiny-button,
.context-menu button,
.editor-toolbar button,
.icon-close,
.message-delete,
.chat-room-link,
.chat-icon-button,
.send-button,
.reply-form,
.post-card,
.thread-row,
.forum-screen-head,
.screen-head,
.media-preview,
.action-fields > * {
  border-radius: var(--radius-sm);
}

.rich-text code,
.rich-text blockquote,
.spoiler {
  border-radius: var(--radius-xs);
}

.hidden {
  display: none !important;
}

@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .account-switcher {
    justify-self: stretch;
  }

  .main-nav {
    overflow-x: auto;
  }

  .forum-hero,
  .forum-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-grid {
    grid-template-columns: 240px minmax(0, 1fr);
  }
}

@media (max-width: 740px) {
  main {
    padding-inline: 12px;
  }

  .forum-hero {
    padding: 22px 16px;
  }

  h1 {
    font-size: 2.25rem;
  }

  .hero-stats,
  .toolbar,
  .section-heading,
  .side-panel,
  .chat-grid {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .forum-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .forum-counts,
  .last-post {
    grid-column: 2;
  }

  .members-table-wrap {
    overflow-x: auto;
  }

  .chat-grid {
    min-height: calc(100vh - 190px);
  }

  .chat-sidebar {
    max-height: 185px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  }

  .chat-room-link {
    min-height: 62px;
  }

  .message-row {
    max-width: 92%;
  }

  .forum-screen-head,
  .thread-row,
  .post-card {
    grid-template-columns: 1fr;
  }

  .thread-count,
  .thread-last {
    text-align: left;
  }
}
