:root {
  --blue: #102a66;
  --blue-2: #223f83;
  --blue-3: #2b4a91;
  --ink: #10235a;
  --muted: #68728a;
  --line: #e7eaf1;
  --soft: #f4f5f8;
  --panel: #ffffff;
  --page: #eeeeef;
  --accent: #0f8bff;
  --good: #10a66a;
  --shadow: 0 16px 45px rgba(16, 35, 90, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--page);
  color: #0a1433;
  font-family: Inter, Arial, sans-serif;
  font-size: 14px;
}

body.access-locked .page-shell {
  display: none;
}

body.profile-open .page-shell,
body.profile-open .wall {
  display: none;
}

.wall[hidden] {
  display: none !important;
}

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

a:hover {
  text-decoration: underline;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  display: none;
  width: min(1100px, calc(100% - 24px));
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
}

.static-shell {
  width: min(1100px, calc(100% - 24px));
  min-height: 100vh;
  margin: 0 auto;
  background: #fff;
}

.page-shell[aria-hidden="false"] {
  display: block;
}

.site-top {
  background: var(--blue);
  border-bottom: 1px solid #081842;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.12);
}

.forum-nav {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 6px 10px;
  background: #102b68;
  color: #fff;
}

.site-logo-link {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin-right: 14px;
  opacity: 1;
  transition: opacity .15s ease;
}

.site-logo-link:hover {
  opacity: .82;
  text-decoration: none;
}

.site-logo {
  display: block;
  width: auto;
  height: 40px;
  max-width: 190px;
  object-fit: contain;
  image-rendering: auto;
}

.nav-menu {
  display: flex;
  align-items: stretch;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
}

.nav-tab,
.nav-link {
  border: 0;
  border-left: 1px solid rgba(255,255,255,.16);
  background: transparent;
  color: #fff;
  font-weight: 700;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  font-size: 13px;
}

.nav-tab.active {
  background: #203f82;
}

.nav-anchor:hover {
  text-decoration: none;
  background: #203f82;
}

.nav-spacer {
  flex: 1;
}

.nav-link {
  padding: 0 16px;
}

.nav-link.strong {
  background: rgba(0,0,0,.1);
}

.search {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 155px;
  padding: 0 14px;
  border-left: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.07);
}

.search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  font-weight: 700;
}

.search input::placeholder {
  color: #fff;
}

.forum-page {
  padding: 14px 15px 60px;
}

.static-page {
  padding: 14px 15px 60px;
}

.breadcrumb {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid #cfd8eb;
  background: #f7f9ff;
  color: #58627a;
  font-size: 12px;
}

.forum-panel {
  border: 1px solid var(--line);
  background: #fff;
}

.forum-panel h1 {
  margin: 0;
  padding: 10px 12px;
  background: #294486;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.panel-body {
  padding: 14px;
  color: #39445c;
  line-height: 1.55;
}

.panel-body label {
  display: grid;
  gap: 6px;
  max-width: 420px;
  margin-bottom: 12px;
  color: var(--ink);
  font-weight: 800;
}

.panel-body input,
.panel-body textarea,
.panel-body select {
  width: 100%;
  border: 1px solid #cfd8eb;
  padding: 9px 10px;
  background: #fff;
}

.panel-body button {
  min-height: 36px;
  border: 0;
  padding: 0 13px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}

.rules-list {
  display: grid;
  gap: 9px;
  margin: 14px 0 0;
  padding-left: 1.35rem;
}

.rules-list li {
  padding: 9px 10px;
  border: 1px solid var(--line);
  background: #f8faff;
}

.status-strip button,
.application-preview button,
.new-posts,
.submit-application {
  border: 0;
  border-radius: 0;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
}

.status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid #cfd8eb;
  background: #f7f9ff;
}

.status-strip strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
}

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

.status-strip button,
.application-preview button {
  padding: 9px 13px;
  white-space: nowrap;
}

.status-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.profile-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  color: #fff;
  background: var(--blue-2);
  font-weight: 800;
}

.mini-button {
  border: 0;
  padding: 6px 10px;
  color: #fff;
  background: #183878;
  font-weight: 800;
}

.create-thread-panel,
.search-results {
  margin-bottom: 14px;
}

.compose-form textarea {
  resize: vertical;
}

.empty-state {
  padding: 14px;
  color: #69748b;
  background: #fafbff;
  border-bottom: 1px solid var(--line);
}

