:root {
  --page: #0f1115;
  --header: #11141a;
  --panel: #171b22;
  --panel-2: #1d232c;
  --panel-3: #141820;
  --border: #303844;
  --border-soft: #252c35;
  --text: #f1f3f5;
  --muted: #a9b2bc;
  --dim: #747f8b;
  --red: #c7363c;
  --blue: #2e7ebd;
  --green: #48a868;
  --gold: #b99a5b;
  --discord: #5865f2;
  --radius: 4px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  color: inherit;
}

.button-reset {
  border: 0;
  background: transparent;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1240px;
  min-height: 72px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 198px;
}

.brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 20px;
  line-height: 1;
  font-weight: 800;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav button,
.plain-link,
.primary-link,
.discord-link {
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.main-nav button {
  background: transparent;
}

.main-nav button:hover,
.main-nav button.active {
  background: var(--panel-2);
  border-color: var(--border);
  color: var(--text);
}

.account-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.primary-link {
  background: #202833;
  border-color: #394454;
  color: var(--text);
}

.plain-link {
  background: transparent;
}

.discord-link {
  background: var(--discord);
  border-color: #6d78f4;
  color: #ffffff;
}

.discord-link:hover,
.primary-link:hover,
.plain-link:hover {
  filter: brightness(1.08);
}

.full {
  width: 100%;
}

.forum-hero {
  position: relative;
  border-bottom: 1px solid var(--border);
  background: #11141a;
}

.forum-hero::before {
  display: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  min-height: 178px;
  margin: 0 auto;
  padding: 30px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: center;
  gap: 24px;
}

.hero-copy {
  max-width: 760px;
}

.section-label {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
  font-weight: 800;
}

.hero-copy p:last-child {
  max-width: 640px;
  margin-bottom: 0;
  color: #d1d7de;
  font-size: 18px;
  line-height: 1.55;
}

.hero-logo {
  padding: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.notice-bar {
  max-width: 1240px;
  margin: 20px auto 0;
  padding: 14px 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  background: var(--panel);
  color: var(--muted);
}

.notice-bar strong {
  color: var(--text);
  white-space: nowrap;
}

.toolbar {
  max-width: 1240px;
  margin: 20px auto 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.search-box {
  min-height: 44px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.search-box span {
  color: var(--dim);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.search-box input,
.site-form input,
.site-form textarea,
.site-form select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0b0e12;
  color: var(--text);
}

.search-box input {
  min-height: 40px;
  border: 0;
  background: transparent;
  outline: 0;
}

.page-layout {
  max-width: 1240px;
  margin: 22px auto 80px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

.content-column {
  display: grid;
  gap: 18px;
}

.panel,
.side-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.panel-title {
  min-height: 54px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-3);
}

.panel-title h2,
.side-panel h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.panel-title span {
  color: var(--dim);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.forum-row {
  min-height: 86px;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 92px minmax(150px, 210px);
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--border-soft);
  width: 100%;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

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

.forum-row:hover {
  background: var(--panel-2);
}

.forum-code {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #20252c;
  color: #d9dee4;
  font-size: 13px;
  font-weight: 800;
}

.forum-code.blue {
  border-color: #315a7a;
  background: #142232;
  color: #9ec5e7;
}

.forum-code.red {
  border-color: #693539;
  background: #2a1719;
  color: #e7a2a6;
}

.forum-main strong,
.forum-main small {
  display: block;
}

.forum-main strong {
  margin-bottom: 5px;
  font-size: 16px;
}

.forum-main small,
.forum-last,
.side-panel p,
.post-list span,
.doc-grid small {
  color: var(--muted);
  line-height: 1.4;
}

.forum-stats {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.forum-stats b {
  display: block;
  color: var(--text);
  font-size: 18px;
}

.forum-stats.open {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.forum-last {
  font-size: 13px;
}

.doc-grid {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.doc-grid button {
  min-height: 96px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-3);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.doc-grid button:hover {
  background: var(--panel-2);
}

.doc-grid strong,
.doc-grid small {
  display: block;
}

.doc-grid strong {
  margin-bottom: 6px;
}

.sidebar {
  display: grid;
  gap: 18px;
}

.side-panel {
  padding: 18px;
}

.side-panel h2 {
  margin-bottom: 14px;
}

.status-list {
  margin: 0;
}

.status-list div {
  padding: 11px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border-soft);
}

.status-list div:last-child {
  border-bottom: 0;
}

.status-list dt {
  color: var(--muted);
}

.status-list dd {
  margin: 0;
  font-weight: 800;
}

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

.post-list a,
.post-list button,
.post-list span {
  display: block;
}

.post-list button {
  margin-bottom: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.post-list span {
  font-size: 12px;
}

.side-panel p {
  margin-bottom: 16px;
}

.quick-links {
  display: grid;
  gap: 8px;
}

.quick-links button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-3);
  color: var(--muted);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.quick-links button:hover {
  background: var(--panel-2);
  color: var(--text);
}

.board-head,
.topic-head {
  padding: 18px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-3);
}

.board-head {
  display: grid;
  grid-template-columns: auto 44px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.board-head h2,
.topic-head h2 {
  margin: 0;
}

.board-head p,
.topic-head span {
  margin: 4px 0 0;
  color: var(--muted);
}

.back-link {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.back-link:hover {
  background: var(--panel-2);
  color: var(--text);
}

.topic-list {
  display: grid;
}

.topic-row,
.result-row {
  width: 100%;
  min-height: 72px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 86px 86px;
  gap: 14px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.topic-row:hover,
.result-row:hover {
  background: var(--panel-2);
}

.topic-tag {
  min-height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #4c3f25;
  border-radius: var(--radius);
  background: #17140f;
  color: #ded2b7;
  font-size: 12px;
  font-weight: 800;
}

.topic-main strong,
.topic-main small,
.result-row strong,
.result-row small {
  display: block;
}

.topic-main small,
.result-row small {
  margin-top: 4px;
  color: var(--muted);
}

.topic-row > span:not(.topic-tag):not(.topic-main) {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.topic-row b {
  display: block;
  color: var(--text);
  font-size: 16px;
}

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

.post aside,
.post > div {
  padding: 18px;
}

.post aside {
  border-right: 1px solid var(--border);
  background: #0d1116;
}

.post aside strong,
.post aside small {
  display: block;
}

.post aside small {
  margin-top: 6px;
  color: var(--muted);
}

.post p {
  line-height: 1.55;
}

.muted,
.empty-state {
  color: var(--muted);
}

.content-empty {
  margin: 0;
  padding: 24px 18px;
}

.reply-form,
.site-form {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.site-form label,
.reply-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.site-form input,
.site-form textarea,
.site-form select,
.reply-form textarea {
  padding: 11px 12px;
}

.site-form textarea,
.reply-form textarea {
  resize: vertical;
}

.confirmation,
.document-body,
.search-results {
  padding: 18px;
}

.training-preview {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 12px;
  align-items: stretch;
}

.calendar-head {
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-3);
}

.calendar-head span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-head h2 {
  margin: 0;
}

.calendar-permission {
  color: var(--dim);
  font-size: 12px;
  font-weight: 700;
}

.calendar-layout {
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.calendar-weekday,
.calendar-day {
  min-height: 96px;
  padding: 10px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #0d1116;
}

.calendar-weekday {
  min-height: 36px;
  display: flex;
  align-items: center;
  color: var(--dim);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-day strong {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.calendar-day.has-event {
  background: #121821;
}

.calendar-day button {
  width: 100%;
  margin-top: 6px;
  padding: 7px;
  border: 1px solid #394454;
  border-radius: var(--radius);
  background: #202833;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.calendar-day button:hover {
  background: #263142;
}

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

.training-list h3 {
  margin-bottom: 4px;
}

.training-card {
  min-height: 116px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-3);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.training-card:hover {
  background: var(--panel-2);
}

.training-card span,
.training-card strong,
.training-card small,
.training-card em {
  display: block;
}

.training-card span {
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.training-card strong {
  margin-bottom: 6px;
}

.training-card small {
  color: var(--muted);
  line-height: 1.35;
}

.training-card em {
  margin-top: 10px;
  color: var(--dim);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.training-detail {
  padding: 18px;
}

.training-detail dl {
  margin: 0 0 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.training-detail dl div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-3);
}

.training-detail dt {
  margin-bottom: 6px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.training-detail dd {
  margin: 0;
  font-weight: 800;
}

.rsvp-actions {
  margin: 18px 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-link.selected,
.plain-link.selected {
  border-color: var(--green);
  color: var(--text);
}

.attendee-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.attendee-grid section {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-3);
}

.attendee-grid h3 {
  margin-bottom: 10px;
}

.attendee-grid ul {
  margin: 0;
  padding-left: 20px;
}

.attendee-grid li {
  margin: 7px 0;
}

.document-body {
  line-height: 1.6;
}

.document-body li {
  margin: 8px 0;
}

.confirmation h2 {
  margin-bottom: 8px;
}

.user-pill {
  min-height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
  font-size: 13px;
  font-weight: 800;
}

.avatar {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: var(--discord);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  object-fit: cover;
}

.avatar.large {
  width: 42px;
  height: 42px;
  font-size: 14px;
}

.discord-panel p {
  line-height: 1.45;
}

.discord-panel small {
  display: block;
  margin-top: 10px;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.4;
}

.discord-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

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

.discord-user small {
  margin-top: 3px;
  color: var(--muted);
}

.role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.role-list span {
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.oauth-card {
  padding: 18px;
}

.oauth-card p {
  line-height: 1.5;
}

.oauth-card ul {
  margin: 0 0 18px;
  padding-left: 20px;
  color: var(--muted);
}

.oauth-card li {
  margin: 8px 0;
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #693539;
  border-radius: var(--radius);
  background: #2a1719;
  color: #f0a9ad;
  font-size: 13px;
  line-height: 1.4;
}

.form-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--dim);
  font-size: 12px;
  text-transform: uppercase;
}

.form-divider::before,
.form-divider::after {
  height: 1px;
  flex: 1;
  background: var(--border);
  content: "";
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.discord-mark {
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--discord);
  color: #ffffff;
  font-weight: 900;
}

.modal-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: min(440px, 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.modal h2 {
  margin: 0;
  padding: 18px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-3);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.modal-close:hover {
  background: var(--panel-2);
  color: var(--text);
}

@media (max-width: 980px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    grid-column: 1 / -1;
    padding-bottom: 14px;
    overflow-x: auto;
  }

  .page-layout,
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-logo {
    display: none;
  }

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

  .forum-stats,
  .forum-last {
    grid-column: 2;
    text-align: left;
  }

  .toolbar,
  .board-head,
  .topic-row,
  .calendar-layout,
  .training-preview {
    grid-template-columns: 1fr;
  }

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

  .calendar-weekday {
    display: none;
  }

  .training-detail dl,
  .attendee-grid {
    grid-template-columns: 1fr;
  }

  .topic-row > span:not(.topic-tag):not(.topic-main) {
    text-align: left;
  }

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

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

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

@media (max-width: 620px) {
  .header-inner,
  .hero-inner,
  .page-layout {
    padding-left: 14px;
    padding-right: 14px;
  }

  .header-inner {
    gap: 12px;
  }

  .brand span {
    display: none;
  }

  .account-actions .plain-link {
    display: none;
  }

  .notice-bar {
    margin-left: 14px;
    margin-right: 14px;
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-inner {
    min-height: 156px;
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .hero-copy p:last-child {
    font-size: 16px;
  }

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

  .forum-row {
    padding: 14px;
    gap: 12px;
  }

  .toolbar {
    padding-left: 14px;
    padding-right: 14px;
  }
}
