*, *::before, *::after {
  box-sizing: border-box;
}

h1, h2, h3, h4, p, span, label, button, input, textarea, code, strong, a, footer {
  text-shadow: none !important;
  filter: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: #f5f7fb;
  color: #172033;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.55;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid #e3e8f0;
}

.topbar-inner, main, footer {
  width: min(1120px, 100% - 2rem);
  margin-inline: auto;
}

.topbar-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: #172033;
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: .7rem;
  background: #e9eaff;
  color: #4b49bf;
  font-size: 1.2rem;
}

.account {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.account-label, .muted, .question-meta {
  color: #68748a;
  font-size: .9rem;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .55rem .95rem;
  border: 0;
  border-radius: .7rem;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.button:disabled, button:disabled {
  cursor: wait;
  opacity: .65;
}

.button-primary {
  background: #514fd0;
  color: #fff;
}

.button-primary:hover {
  background: #403eb6;
}

.button-discord {
  background: #5865f2;
  color: #fff;
}

.button-secondary {
  background: #edf0f6;
  color: #28334a;
}

.button-small {
  min-height: 34px;
  padding: .4rem .7rem;
  font-size: .86rem;
}

main {
  flex: 1;
  padding-block: 2.5rem 3rem;
}

.intro {
  max-width: 720px;
  margin-bottom: 2rem;
}

.eyebrow {
  margin: 0 0 .45rem;
  color: #514fd0;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

h1, h2, h3, h4, p {
  margin-top: 0;
}

h1 {
  margin-bottom: .5rem;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -.04em;
}

.intro > p:not(.eyebrow) {
  max-width: 620px;
  color: #58657b;
}

.connection-status {
  display: inline-flex;
  margin: .25rem 0 0;
  padding: .3rem .65rem;
  border-radius: 999px;
  background: #edf0f6;
  font-size: .82rem;
  font-weight: 700;
}

.connection-ok {
  background: #e4f6ed;
  color: #17653d;
}

.connection-warning {
  background: #fff2d6;
  color: #7a4c00;
}

.layout {
  display: grid;
  grid-template-columns: minmax(240px, 310px) minmax(0, 1fr);
  align-items: start;
  gap: 1.5rem;
}

.panel, .question-card {
  border: 1px solid #e3e8f0;
  border-radius: 1rem;
  background: #fff;
}

.ask-panel {
  position: sticky;
  top: 1rem;
  padding: 1.25rem;
}

.ask-panel h2, .section-heading h2 {
  margin-bottom: .35rem;
  font-size: 1.2rem;
}

form {
  display: grid;
  gap: .65rem;
}

label {
  color: #34415a;
  font-size: .88rem;
  font-weight: 700;
}

input, textarea, select {
  width: 100%;
  padding: .7rem .75rem;
  border: 1px solid #cbd3e0;
  border-radius: .65rem;
  background: #fff;
  color: #172033;
  font: inherit;
}

textarea {
  resize: vertical;
}

input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid #b7b6ff;
  outline-offset: 2px;
}

.ask-panel form, .ask-panel .button {
  margin-top: .9rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .8rem;
}

.section-heading .eyebrow {
  margin-bottom: .15rem;
}

.filter-label {
  min-width: 140px;
}

.questions-list {
  display: grid;
  gap: .85rem;
}

.question-card {
  padding: 1.15rem;
}

.question-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.question-title {
  margin-bottom: .5rem;
  font-size: 1.08rem;
  overflow-wrap: anywhere;
}

.badge {
  flex: 0 0 auto;
  padding: .22rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 800;
}

.badge-open {
  background: #fff2d6;
  color: #7a4c00;
}

.badge-resolved {
  background: #e4f6ed;
  color: #17653d;
}

.question-preview, .answer-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.question-meta {
  margin-bottom: .65rem;
}

.text-button {
  padding: .25rem 0;
  border: 0;
  background: transparent;
  color: #514fd0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.answer-area {
  display: grid;
  gap: .75rem;
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px solid #e9edf3;
}

.answers-heading {
  margin-bottom: 0;
  font-size: .98rem;
}

.answer {
  padding: .85rem;
  border: 1px solid #e6eaf1;
  border-radius: .75rem;
  background: #fafbfe;
}

.accepted-answer {
  border-color: #9bd5b3;
  background: #f0fbf4;
}

.accepted-label {
  display: inline-block;
  margin-bottom: .4rem;
  padding: .18rem .55rem;
  border-radius: 999px;
  background: #d7f3e2;
  color: #17653d;
  font-size: .75rem;
  font-weight: 800;
}

.answer-form {
  padding-top: .7rem;
}

.empty-state {
  padding: 1.2rem;
  border: 1px dashed #cbd3e0;
  border-radius: .8rem;
  color: #68748a;
  text-align: center;
}

.message {
  min-height: 1.4rem;
  margin: 0 0 .6rem;
  font-size: .9rem;
  font-weight: 700;
}

.message-error {
  color: #a52c2c;
}

.message-success {
  color: #17653d;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem;
  border-top: 1px solid #e3e8f0;
  color: #68748a;
  font-size: .84rem;
  font-weight: 700;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .ask-panel {
    position: static;
  }
}

@media (max-width: 520px) {
  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    padding-block: .8rem;
  }

  .account {
    width: 100%;
    flex-wrap: wrap;
  }

  .section-heading, footer {
    align-items: stretch;
    flex-direction: column;
  }
}
