:root {
  --page: #f2f2f0;
  --paper: #ffffff;
  --ink: #303842;
  --muted: #667180;
  --black: #1d2027;
  --black-2: #272b34;
  --red: #d11111;
  --orange: #f06d22;
  --line: #d7d9dd;
  --row: #f7f7f7;
  --row-alt: #eeeeef;
  --soft: #fafafa;
  --blue: #2a4e75;
  --shadow: 0 18px 48px rgba(30, 36, 44, 0.14);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 0%, rgba(0, 0, 0, 0.045), transparent 24%),
    linear-gradient(180deg, #fbfbfa 0, var(--page) 360px, #e9e9e7);
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button { cursor: pointer; }

button:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: inherit;
}

.site-shell {
  width: min(1180px, calc(100% - 34px));
  margin: 20px auto 40px;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow-x: clip;
}

.masthead {
  min-height: 144px;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.72)),
    repeating-radial-gradient(circle at 10% 20%, #d9d5cb 0 1px, transparent 1px 4px),
    #e7e2d8;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
  font-size: clamp(48px, 6vw, 70px);
  line-height: 0.95;
  letter-spacing: 0;
  font-weight: 950;
}

.wordmark-black { color: #050505; }
.wordmark-red { color: var(--red); }

.mast-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.mast-btn {
  min-width: 106px;
  height: 92px;
  border: 0;
  border-bottom: 3px solid var(--orange);
  background: rgba(255, 255, 255, 0.78);
  color: #333;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
}

.mast-link {
  text-decoration: none;
}

.mast-btn:hover,
.mast-btn:focus-visible {
  background: #fff;
  outline: none;
}

.mast-btn.compact {
  min-width: 92px;
}

.account-card {
  min-width: 150px;
  height: 92px;
  display: grid;
  align-content: center;
  padding: 0 18px;
  border-bottom: 3px solid var(--orange);
  background: rgba(255, 255, 255, 0.78);
}

.account-card strong,
.account-card span {
  display: block;
}

.account-card strong {
  color: #1f252d;
  font-size: 15px;
  font-weight: 950;
}

.account-card a {
  text-decoration: none;
}

.account-card span {
  margin-top: 3px;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.account-chip,
.top-icon,
.account-link {
  min-height: 52px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-bottom: 3px solid var(--orange);
  background: rgba(255, 255, 255, 0.78);
  color: #20242b;
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.account-chip {
  grid-template-columns: auto auto;
  gap: 8px;
  min-width: 0;
  max-width: 180px;
  padding: 0 12px;
  overflow: hidden;
}

.account-chip span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: #242831;
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  border-bottom: 2px solid var(--orange);
}

.top-icon {
  position: relative;
  width: 48px;
  font-size: 22px;
}

.top-icon b {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 2px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.account-link {
  min-width: 74px;
  padding: 0 12px;
  text-transform: uppercase;
}

button.account-link {
  cursor: pointer;
}

.nav-bar {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: stretch;
  background: var(--black);
  overflow-x: auto;
  overflow-y: hidden;
}

.nav-bar a {
  display: grid;
  place-items: center;
  min-width: max-content;
  padding: 0 18px;
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 900;
  border-bottom: 3px solid transparent;
}

.nav-bar a:hover,
.nav-bar a.active {
  border-bottom-color: var(--orange);
  background: #16191f;
}

main {
  min-height: 560px;
  padding: 22px 0 30px;
  outline: 0;
}

.utility-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px 18px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 750;
}

.utility-row a,
.breadcrumb a,
.forum-copy a,
.thread-copy a,
.last-post a {
  text-decoration: none;
}

.utility-row a:hover,
.breadcrumb a:hover,
.forum-copy a:hover,
.thread-copy a:hover,
.last-post a:hover,
.member-name:hover {
  text-decoration: underline;
}

.member-name {
  color: var(--blue);
  font-weight: 900;
  text-decoration: none;
}

.search {
  margin-left: auto;
  width: min(320px, 45vw);
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  background: #fff;
  color: #79818c;
}

.search input,
.wide-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}

.forum-card,
.thread-list {
  margin: 0 0 28px;
  border-top: 1px solid var(--black);
}

.thread-list-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 90px 300px;
  align-items: center;
  min-height: 48px;
  padding: 0 18px;
  background: var(--black);
  color: #fff;
}