.mini-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}

.category {
  margin-bottom: 20px;
}

.category-head,
.side-panel h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 12px;
  background: #294486;
  color: #fff;
}

.category-head h2,
.side-panel h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.category-head span {
  color: #a8b9df;
  font-size: 20px;
}

.forum-row {
  display: grid;
  grid-template-columns: 44px minmax(220px, 1fr) 130px 290px;
  gap: 14px;
  align-items: center;
  min-height: 88px;
  padding: 14px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.forum-row.muted {
  background: #f8f8f9;
}

.forum-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--blue);
  border: 2px solid #2b4280;
  font-size: 20px;
  font-weight: 800;
}

.forum-info h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 15px;
}

.forum-info p,
.last-post p,
.application-preview p,
.rules-card p {
  margin: 0;
  color: #58627a;
  font-size: 12px;
  line-height: 1.45;
}

.subforums {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 7px;
}

.subforums a {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.forum-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0;
}

.forum-stats div {
  display: grid;
  gap: 2px;
}

.forum-stats dt {
  color: #6f7483;
  font-size: 11px;
}

.forum-stats dd {
  margin: 0;
  color: #111;
  font-size: 14px;
}

.last-post {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.last-post img,
.thread-list img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  background: #d9dce6;
}

.last-post a,
.thread-list a {
  display: block;
  overflow: hidden;
  color: #113176;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.last-post span,
.thread-list span,
.thread-list em {
  display: block;
  color: #6b5f63;
  font-size: 12px;
  font-style: normal;
}

.application-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 18px 14px;
  border-bottom: 1px solid var(--line);
}

.application-preview h3 {
  margin: 0 0 5px;
  color: var(--ink);
}

.queue-meters {
  display: flex;
  gap: 12px;
}

.queue-meters span {
  display: grid;
  min-width: 86px;
  color: #6c7488;
  font-size: 11px;
}

.queue-meters strong {
  color: #111;
  font-size: 22px;
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 10px;
}

.new-posts {
  justify-self: end;
  padding: 10px 13px;
}

.side-panel {
  background: #fff;
}

.thread-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 12px;
  list-style: none;
}

.thread-list li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 9px;
}

.thread-list .mini-avatar {
  width: 26px;
  height: 26px;
  font-size: 12px;
}

.thread-list img {
  width: 26px;
  height: 26px;
}

.thread-list p {
  min-width: 0;
  margin: 0;
}

.thread-list b {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 5px;
  border-radius: 3px;
  color: #fff;
  background: #1688ff;
  font-size: 10px;
}

.stats dl {
  margin: 0;
  padding: 12px;
}

.stats div {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  color: #39445c;
}

.stats dd {
  margin: 0;
  color: #111;
}

.rules-card p {
  padding: 12px;
}

.thread-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px 120px;
  gap: 14px;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.thread-row:nth-child(even) {
  background: #f8f8f9;
}

.thread-title {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.thread-row p {
  margin: 0 0 4px;
  color: #58627a;
  font-size: 12px;
  line-height: 1.45;
}

.thread-row span,
.thread-row small {
  color: #6b7288;
  font-size: 12px;
}

.thread-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
}

.thread-metrics dt {
  color: #6f7483;
  font-size: 11px;
}

.thread-metrics dd {
  margin: 0;
  color: #111;
  font-weight: 800;
}

.thread-detail {
  display: grid;
  gap: 12px;
}

.post-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  border: 1px solid var(--line);
  background: #fff;
}

.post-card time {
  grid-column: 1 / -1;
  padding: 7px 12px;
  color: #6b7288;
  background: #f7f9ff;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.post-user {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 14px;
  border-right: 1px solid var(--line);
  background: #f5f7fb;
  font-size: 12px;
}

.post-user strong {
  color: var(--ink);
  font-size: 14px;
}

.post-user span {
  color: #66718a;
}

.post-body {
  padding: 16px;
}

.post-body h1 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 21px;
}

.post-body p {
  margin: 0;
  color: #1d273d;
  line-height: 1.6;
}

