:root {
  --c-bg: #06111f;
  --c-panel: #0a1829;
  --c-panel-2: #0d2035;
  --c-line: #263c57;
  --c-text: #edf3fa;
  --c-muted: #9bacc0;
  --c-blue: #3995ff;
  --c-purple: #aa65ff;
  --c-orange: #ff8b3d;
  --c-green: #56d69a;
  --c-red: #ff7f73;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html {
  background: var(--c-bg);
  color: var(--c-text);
}
body {
  margin: 0;
  background:
    radial-gradient(
      circle at 85% 5%,
      rgba(85, 47, 150, 0.18),
      transparent 28rem
    ),
    var(--c-bg);
  line-height: 1.55;
}
a {
  color: #80baff;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
}
.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 20;
  background: white;
  color: #06111f;
  padding: 0.6rem;
}
.commons-header {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1rem max(1.25rem, calc((100vw - 1440px) / 2));
  border-bottom: 1px solid var(--c-line);
  background: #06101dcc;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
  letter-spacing: 0.18em;
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1.4;
}
.brand:hover {
  text-decoration: none;
}
.brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}
.brand small,
.brand-text small {
  display: block;
  color: #8296ad;
  font-size: 0.58rem;
  letter-spacing: 0;
  font-weight: 400;
  text-transform: none;
}
.commons-header nav {
  display: flex;
  gap: 1.3rem;
  margin-left: auto;
}
.commons-header nav a,
.account-nav a,
.link-button {
  color: #b9c6d6;
  font-size: 0.76rem;
}
.account-nav {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  border-left: 1px solid var(--c-line);
  padding-left: 1rem;
}
.link-button {
  border: 0;
  background: none;
  cursor: pointer;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #4da0ff;
  background: #2587f0;
  color: white;
  padding: 0.72rem 1rem;
  font-weight: 700;
  cursor: pointer;
}
.button:hover {
  text-decoration: none;
  background: #3895f7;
}
.button.secondary {
  background: transparent;
  color: #bcd4ee;
  border-color: #3d5c7d;
}
.button.small {
  padding: 0.4rem 0.65rem;
  font-size: 0.7rem;
}
.commons-shell {
  max-width: 1440px;
  margin: auto;
  padding: 2rem;
}
.commons-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: end;
  padding: 2.2rem 0;
  border-bottom: 1px solid var(--c-line);
}
.eyebrow {
  color: var(--c-blue);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
  font-size: 0.72rem;
}
.commons-hero h1,
.thread h1,
.auth-page h1 {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1;
  margin: 0.3rem 0;
}
.commons-hero p {
  max-width: 760px;
  color: var(--c-muted);
  font-size: 1.08rem;
}
.hero-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.commons-search {
  display: grid;
  grid-template-columns: 2fr repeat(5, minmax(120px, 1fr)) auto;
  gap: 0.55rem;
  padding: 1rem 0;
}
.commons-search input,
.commons-search select,
.community-form input,
.community-form select,
.community-form textarea {
  width: 100%;
  border: 1px solid #36516e;
  background: #081728;
  color: var(--c-text);
  padding: 0.7rem;
}
.commons-search button {
  border: 1px solid #416383;
  background: #0e2239;
  color: white;
  padding: 0.7rem 1rem;
}
.commons-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(290px, 0.8fr);
  gap: 1rem;
}
.section-panel {
  border: 1px solid var(--c-line);
  background: rgba(9, 25, 43, 0.82);
  padding: 1rem;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  border-bottom: 1px solid var(--c-line);
  padding-bottom: 0.7rem;
}
.section-heading h2 {
  font-family: Georgia, serif;
  font-weight: 400;
  margin: 0;
  font-size: 1.8rem;
}
.post-list {
  display: grid;
}
.post-card {
  padding: 1rem 0;
  border-bottom: 1px solid var(--c-line);
}
.post-card:last-child {
  border-bottom: 0;
}
.post-card h3 {
  font-family: Georgia, serif;
  font-size: 1.35rem;
  margin: 0.35rem 0;
}
.post-card p {
  color: var(--c-muted);
  margin: 0.35rem 0;
}
.post-card-top,
.taxonomy,
.post-card footer,
.byline,
.thread-actions,
.reply footer {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}
.post-type,
.answered,
.unanswered,
.taxonomy a,
.taxonomy span {
  display: inline-flex;
  border: 1px solid #355574;
  padding: 0.18rem 0.42rem;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.post-type.question {
  color: #7fbeff;
}
.post-type.discussion {
  color: #c28cff;
}
.post-type.explanation {
  color: #ffa15f;
}
.answered {
  color: var(--c-green);
}
.unanswered {
  color: #e3b263;
}
.taxonomy {
  margin: 0.55rem 0;
}
.taxonomy a,
.taxonomy span {
  border-color: #263c57;
  color: #8fa8c1;
}
.post-card footer,
.byline {
  color: #71869e;
  font-size: 0.68rem;
}
.topic-nav {
  display: grid;
  gap: 0.45rem;
}
.topic-nav a {
  display: flex;
  justify-content: space-between;
  padding: 0.65rem;
  border-bottom: 1px solid var(--c-line);
}
.empty-state,
.error-state,
.loading-state,
.sign-in-callout {
  padding: 1.5rem;
  text-align: center;
  border: 1px dashed #38536f;
  color: var(--c-muted);
}
.thread-wrap {
  max-width: 1120px;
  margin: auto;
  padding: 2rem;
}
.thread,
.reply,
.community-form,
.auth-card,
.profile-card,
.moderation-card {
  border: 1px solid var(--c-line);
  background: var(--c-panel);
  padding: clamp(1rem, 3vw, 2rem);
}
.thread h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}
.related-resource {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-block: 1px solid var(--c-line);
  margin: 1rem 0;
}
.related-resource span {
  color: var(--c-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}
.user-content {
  max-width: 760px;
  font-family: Georgia, serif;
  font-size: 1.08rem;
}
.user-content h2,
.user-content h3 {
  font-family: Georgia, serif;
}
.user-content blockquote {
  border-left: 3px solid var(--c-purple);
  margin-left: 0;
  padding-left: 1rem;
  color: #c7d5e4;
}
.user-content code {
  font-family: ui-monospace, monospace;
  background: #11243a;
  padding: 0.1rem 0.25rem;
}
.community-math {
  overflow-x: auto;
  padding: 0.5rem 0;
}
.thread-actions,
.reply footer {
  margin-top: 1rem;
}
.thread-actions button,
.reply footer button {
  border: 1px solid #36516e;
  background: #0b1c31;
  color: #bcd0e4;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
}
.replies {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.25rem;
}
.reply header {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  color: #8196ad;
  font-size: 0.72rem;
}
.reply header strong {
  color: #dfe9f4;
}
.reply.accepted-reply {
  border-color: #3f9e74;
}
.accepted {
  color: var(--c-green);
  text-transform: uppercase;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}
.community-form {
  display: grid;
  gap: 0.85rem;
}
.community-form label {
  display: grid;
  gap: 0.3rem;
  color: #afc0d2;
}
.community-form textarea {
  min-height: 180px;
  resize: vertical;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}
.form-help,
.form-message,
.development-note {
  color: #8196ad;
  font-size: 0.72rem;
}
.form-message.error {
  color: var(--c-red);
}
.auth-page {
  max-width: 720px;
  margin: auto;
  padding: 3rem 1.25rem;
}
.auth-card {
  display: grid;
  gap: 0.8rem;
}
.policy-page {
  max-width: 850px;
  margin: auto;
  padding: 3rem 1.5rem;
}
.policy-page h1 {
  font-family: Georgia, serif;
  font-size: 3rem;
}
.draft-notice {
  border-left: 3px solid var(--c-orange);
  background: #21180f;
  padding: 1rem;
}
.moderation-grid {
  display: grid;
  gap: 1rem;
}
.moderation-card form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.moderation-card select,
.moderation-card input {
  background: #071628;
  color: white;
  border: 1px solid #36516e;
  padding: 0.45rem;
}
.profile-history {
  display: grid;
  gap: 0.65rem;
}
.notice-count {
  display: inline-flex;
  min-width: 1.4rem;
  justify-content: center;
  background: var(--c-purple);
  color: white;
  border-radius: 999px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.commons-page-footer {
  max-width: 1440px;
  margin: 3rem auto 0;
  border-top: 1px solid var(--c-line);
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: #7f94aa;
}
.commons-page-footer nav {
  display: flex;
  gap: 1rem;
}
.commons-footer-policies {
  display: flex;
  gap: 2rem;
}
.commons-footer-policies nav {
  align-items: flex-start;
  flex-direction: column;
  gap: 0.35rem;
}
.commons-footer-policies h2 {
  margin: 0 0 0.25rem;
  color: #d9e6f3;
  font: 700 0.7rem/1.2 Inter, system-ui, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.commons-footer-policies a {
  color: #8fa8bf;
  font-size: 0.78rem;
}
.brand-text {
  color: white;
  font-weight: 700;
  letter-spacing: 0.16em;
}
@media (max-width: 1050px) {
  .commons-header nav {
    display: none;
  }
  .account-nav {
    margin-left: auto;
  }
  .commons-search {
    grid-template-columns: repeat(3, 1fr);
  }
  .commons-search input {
    grid-column: 1/-1;
  }
  .commons-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .commons-header {
    min-height: 76px;
    padding: 0.7rem 1rem;
  }
  .brand img {
    width: 42px;
    height: 42px;
  }
  .brand span {
    font-size: 0.66rem;
  }
  .account-nav a:first-child {
    display: none;
  }
  .commons-shell,
  .thread-wrap {
    padding: 1rem;
  }
  .commons-hero {
    grid-template-columns: 1fr;
  }
  .commons-search {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .related-resource,
  .commons-page-footer {
    display: grid;
  }
  .commons-footer-policies {
    flex-wrap: wrap;
  }
  .thread,
  .reply,
  .community-form {
    padding: 1rem;
  }
  .tds-results {
    border-left: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
:focus-visible {
  outline: 3px solid #ffa24d;
  outline-offset: 3px;
}