.forum-table-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 28px 90px 90px 300px;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  background: var(--black);
  color: #fff;
}

.forum-table-head h1 {
  grid-column: 1 / 4;
}

.forum-table-head h1,
.thread-list-head h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1;
}

.forum-table-head span,
.thread-list-head span {
  font-size: 14px;
  font-weight: 800;
}

.forum-row,
.thread-row {
  display: grid;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px 18px;
  background: var(--row);
  border-bottom: 1px solid var(--line);
}

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

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

.forum-row:nth-child(even),
.thread-row:nth-child(even) {
  background: var(--row-alt);
}

.forum-row:hover,
.thread-row:hover {
  background: #fff;
}

.forum-status {
  width: 18px;
  height: 18px;
  background: #34383f;
  margin-left: 5px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.forum-status.locked::after {
  content: "";
  display: block;
  width: 8px;
  height: 5px;
  margin: 6px auto 0;
  border: 2px solid #fff;
  border-top: 0;
}

.forum-copy,
.thread-copy,
.last-post {
  min-width: 0;
}

.forum-copy a,
.thread-copy a,
.last-post a {
  display: block;
  max-width: 100%;
  color: #3b3f47;
  text-align: left;
  font-weight: 900;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.last-post a {
  color: var(--blue);
  font-size: 14px;
}

.forum-copy p,
.thread-copy p,
.last-post p,
.online-block p,
.subforum-title p,
.thread-hero p,
.info-panel p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.subforums {
  color: #454d58;
  font-size: 13px;
}

.rss {
  width: 18px;
  height: 18px;
  overflow: hidden;
  border: 0;
  border-radius: 3px;
  background: var(--orange);
  color: transparent;
  position: relative;
}

.rss::before,
.rss::after {
  content: "";
  position: absolute;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-left-color: transparent;
  border-radius: 50%;
}

.rss::before {
  width: 10px;
  height: 10px;
  right: 3px;
  bottom: 3px;
}

.rss::after {
  width: 4px;
  height: 4px;
  left: 3px;
  bottom: 3px;
  background: #fff;
}

.count {
  color: #4e5968;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  border-left: 1px solid #fff;
}

.last-post {
  padding-left: 10px;
  border-left: 1px solid #fff;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 18px 18px;
  color: #526071;
  font-size: 14px;
}

.subforum-title,
.thread-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px 20px;
}

.subforum-title h1,
.thread-hero h1,
.info-panel h1 {
  margin: 0;
  color: #343b46;
  font-size: clamp(24px, 3.2vw, 36px);
  line-height: 1.1;
  letter-spacing: 0;
}

.primary-action,
.secondary-action,
.dialog-submit {
  min-height: 38px;
  border: 0;
  padding: 0 16px;
  display: inline-grid;
  place-items: center;
  background: var(--black);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
}

.secondary-action {
  background: #eef0f2;
  color: #303842;
  border: 1px solid #d5d9de;
}

.danger-action {
  min-height: 38px;
  border: 0;
  padding: 0 16px;
  background: var(--red);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.thread-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.pin {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 6px;
  background: #eef0f2;
  color: #4c5664;
  border: 1px solid #d4d7dc;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  vertical-align: middle;
}

.thread-prefix {
  display: inline-grid;
  place-items: center;
  min-height: 22px;
  margin-right: 7px;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 950;
  vertical-align: middle;
}

.xf-thread {
  display: grid;
  gap: 16px;
  padding: 0 18px 18px;
}

.xf-post {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  border: 1px solid #d6d9de;
  background: #fff;
  box-shadow: 0 10px 28px rgba(30, 36, 44, 0.08);
}

.post-author {
  padding: 18px;
  background: linear-gradient(180deg, #f6f7f8, #edf0f3);
  border-right: 1px solid #d6d9de;
}

.avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  background: #242831;
  color: #fff;
  font-size: 26px;
  font-weight: 950;
  border-bottom: 3px solid var(--orange);
}

.post-author strong,
.post-author span {
  display: block;
}

.post-author strong {
  font-size: 16px;
  color: #1f252d;
}

.post-author span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.admin-avatar {
  background: #11141a;
  color: #fff;
  border-bottom-color: var(--red);
}

.rank-admin {
  color: var(--red) !important;
  font-weight: 950;
  text-transform: uppercase;
}

.staff-badge {
  width: max-content;
  margin-top: 8px !important;
  padding: 3px 7px;
  background: var(--red);
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 950;
  text-transform: uppercase;
}

.post-content {
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.post-content header,
.post-content footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 18px;
  background: #fafafa;
  border-bottom: 1px solid #e2e4e8;
  color: #657183;
  font-size: 13px;
}

.post-content footer {
  justify-content: flex-start;
  border-top: 1px solid #e2e4e8;
  border-bottom: 0;
}

.post-content footer button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
}

.post-body {
  padding: 22px 20px;
  color: #27313d;
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.post-body p {
  margin: 0 0 14px;
}

.post-body p:last-child {
  margin-bottom: 0;
}

.reaction-line {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #e2e4e8;
  color: var(--blue);
  font-size: 13px;
  font-weight: 850;
}

.reply-box,
.info-panel,
.admin-panel {
  margin: 0 18px;
  padding: 18px;
  border: 1px solid #d7d9de;
  background: #fbfbfb;
}

.reply-box h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.admin-panel h1,
.admin-panel h2 {
  margin: 0;
}

.admin-panel > p {
  margin: 8px 0 18px;
  color: var(--muted);
}

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

.admin-users-section {
  grid-column: 1 / -1;
}

.admin-grid section {
  min-width: 0;
}

.admin-grid h2 {
  padding: 12px 14px;
  background: var(--black);
  color: #fff;
  font-size: 15px;
}

.admin-table {
  border: 1px solid var(--line);
  border-top: 0;
}

.admin-table article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.admin-table article.admin-user-row {
  grid-template-columns: minmax(260px, 1fr);
  align-items: start;
}

.admin-user-main {
  min-width: 0;
}

.admin-table article:nth-child(even) {
  background: #f3f4f5;
}

.admin-table strong {
  color: #25303b;
}

.admin-table p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: break-word;
}

.admin-grid section:not(.admin-users-section) .admin-table article {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}

.admin-user-row .admin-actions {
  display: grid;
  grid-template-columns: 50px 90px 110px 78px 78px minmax(260px, 1fr);
  align-items: end;
  gap: 8px;
  width: 100%;
}

.admin-actions button {
  min-height: 30px;
  border: 1px solid #cdd1d6;
  background: #fff;
  color: #26313c;
  font-size: 12px;
  font-weight: 850;
}

.admin-user-row .admin-actions button {
  width: 100%;
}

.admin-actions label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.admin-actions select {
  min-height: 30px;
  border: 1px solid #cdd1d6;
  background: #fff;
  color: #26313c;
  font-size: 12px;
  font-weight: 800;
}

.admin-user-row .admin-actions select {
  width: 100%;
}

.admin-actions input {
  width: 76px;
  min-height: 30px;
  border: 1px solid #cdd1d6;
  padding: 0 8px;
}

.admin-user-row .admin-actions input {
  width: 100%;
}

.badge-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 8px 12px;
  font-size: 11px;
}