.reply-stack {
  display: grid;
  gap: 12px;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.post-actions button {
  border: 1px solid #c7d0e3;
  padding: 3px 6px;
  color: var(--ink);
  background: #fff;
  font-size: 11px;
  font-weight: 800;
}

.post-actions b {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  color: var(--ink);
}

.profile-avatar.small {
  width: 54px;
  height: 54px;
  font-size: 22px;
}

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

.reply-panel {
  margin-top: 2px;
}

.search-row {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.search-row strong {
  display: inline-block;
  margin-bottom: 5px;
  padding: 2px 6px;
  color: #fff;
  background: #294486;
  font-size: 11px;
}

.search-row p {
  margin: 5px 0 0;
  color: #58627a;
  font-size: 12px;
}

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

.admin-grid.compact {
  padding: 0 14px 14px;
}

.admin-console {
  overflow: hidden;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid #081842;
  background: #e9edf7;
}

.admin-tabs button {
  border: 0;
  border-right: 1px solid #c6cede;
  padding: 10px 14px;
  color: var(--ink);
  background: #f6f7fb;
  font-size: 12px;
  font-weight: 800;
}

.admin-tabs button.active,
.admin-tabs button:hover {
  color: #fff;
  background: var(--blue);
}

.admin-tab-panel {
  display: none;
}

.admin-tab-panel.active {
  display: block;
}

.admin-section-note {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: #56627a;
  background: #f7f8fb;
  font-size: 12px;
}

.admin-section-note.warning {
  color: #6b3f00;
  background: #fff8df;
}

.admin-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f7f8fb;
}

.admin-tools label,
.dev-card label {
  display: grid;
  gap: 5px;
  color: #59647d;
  font-size: 12px;
  font-weight: 800;
}

.admin-tools input,
.admin-tools select,
.dev-card select,
.dev-card textarea {
  border: 1px solid #cfd6e6;
  padding: 8px 9px;
  background: #fff;
}

.admin-list {
  display: grid;
}

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

.admin-item:nth-child(even) {
  background: #f8f8f9;
}

.admin-item strong {
  color: var(--ink);
}

.admin-item p {
  margin: 4px 0 0;
  color: #66718a;
  font-size: 12px;
}

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

.admin-actions button,
.admin-actions a,
.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid #0b1c4d;
  padding: 7px 9px;
  color: #fff;
  background: var(--blue);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.admin-actions button:hover,
.admin-actions a:hover,
.button-link:hover {
  background: var(--blue-2);
  text-decoration: none;
}

.admin-actions button:disabled {
  cursor: not-allowed;
  color: #65708a;
  background: #e4e7ef;
  border-color: #c6cede;
}

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

.admin-actions .danger,
.admin-actions button.danger {
  background: #8f1d2c;
  border-color: #681321;
}

.admin-pill {
  display: inline-block;
  margin-left: 5px;
  padding: 2px 6px;
  color: #fff;
  background: #294486;
  font-size: 10px;
  text-transform: uppercase;
}

.admin-pill.danger {
  background: #8f1d2c;
}

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

.admin-stats div {
  padding: 10px;
  background: #f7f9ff;
  border: 1px solid var(--line);
}

.admin-stats b,
.admin-stats span {
  display: block;
}

.admin-stats b {
  color: #66718a;
  font-size: 12px;
}

.admin-stats span {
  margin-top: 4px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
}

.admin-stats small {
  display: block;
  margin-top: 5px;
  color: #66718a;
  font-size: 11px;
  line-height: 1.35;
}

.notice-bar {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #b8d8c6;
  color: #155a38;
  background: #effaf3;
  font-weight: 800;
}

.notice-bar.error {
  border-color: #e4b4bc;
  color: #7a1727;
  background: #fff0f2;
}

.notice-bar.js-notice {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  max-width: min(360px, calc(100% - 32px));
  box-shadow: 0 10px 30px rgba(16, 35, 90, .18);
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(10, 20, 51, .45);
}

.confirm-modal[hidden] {
  display: none !important;
}

.confirm-box {
  width: min(420px, 100%);
  border: 1px solid #081842;
  background: #fff;
  box-shadow: 0 18px 50px rgba(0,0,0,.26);
}

.confirm-box h2 {
  margin: 0;
  padding: 11px 14px;
  color: #fff;
  background: var(--blue);
  font-size: 15px;
}

.confirm-box p {
  margin: 0;
  padding: 16px 14px;
  color: #29354f;
  line-height: 1.45;
}

.confirm-box .admin-actions {
  padding: 0 14px 14px;
}

.dev-tools {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.dev-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.dev-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.dev-card p {
  margin: 0;
  color: #66718a;
  font-size: 12px;
}

.dev-facts {
  display: grid;
  gap: 1px;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.dev-facts div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px;
  padding: 8px;
  background: #f8f9fc;
}

.dev-facts dt {
  color: #66718a;
  font-weight: 800;
}

.dev-facts dd {
  margin: 0;
  color: var(--ink);
  word-break: break-word;
}

.danger-zone {
  border-color: #e4b4bc;
  background: #fff8f8;
}

.profile-bio {
  display: grid;
  gap: 8px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.profile-bio h2 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.profile-bio p {
  margin: 0 0 8px;
  color: #39445c;
  line-height: 1.5;
}

.profile-editor {
  border-width: 1px 0 0;
}

.member-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f7f8fb;
}

.member-tools label {
  display: grid;
  gap: 5px;
  min-width: 220px;
  color: #59647d;
  font-size: 12px;
  font-weight: 800;
}

.member-tools input {
  width: 100%;
  border: 1px solid #cfd6e6;
  padding: 8px 9px;
  background: #fff;
}

.member-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.member-filters button {
  border: 1px solid #c4cce0;
  padding: 7px 10px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.member-filters button.active,
.member-filters button:hover {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.member-row {
  display: grid;
  grid-template-columns: 42px minmax(170px, 1fr) minmax(260px, auto) minmax(118px, auto);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.member-row:nth-child(even) {
  background: #fafafa;
}

.member-row strong {
  color: var(--ink);
  font-size: 14px;
}

.member-row p {
  margin: 3px 0 0;
  color: #64708a;
  font-size: 12px;
  text-transform: capitalize;
}

.profile-avatar.small {
  width: 38px;
  height: 38px;
  font-size: 18px;
}

.profile-badges.compact {
  justify-content: flex-start;
  margin-top: 6px;
  padding: 0;
  border: 0;
}

.profile-badges.compact span {
  padding: 2px 6px;
  font-size: 10px;
}

.member-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(70px, 1fr));
  gap: 1px;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.member-stats div {
  min-width: 0;
  padding: 7px 9px;
  background: #fff;
}

.member-stats dt {
  color: #6a748c;
  font-size: 11px;
  font-weight: 800;
}

.member-stats dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-weight: 800;
}

.member-status {
  display: grid;
  gap: 5px;
  justify-items: end;
  color: #68728a;
  font-size: 12px;
  text-transform: capitalize;
}

.member-status b {
  padding: 3px 7px;
  color: #fff;
  background: var(--blue);
  font-size: 11px;
}

.member-status b.is-banned {
  background: #8f1d2c;
}

.wall {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 18px;
  background: #eef1f7;
}

.wall-card {
  position: relative;
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  width: min(930px, 100%);
  background: #fff;
  box-shadow: var(--shadow);
}

.wall-copy {
  padding: 34px;
  color: #fff;
  background: #102b68;
  border-right: 1px solid #081842;
}

.wall-badge {
  display: inline-block;
  margin-bottom: 24px;
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.34);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.wall-copy h1 {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.05;
}

.wall-copy p {
  margin: 0;
  color: #dfe8ff;
  line-height: 1.6;
}

.wall-brand {
  margin-bottom: 22px;
  padding: 6px;
  background: #fff;
  border: 1px solid rgba(255,255,255,.55);
}

.wall-logo {
  height: 40px;
  max-width: 210px;
}

.wall-points {
  display: grid;
  gap: 8px;
  margin: 20px 0 0;
  padding-left: 18px;
  color: #e8efff;
  line-height: 1.45;
}

.wall-panel {
  padding: 34px;
}

.wall-panel h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 22px;
}

.wall-intro {
  margin: 0 0 18px;
  color: #58627a;
  line-height: 1.5;
}

.application-form {
  display: grid;
  gap: 14px;
  padding: 0;
}

.application-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.application-form input,
.application-form textarea {
  width: 100%;
  border: 1px solid #d6ddec;
  border-radius: 0;
  padding: 11px 12px;
  color: #111;
  background: #fff;
  outline-color: var(--accent);
}

.application-form input.is-invalid,
.application-form textarea.is-invalid {
  border-color: #c93232;
  background: #fff8f8;
}

.application-form textarea {
  min-height: 112px;
  resize: vertical;
}

.field-error {
  min-height: 14px;
  color: #c93232;
  font-size: 11px;
  font-weight: 700;
}

.check-error {
  margin-top: -10px;
  padding-left: 26px;
}

.username-indicator {
  color: #727b90;
  font-size: 11px;
  font-weight: 800;
}

.username-indicator.available {
  color: #158154;
}

.username-indicator.taken {
  color: #c93232;
}

.username-indicator.invalid,
.username-indicator.neutral {
  color: #737b8e;
}

.check-row {
  grid-template-columns: 18px 1fr;
  align-items: start;
  color: #3e4658;
  font-weight: 600;
}

.check-row input {
  width: 16px;
  margin-top: 2px;
}

.submit-application {
  min-height: 44px;
  background: var(--good);
}

.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.demo-approve,
.secondary-action {
  min-height: 40px;
  border: 0;
  padding: 0 14px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}

.demo-approve {
  background: #0f8bff;
}

.secondary-action {
  background: #44516d;
}

.pending-details {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f7f9ff;
}

.pending-details div {
  display: grid;
  grid-template-columns: 95px minmax(0, 1fr);
  gap: 10px;
}

.pending-details dt {
  color: #5d6880;
  font-weight: 800;
}

.pending-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.form-note {
  margin: 0;
  color: #69748b;
  font-size: 12px;
}

.wall-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 1;
  width: 34px;
  height: 34px;
  border: 0;
  color: #fff;
  background: rgba(0,0,0,.24);
  font-size: 24px;
}

.profile-page {
  min-height: 100vh;
  padding: 24px;
  background: var(--page);
}

.profile-shell {
  width: min(900px, 100%);
  margin: 0 auto;
}

.profile-back {
  margin-bottom: 12px;
}

.profile-card {
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
  background: #f8faff;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  color: #fff;
  background: var(--blue);
  font-size: 34px;
  font-weight: 800;
}

.profile-route {
  margin: 0 0 4px;
  color: #66718a;
  font-size: 12px;
}

.profile-header h1 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 30px;
}

