/* The forum is rendered on the server and shares the public app shell. */
:root {
  --green: var(--app-blue);
  --muted: var(--app-secondary);
  --line: var(--app-line);
  color: var(--app-ink);
  background: var(--app-canvas);
}
.forum-header {
  min-height: 65px;
  padding: 8px var(--app-gutter);
  border-bottom: 1px solid var(--line);
  gap: 12px;
  background: #f8f8fa;
}
.forum-header .forum-home {
  font-size: 16px;
  font-weight: 680;
  letter-spacing: -0.03em;
}
.forum-header .header-links {
  margin-inline: 0 auto;
}
.forum-header .header-links a {
  font-size: 13px;
}
.forum-header .member-nav {
  margin-left: auto;
}
.app-body main {
  padding-inline: var(--app-gutter);
  width: 100%;
  max-width: 1500px;
}
.app-body footer {
  padding-bottom: 20px;
}
.forum-heading h1,
.topic-title h1,
.auth-copy h1 {
  letter-spacing: -0.045em;
}
.discussion-list,
.topic-list,
.forum-post,
.auth-card,
.side-card,
.forum-panel,
.form-page form {
  border-radius: 17px;
}
.forum-search,
.forum-search input,
.account-menu > div {
  border-radius: 12px;
}
.button,
.member-nav .button {
  border-radius: 12px;
}
.button:hover {
  background: #005bb7;
}
.button.secondary:hover,
.nav-active,
.side-nav .active {
  background: var(--app-selected);
  color: var(--app-blue);
}
.forum-consent {
  color: var(--app-ink);
  background: white;
  border-color: var(--line);
}
.forum-shell {
  grid-template-columns: 175px minmax(0, 1fr);
}
@media (min-width: 1024px) and (max-width: 1320px) {
  .forum-shell {
    display: block;
  }
  .forum-sidebar {
    margin-bottom: 16px;
  }
  .forum-columns,
  .topic-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .side-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
}
@media (max-width: 1023px) {
  .forum-header {
    flex-wrap: wrap;
    padding: 10px var(--app-gutter);
    min-height: 60px;
  }
  .forum-header .app-mobile-brand {
    display: block;
  }
  .forum-header .header-links {
    order: 3;
    width: 100%;
    margin: 0;
    gap: 18px;
  }
  .forum-header .forum-home {
    display: none;
  }
  .forum-consent {
    bottom: calc(68px + env(safe-area-inset-bottom));
  }
}
@media (max-width: 480px) {
  .forum-header .header-links {
    display: none;
  }
  .forum-header .member-nav {
    flex-wrap: wrap;
    gap: 8px;
  }
  .forum-header .app-brand {
    font-size: 15px;
  }
  .forum-header .app-brand img {
    width: 26px;
    height: 26px;
  }
}

.forum-topline {
  display: none;
}
.forum-shell {
  max-width: 960px;
  margin: 0 auto;
}
.forum-heading {
  padding-block: 20px;
}
.forum-heading h1 {
  font-size: clamp(30px, 3vw, 38px);
  line-height: 1.12;
}
.discussion-list {
  border: 0;
  border-radius: 13px;
}
.list-toolbar {
  flex-wrap: wrap;
  gap: 12px;
}
.list-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 0;
  background: #e5e5ea;
  border-radius: 9px;
}
.list-tabs a {
  flex: 1;
  min-height: 32px;
  padding: 6px 12px;
  border: 0;
  border-radius: 7px;
  text-align: center;
  font-size: 13px;
}
.list-tabs a[aria-current] {
  background: white;
  color: var(--app-ink);
  box-shadow: 0 1px 4px #0002;
}
.forum-search {
  border: 0;
  background: #ededf1;
  border-radius: 10px;
}
.forum-search input {
  border: 0;
  background: transparent;
  font-size: 16px;
}
.pinned-row {
  background: #f6f8fc;
}
.topic-copy h2 {
  font-weight: 550;
}
@media (max-width: 1023px) {
  .forum-shell {
    display: flex;
    flex-direction: column;
  }
  .forum-shell > .forum-content {
    width: 100%;
    order: 0;
  }
  .forum-shell > .forum-sidebar {
    width: 100%;
    order: 1;
  }
  .list-tabs {
    width: 100%;
  }
  .forum-heading {
    align-items: center;
  }
}

/* Matching app surfaces and spacing. */
.forum-header {
  background: rgba(245, 245, 247, 0.9);
  border-bottom: 1px solid #e3e3e8;
  backdrop-filter: blur(20px);
}
.discussion-list,
.forum-post,
.auth-card,
.side-card,
.forum-panel,
.form-page form {
  border-radius: 22px;
  border-color: #e5e5ea;
}
.forum-heading {
  padding-block: 28px;
}
.forum-search {
  border-radius: 16px;
  background: #eaeaec;
}
.topic-copy h2 {
  font-weight: 600;
  letter-spacing: -0.025em;
}
.list-tabs {
  border-radius: 13px;
  padding: 4px;
}
.list-tabs a {
  border-radius: 10px;
}
.forum-consent {
  border-radius: 22px;
}
@media (max-width: 1023px) {
  .forum-consent {
    bottom: calc(98px + env(safe-area-inset-bottom));
  }
}