.badge-picker label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  white-space: nowrap;
}

.badge-picker input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
}

.quick-user-tool {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 140px 100px 100px auto;
  gap: 8px;
  margin: 0 0 18px;
}

.quick-user-tool input,
.quick-user-tool select {
  min-height: 38px;
  border: 1px solid #cdd1d6;
  padding: 0 10px;
}

.members-layout,
.profile-layout,
.account-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 18px;
  padding: 0 18px;
}

.members-main,
.profile-main,
.profile-side,
.account-menu,
.account-details {
  min-width: 0;
}

.members-main h1,
.profile-side h2,
.account-details h1 {
  margin: 0 0 14px;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.member-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
}

.member-card strong,
.member-card span {
  display: block;
}

.member-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.profile-side {
  align-self: start;
  padding: 14px;
  border: 1px solid #d7d9de;
  background: #fbfbfb;
}

.profile-side h2 {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}

.side-input {
  width: 100%;
  height: 38px;
  margin-bottom: 16px;
  border: 1px solid #c9cdd4;
  padding: 0 10px;
}

.color-rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 900;
}

.profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  min-height: 170px;
  padding: 18px;
  border: 1px solid #d7d9de;
  background:
    linear-gradient(90deg, rgba(29,32,39,0.88), rgba(29,32,39,0.54)),
    repeating-radial-gradient(circle at 20% 10%, rgba(255,255,255,0.18) 0 1px, transparent 1px 5px),
    #3b414b;
  color: #fff;
}