.profile-status {
  display: inline-block;
  padding: 4px 8px;
  color: #fff;
  background: var(--good);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.profile-stats div {
  padding: 16px 22px;
  border-right: 1px solid var(--line);
}

.profile-stats div:last-child {
  border-right: 0;
}

.profile-stats dt {
  color: #66718a;
  font-size: 12px;
  font-weight: 800;
}

.profile-stats dd {
  margin: 5px 0 0;
  color: #111;
  font-size: 18px;
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}

.profile-badges span {
  padding: 5px 8px;
  color: #10235a;
  background: #eaf0ff;
  font-size: 12px;
  font-weight: 800;
}

.recent-posts {
  padding: 18px 22px 24px;
}

.recent-posts h2 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 18px;
}

.recent-posts ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recent-posts li {
  padding: 12px;
  border: 1px solid var(--line);
  background: #fafbff;
}

.recent-posts a {
  display: block;
  margin-bottom: 4px;
  font-weight: 800;
}

.recent-posts span {
  color: #66718a;
  font-size: 12px;
}

@media (max-width: 980px) {
  .page-shell {
    width: 100%;
  }

  .forum-nav {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .site-logo-link {
    min-height: 42px;
  }

  .nav-menu {
    flex: 1 1 100%;
    width: 100%;
  }

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

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

  .new-posts {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .site-logo {
    height: 32px;
    max-width: 150px;
  }

  .nav-spacer {
    display: none;
  }

  .nav-tab,
  .nav-link {
    min-height: 38px;
    flex: 1 1 auto;
    justify-content: center;
    padding-inline: 10px;
  }

  .search {
    width: 100%;
    min-height: 38px;
  }

  .status-strip,
  .application-preview {
    align-items: stretch;
    flex-direction: column;
    display: flex;
  }

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

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

  .last-post a {
    white-space: normal;
  }

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

  .thread-row {
    grid-template-columns: 1fr;
  }

  .thread-metrics {
    max-width: 18rem;
  }

  .post-card {
    grid-template-columns: 1fr;
  }

  .post-user {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

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

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

  .member-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .member-tools label {
    min-width: 0;
  }

  .member-filters {
    justify-content: flex-start;
  }

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

  .member-stats,
  .member-status {
    grid-column: 2;
  }

  .member-status {
    justify-items: start;
  }

  .wall-card {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .wall-close {
    color: #10235a;
    background: rgba(255,255,255,.75);
  }
}

@media (max-width: 620px) {
  .profile-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .profile-stats div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 470px) {
  .forum-page {
    padding-inline: 10px;
  }

  .wall-copy,
  .application-form {
    padding: 24px;
  }
}