/* Account, discussion and editor templates use the same mobile control scale. */
.app-body main {
  overflow-wrap: anywhere;
}
.app-body :is(h1, h2, h3) {
  text-wrap: pretty;
}
.app-body main h1 {
  font-size: clamp(31px, 3.3vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.045em;
}
.app-body
  main
  :is(
    .panel,
    .auth-card,
    .forum-panel,
    .side-card,
    .form-page form,
    .forum-post
  ) {
  background: white;
  border-radius: 22px;
  border-color: #e5e5eb;
}
.app-body
  main
  :is(input:not([type="checkbox"], [type="radio"], [type="hidden"]), select) {
  min-height: 46px;
  border-radius: 12px;
  background: #f5f5f7;
  border-color: #e3e3e8;
}
.app-body main textarea {
  border-radius: 14px;
  background: #f5f5f7;
  border-color: #e3e3e8;
}
.app-body .button,
.app-body .password-toggle,
.app-body .list-tabs a {
  min-height: 44px;
}
.app-body .password-toggle {
  min-width: 44px;
}
.app-body main :is(.auth-card, .form-page) label {
  font-size: 13px;
  line-height: 1.6;
}
.app-body main :is(.settings-detail, .danger-zone) > summary {
  min-height: 48px;
  padding-block: 15px;
}
@media (max-width: 700px) {
  .app-body main {
    padding-top: 16px;
  }
  .app-body
    main
    :is(input:not([type="checkbox"], [type="radio"]), select, textarea) {
    font-size: 16px;
  }
  .app-body .auth-layout {
    gap: 20px;
    padding-top: 4px;
  }
  .app-body .auth-intro {
    padding: 0;
  }
  .app-body .auth-intro .benefits {
    display: none;
  }
  .app-body .auth-intro h2 {
    font-size: 23px;
    letter-spacing: -0.035em;
  }
  .app-body .auth-card,
  .app-body .panel {
    padding: 22px;
  }
  .app-body .forum-heading {
    padding-block: 14px 22px;
  }
  .app-body .topic-layout,
  .app-body .settings-layout {
    gap: 20px;
  }
  .app-body .forum-post {
    padding: 19px;
  }
  .app-body .post-body {
    font-size: 15px;
    line-height: 1.75;
  }
  .app-body .post-actions button,
  .app-body .editor-toolbar button {
    min-height: 44px;
    min-width: 44px;
  }
  .app-body .forum-header .member-nav .button {
    min-height: 42px;
  }
}

/* Keep compact controls legible on the narrowest phones. */
.app-body .password-input {
  border: 0;
  border-radius: 13px;
  background: #f2f2f7;
}
.app-body .password-input input {
  flex: 1;
  min-width: 0;
  width: 0;
  border: 0;
  background: transparent;
}
.app-body .password-input .password-toggle {
  flex: none;
  min-width: 58px;
  white-space: nowrap;
}
.app-body .forum-search button {
  flex: none;
  min-width: 60px;
  white-space: nowrap;
}
.app-body main input,
.app-body main textarea,
.app-body main select {
  font-weight: 400;
  color: #292932;
}
.app-body .editor-toolbar {
  flex-wrap: wrap;
  gap: 4px;
}
.app-body .editor-toolbar > div {
  flex-wrap: wrap;
  gap: 0;
}
.app-body .editor-toolbar .preview-button {
  white-space: nowrap;
  min-width: 72px;
}
.app-body .new-topic-layout,
.app-body .new-topic-layout > *,
.app-body .markdown-editor {
  min-width: 0;
}
.app-body .category-card,
.app-body .join-conversation,
.app-body .form-page.post-body {
  border: 1px solid #e7e7ed;
  border-radius: 22px;
  background: white;
}
.app-body .category-card {
  border-top-width: 1px;
}
.app-body .topic-row h2 {
  font-size: 15px;
  line-height: 1.5;
  font-weight: 600;
}
.app-body .topic-details {
  font-size: 11px;
}
.app-body .profile-header {
  overflow: hidden;
}
.app-body .profile-header .profile-banner {
  border-radius: 15px;
}
.app-body .post-body {
  border-radius: 18px;
}
@media (max-width: 700px) {
  .app-body .list-head {
    display: none;
  }
  .app-body .topic-row {
    padding-block: 20px;
  }
  .app-body .forum-heading {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px;
  }
  .app-body .forum-heading > div {
    flex: 1 1 220px;
  }
  .app-body .form-page.post-body {
    padding: 22px;
  }
  .app-body .profile-header {
    padding: 0;
  }
  .app-body .profile-header .profile-banner {
    border-radius: 0;
  }
  .app-body .member-nav .notification-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}