.profile-avatar,
.mini-avatar {
  display: grid;
  place-items: center;
  background: #242831;
  color: #fff;
  font-weight: 950;
  border-bottom: 3px solid var(--orange);
}

.profile-avatar {
  width: 58px;
  height: 58px;
  font-size: 26px;
}

.profile-avatar.large {
  width: 126px;
  height: 126px;
  font-size: 54px;
}

.mini-avatar {
  width: 42px;
  height: 42px;
  font-size: 18px;
}

.profile-identity h1 {
  margin: 0 0 6px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
}

.profile-identity p {
  margin: 5px 0;
  color: rgba(255,255,255,0.9);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.role-badge {
  display: inline-grid;
  place-items: center;
  min-height: 24px;
  padding: 0 8px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.24);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.role-badge.admin {
  background: var(--red);
  border-color: var(--red);
}

.badge-row.small {
  margin-top: 8px;
}

.badge-row.small .role-badge {
  background: #eef0f2;
  border-color: #d4d7dc;
  color: #303842;
}

.profile-actions {
  display: flex;
  gap: 8px;
  align-self: start;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #d7d9de;
  border-top: 0;
  background: #fff;
}

.profile-stats div {
  padding: 14px;
  border-left: 1px solid var(--line);
}

.profile-stats div:first-child {
  border-left: 0;
}

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

.profile-stats span {
  color: var(--muted);
  font-size: 12px;
}

.profile-stats strong {
  margin-top: 4px;
  font-size: 20px;
}

.profile-tabs {
  display: flex;
  gap: 18px;
  padding: 0 14px;
  border: 1px solid #d7d9de;
  border-top: 0;
  background: #f4f5f6;
}

.profile-tabs a {
  padding: 13px 0 10px;
  color: #526071;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.profile-tabs a.active {
  color: #1f252d;
  border-bottom-color: var(--orange);
  font-weight: 900;
}

.profile-feed {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.profile-status,
.profile-post {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid #d7d9de;
  background: #fff;
}

.profile-status input,
.comment-form input,
.account-details input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #c9cdd4;
  padding: 0 10px;
}

.profile-status {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.profile-post-body > p {
  margin: 0 0 8px;
  color: var(--muted);
}

.profile-post-body > strong {
  display: block;
  margin-bottom: 10px;
  color: #26313c;
  font-size: 16px;
  line-height: 1.45;
}

.post-tools {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}

.post-tools button,
.comment-form button,
.account-menu button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 850;
}

.profile-comments {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding: 10px;
  background: #f3f4f5;
  border: 1px solid #e0e2e5;
}

.profile-comments p {
  margin: 0 0 3px;
  color: var(--muted);
}

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

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

.account-menu {
  display: grid;
  align-content: start;
  border: 1px solid #d7d9de;
  background: #f5f6f7;
}

.account-menu a,
.account-menu button {
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid #d7d9de;
  background: transparent;
  color: #26313c;
  text-align: left;
  text-decoration: none;
  font-weight: 850;
}

.account-menu .active {
  background: #fff;
  border-left: 3px solid var(--orange);
}

.account-details {
  padding: 18px;
  border: 1px solid #d7d9de;
  background: #fbfbfb;
}

.account-details label,
.account-details fieldset {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  color: #526071;
  font-weight: 850;
}

.account-details fieldset {
  border: 0;
  padding: 0;
}

.account-details fieldset label {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  margin: 0;
}

.account-menu strong {
  padding: 12px 14px;
  background: var(--black);
  color: #fff;
  font-size: 13px;
}

.account-note {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.45;
}

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

.security-card {
  border: 1px solid #d7d9de;
  background: #fff;
}

.security-card header {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  background: #f0f1f2;
  border-bottom: 1px solid #d7d9de;
}

.security-card > p,
.passkey-list {
  margin: 0;
  padding: 12px 14px;
  color: var(--muted);
}

.passkey-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.passkey-list button,
.password-row button {
  min-height: 34px;
  border: 1px solid #cdd1d6;
  background: #f7f8f9;
  color: #26313c;
  font-weight: 850;
}

.password-card {
  padding: 0;
}

.setting-row,
.password-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.password-row span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.password-row input {
  min-height: 38px;
  border: 1px solid #c9cdd4;
  padding: 0 10px;
}

.password-card .primary-action {
  margin: 12px 14px;
}

.success-message {
  color: #1f8a3b !important;
}

.message-compose {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 16px;
}

.message-compose textarea {
  grid-column: 1 / -2;
  min-height: 90px;
  resize: vertical;
}

.message-compose input,
.message-compose textarea {
  border: 1px solid #c9cdd4;
  padding: 10px;
}

.locked-choice {
  opacity: 0.45;
}

.alerts-panel {
  margin: 0 18px;
  padding: 18px;
  border: 1px solid #d7d9de;
  background: #fbfbfb;
}

.alerts-panel h1 {
  margin: 0 0 14px;
}

.alert-row {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  color: #26313c;
  text-decoration: none;
  background: #fff;
}

.alert-row.is-unread {
  padding-left: 32px;
  background: #fff7f4;
}

.alert-row.is-unread::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 18px;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
}

.alert-row.is-read {
  opacity: 0.72;
}

.alert-row span {
  color: var(--muted);
  font-size: 13px;
}

.reply-box textarea,
.topic-form textarea,
.topic-form input,
.topic-form select,
.auth-dialog input,
.auth-dialog textarea,
.wide-search {
  width: 100%;
  border: 1px solid #c9cdd4;
  background: #fff;
  color: var(--ink);
}

.reply-box textarea,
.topic-form textarea,
.auth-dialog textarea {
  resize: vertical;
  padding: 12px;
  margin-bottom: 12px;
}

.wide-search {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin-top: 14px;
  color: #526071;
  font-weight: 800;
}

.foot-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 34px 0 18px;
  color: var(--blue);
  font-size: 14px;
}

.foot-links a + a::before {
  content: "|";
  color: #777;
  margin-right: 14px;
}

.login-strip,
.online-block {
  padding: 0 18px 16px;
  margin: 0 0 16px;
  border-top: 1px solid #c8c8c8;
}

.login-strip h2,
.online-block h2 {
  margin: 0;
  padding: 8px 0 7px;
  color: #313943;
  text-transform: uppercase;
  font-size: 14px;
}

.login-strip form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #4b5563;
  font-size: 14px;
}

.login-strip input {
  height: 26px;
  border: 1px solid #bfc3c9;
  background: #f5f5f5;
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.login-strip button {
  height: 26px;
  border: 1px solid #333;
  background: #fff;
  font-weight: 800;
}

.member-list {
  max-width: 1050px;
}

dialog {
  border: 0;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.auth-dialog,
.topic-dialog {
  width: min(560px, calc(100% - 28px));
  background: #fff;
  color: var(--ink);
}

.close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: 1px solid #cfd3d8;
  background: #fff;
  font-weight: 900;
}

#authContent,
.topic-form {
  padding: 24px;
}

#authContent h2,
.topic-form h2 {
  margin: 0 0 16px;
}

#authContent label,
.topic-form label {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  font-weight: 800;
}

#authContent input,
.topic-form input {
  height: 38px;
  padding: 0 10px;
}

.dialog-submit {
  width: 100%;
}

.form-error {
  min-height: 18px;
  margin: 0 0 12px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.empty {
  padding: 22px;
  background: var(--row);
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

@media (max-width: 880px) {
  .site-shell {
    width: 100%;
    margin: 0;
  }

  .masthead {
    min-height: 116px;
    padding: 20px;
  }

  .mast-actions {
    gap: 8px;
  }

  .mast-btn {
    min-width: 84px;
    height: 70px;
  }

  .account-card {
    height: 70px;
  }

  .forum-table-head,
  .thread-list-head {
    display: none;
  }

  .forum-row {
    grid-template-columns: 34px minmax(0, 1fr) 24px;
    align-items: start;
  }

  .thread-row {
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
  }

  .count,
  .last-post {
    grid-column: 2 / -1;
    border-left: 0;
    padding-left: 0;
    text-align: left;
  }

  .count {
    display: inline-block;
    margin-right: 10px;
  }

  .last-post {
    margin-top: 4px;
  }

  .utility-row {
    flex-wrap: wrap;
  }

  .search {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .xf-post {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: calc(100vw - 36px);
    overflow: hidden;
  }

  .post-author,
  .post-content,
  .post-content header,
  .post-content footer {
    width: calc(100vw - 36px);
    max-width: calc(100vw - 36px);
  }

  .post-body {
    width: calc(100vw - 86px);
    max-width: calc(100vw - 86px);
  }

  .post-author {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid #d6d9de;
  }

  .avatar {
    grid-row: 1 / 3;
    margin: 0;
  }

  .members-layout,
  .profile-layout,
  .account-layout {
    grid-template-columns: 1fr;
  }

  .profile-hero {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-actions {
    grid-column: 1 / -1;
  }

  .setting-row,
  .password-row,
  .message-compose {
    grid-template-columns: 1fr;
  }

  .message-compose textarea {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  body,
  .site-shell,
  main {
    width: 100%;
    max-width: 100vw;
  }

  .site-shell {
    overflow-x: hidden;
  }

  .masthead {
    align-items: flex-start;
    flex-direction: column;
  }

  .wordmark {
    font-size: 48px;
  }

  .mast-actions {
    width: 100%;
  }

  .mast-btn {
    flex: 1;
    height: 56px;
  }

  .nav-bar a {
    padding: 0 14px;
    font-size: 13px;
    flex: 1 1 auto;
    min-width: 0;
  }

  .nav-bar {
    flex-wrap: wrap;
    overflow-x: hidden;
  }

  .breadcrumb,
  .thread-hero,
  .subforum-title,
  .xf-thread,
  .reply-box,
  .info-panel,
  .admin-panel {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .post-body {
    padding: 18px 14px;
    font-size: 15px;
    line-height: 1.58;
  }

  .subforum-title,
  .thread-hero {
    display: grid;
    align-items: start;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }

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

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

  .profile-status {
    align-items: stretch;
  }

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

  .profile-tabs {
    flex-wrap: wrap;
  }

  .profile-avatar.large {
    width: 84px;
    height: 84px;
    font-size: 36px;
  }

  .admin-table article {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    justify-content: flex-start;
  }

  .admin-user-row .admin-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .badge-picker {
    grid-column: 1 / -1;
  }

  .login-strip form {
    display: grid;
  }
}
