:root {
  --blue: #0877f9;
  --blue-700: #055dcc;
  --blue-100: #eaf3ff;
  --blue-50: #f5f9ff;
  --ink: #17233b;
  --muted: #6f7c90;
  --line: #e4eaf2;
  --surface: #ffffff;
  --canvas: #f5f8fc;
  --green: #16a25a;
  --green-50: #ebfbf3;
  --red: #ef4b56;
  --orange: #ff8a00;
  --shadow: 0 8px 28px rgba(24, 49, 83, 0.08);
  --radius: 16px;
}

:root[data-theme="dark"] {
  --ink: #f3f5f8;
  --muted: #aab4c2;
  --line: #394351;
  --surface: #252a31;
  --canvas: #171a1f;
  --blue-50: #202c3b;
  --blue-100: #243b58;
  color-scheme: dark;
}

:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .post-card,
:root[data-theme="dark"] .question-card,
:root[data-theme="dark"] .form-card,
:root[data-theme="dark"] .post-modal,
:root[data-theme="dark"] .modal-comment,
:root[data-theme="dark"] .ui-dialog,
:root[data-theme="dark"] .dialog-footer,
:root[data-theme="dark"] .input,
:root[data-theme="dark"] .select,
:root[data-theme="dark"] .reaction-picker {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family:
    "Be Vietnam Pro", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 14px;
  line-height: 1.3;
}

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

button,
a,
[data-action] {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

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

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 8px rgba(25, 45, 74, 0.04);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--blue);
  font-size: 19px;
  font-weight: 800;
  text-decoration: none;
}

.brand img {
  width: 38px;
  height: 38px;
}

.top-actions,
.top-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.top-link {
  border: 0;
  color: #374357;
  background: transparent;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}

.icon-btn {
  position: relative;
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: #4c5a70;
  background: transparent;
}

.icon-btn:hover {
  color: var(--blue);
  background: var(--blue-50);
}

.notif-dot,
.notif-count {
  position: absolute;
  top: 2px;
  right: 1px;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  display: inline-grid;
  place-items: center;
  border: 2px solid white;
  border-radius: 999px;
  background: var(--blue);
  color: white;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.notif-dot {
  top: 7px;
  right: 7px;
  min-width: 7px;
  width: 7px;
  height: 7px;
  padding: 0;
}

.notif-count[hidden] {
  display: none;
}

.notification-wrap {
  position: relative;
}

.notification-popover {
  position: absolute;
  z-index: 70;
  top: calc(100% + 12px);
  right: -42px;
  width: min(380px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(28, 48, 76, 0.2);
}

.notification-popover::before {
  position: absolute;
  top: -7px;
  right: 54px;
  width: 12px;
  height: 12px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--surface);
  content: "";
  transform: rotate(45deg);
}

.notification-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.notification-head button {
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-weight: 700;
}

.notification-list {
  max-height: min(540px, calc(100vh - 110px));
  overflow-y: auto;
}

.notification-item {
  position: relative;
  display: grid;
  width: 100%;
  gap: 3px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid #edf1f6;
  background: white;
  text-align: left;
}

.notification-item:hover {
  background: #f7faff;
}

.notification-item.unread {
  padding-left: 28px;
  background: #f1f7ff;
}

.notification-item.unread::before {
  position: absolute;
  top: 19px;
  left: 13px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  content: "";
}

.notification-title {
  font-weight: 800;
}

.notification-body {
  overflow: hidden;
  color: #637186;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-item time {
  color: #8a96a7;
  font-size: 14px;
}

.notification-empty {
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
}

.layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}

.sidebar {
  position: sticky;
  top: 64px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
  padding: 20px 16px 18px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.profile-card {
  margin-bottom: 22px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

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

.avatar {
  display: inline-grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border: 2px solid white;
  border-radius: 50%;
  color: white;
  background: linear-gradient(145deg, #293b66, #78b8ff);
  box-shadow: 0 0 0 1px #d8e2ef;
  font-size: 15px;
  font-weight: 800;
}

.avatar.warm {
  background: linear-gradient(145deg, #6a3219, #f3ba7d);
}

.avatar.green {
  background: linear-gradient(145deg, #1e604a, #5bc299);
}

.avatar.pink {
  background: linear-gradient(145deg, #763151, #f39abb);
}

.avatar.small {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.avatar.large {
  width: 44px;
  height: 44px;
}

.profile-name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom:5px;
}

.level-pill {
  display: inline-flex;
  padding: 3px 5px;
  border-radius: 20px;
  color: white;
  background: var(--orange);
  font-size: 10px;
  font-weight: 600;
}

.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.copy-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 6px;
  background: #f7f9fc;
  color: #5c687b;
  cursor: pointer;
}

.copy-field:hover {
  color: var(--blue);
}

.nav-section-label {
  margin: 10px 10px 6px;
  color: #a1adbd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-nav {
  display: grid;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  color: #5d697c;
  background: transparent;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
}

.nav-item:hover {
  color: var(--blue);
  background: var(--blue-50);
}

.nav-item.active {
  color: var(--blue);
  background: var(--blue-100);
  font-weight: 700;
}

.nav-icon {
  display: inline-grid;
  width: 18px;
  flex: 0 0 18px;
  place-items: center;
  text-align: center;
}

.nav-icon img {
  display: block;
  width: 16px;
  height: 16px;
}

.nav-icon img {
  display: block;
  width: 16px;
  height: 16px;
}

.logout {
  width: 100%;
  margin-top: auto;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  color: #6d7889;
  background: #f7f9fc;
  font-size: 14px;
  font-weight: 700;
}

.main {
  min-width: 0;
  padding: 20px 24px 48px;
}

.content-wrap {
  width: min(1320px, 100%);
  margin: 0 auto;
}

.content-wrap.wide {
  width: min(1320px, 100%);
}

.section-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.section-tab {
  position: relative;
  padding: 12px 15px 14px;
  border: 0;
  color: #687589;
  background: transparent;
  font-size: 14px;
}

.section-tab.active {
  color: var(--blue);
  font-weight: 700;
}

.section-tab.active::after {
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--blue);
  content: "";
}

.chip-close {
  border: 0;
  color: currentColor;
  background: transparent;
  font-size: 17px;
  line-height: 1;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 12px;
  font-size: 20px;
}

.hot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.hot-card,
.post-card,
.question-card,
.panel,
.form-card,
.permissions-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 3px 15px rgba(23, 49, 80, 0.035);
}

.hot-card {
  min-width: 280px;
  overflow: hidden;
}

.hot-image {
  aspect-ratio: 16 / 8.6;
  width: 100%;
  object-fit: cover;
}

.hot-body {
  padding: 12px 14px;
}

.hot-title {
  min-height: 42px;
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.5;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  color: #536174;
  font-size: 13px;
}

.card-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
}

.card-action:hover,
.card-action.active {
  color: var(--blue);
}

.latest-list {
  display: grid;
  gap: 16px;
}

.post-card {
  padding: 16px;
}

.post-meta,
.question-author {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.author-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-name {
  font-size: 14px;
  font-weight: 800;
}

.meta-line {
  color: #8490a2;
  font-size: 12px;
  margin-top:5px;
}

.more-btn {
  border: 0;
  color: #a1adbd;
  background: transparent;
  font-size: 16px;
}

.post-copy h3 {
  margin: 14px 0 6px;
  font-size: 15px;
}
.formatted-content,
.post-copy p {
  font-size: 13px;
}

.inline-math,
.display-math {
  display: inline-block;
  max-width: 100%;
  padding: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  vertical-align: middle;
  --border: none;
  --field-border: none;
  --contains-highlight-background-color: transparent;
}

.inline-math::part(container),
.display-math::part(container) {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.display-math {
  display: block;
  margin: 8px 0;
  text-align: center;
}

.post-copy p,
.formatted-content,
.comment-text {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  margin: 0 0 12px;
}

.api-post:not(.full-post) .post-copy-content {
  position: relative;
  max-height: 400px;
  overflow: hidden;
}

.api-post.scheduled-post:not(.full-post) .post-copy,
.api-post.scheduled-post:not(.full-post) .post-image-frame,
.api-post.scheduled-post:not(.full-post) .feed-actions {
  filter: blur(0.8px);
  pointer-events: none;
  user-select: none;
}

.api-post.scheduled-post:not(.full-post) .post-copy {
  position: relative;
}

.api-post.pinned-post:not(.full-post) .post-copy-content {
  max-height: 210px;
}

.api-post .post-copy-content.empty {
  height: 0;
}

.post-copy-content.has-overflow::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 44px;
  background: linear-gradient(to bottom, transparent, var(--surface));
  content: "";
  pointer-events: none;
}

.full-post .post-copy-content {
  height: auto;
  overflow: visible;
}

.post-copy-content{
  padding-right:15px;
  padding-left:5px;
  margin-top: 20px;
  margin-bottom:20px;
}

.poster {
  overflow: hidden;
  margin: 12px 0;
  border-radius: 12px;
  background: #f4f7fb;
}

.poster img {
  width: 100%;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 7px;
  color: #1764c0;
  background: #edf5ff;
  font-size: 12px;
  font-weight: 700;
}

.taxonomy-filter-tag {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700
}

.taxonomy-filter-tag:hover {
  background: #d9eaff;
}

.feed-info-panel > h3 {
  margin: 18px 0 8px;
}

.feed-info-panel > p {
  margin: 0;
  color: #5d7490;
  line-height: 1.5;
  font-size: 13px;
  font-style: italic
}

.feed-filter-summary {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e5edf7;
}

.feed-filter-label {
  margin-bottom: 8px;
  color: #31557c;
  font-size: 12px;
  font-weight: 800;
}

.filter-chip .chip-close {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.feed-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid #edf0f5;
}

.api-post.pinned-post:not(.full-post) {
  display: flex;
  height: 100%;
  flex-direction: column;
}

.api-post.pinned-post:not(.full-post) .feed-actions {
  margin-top: auto;
}

.feed-actions-left {
  display: flex;
  gap: 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.btn-primary {
  color: white;
  background: var(--blue);
  box-shadow: 0 5px 13px rgba(8, 119, 249, 0.2);
  font-size: 13px;
}

.btn-primary:hover {
  background: var(--blue-700);
}

.btn-ghost {
  border-color: var(--line);
  color: #5d697b;
  background: white;
}

.btn-danger {
  color: white;
  background: var(--red);
}

.group-list-item {
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease,
    transform 0.15s ease;
  padding: 4px;
}

.group-list-item:hover {
  border-color: #c8dcf3;
  background: #f4f9ff;
  padding: 4px;
}

.group-list-item.active {
  border-color: #6fa5e1;
  background: #eaf4ff;
  padding: 8px;
}

.group-more-btn {
  display: block;
  width: 100%;
  margin-top: 9px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: #1769d2;
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  text-align: left;
}

.group-more-btn:hover {
  text-decoration: underline;
}

.group-name-composer {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid #cfd9e7;
  border-radius: 8px;
  background: #fff;
}

.group-name-composer:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(8, 119, 249, 0.09);
}

.group-name-composer > span {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 11px;
  border-right: 1px solid #dce4ed;
  color: #315d89;
  background: #f2f7fd;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.group-name-composer .input {
  border: 0;
  box-shadow: none;
}

.field-help {
  display: block;
  margin-top: 7px;
  color: #71849a;
  line-height: 1.5;
}

.form-error {
  margin-bottom: 15px;
  padding: 11px 13px;
  border: 1px solid #f0b9bf;
  border-radius: 9px;
  color: #a72837;
  background: #fff3f4;
  font-size: 14px;
  font-weight: 700;
}

.preview-post-card {
  margin: 0;
  box-shadow: none;
}

.preview-groups {
  margin-top: 12px;
  color: #667b91;
  font-size: 14px;
}

.pending-join-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 12px 0 16px;
  padding: 14px 16px;
  border: 1px solid #cfe0f3;
  border-radius: 11px;
  background: #f6faff;
}

.pending-join-card > div:first-child {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 9px;
}

.pending-join-card strong {
  align-self: center;
}

.pending-join-card p {
  grid-column: 2;
  margin: 3px 0 0;
  color: #6b7f94;
  font-size: 14px;
}

.pending-join-icon {
  grid-row: 1 / 3;
  color: var(--blue);
  font-size: 26px;
}

.pending-group-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.pending-group-actions b {
  display: inline-grid;
  min-width: 19px;
  min-height: 19px;
  margin-left: 5px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--blue);
  font-size: 12px;
}

.community-search-section {
  margin: 16px 0 22px;
}

.search-section-title {
  margin: 17px 0 10px;
  color: #26384c;
  font-size: 18px;
}

.group-search-results {
  display: grid;
  gap: 10px;
}

.group-search-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dbe5ef;
  border-radius: 11px;
  background: white;
}

.group-search-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 10px;
  color: white;
  background: linear-gradient(135deg, #157adb, #56a5ee);
  font-weight: 900;
}

.group-search-copy {
  min-width: 0;
}

.group-search-copy p {
  overflow: hidden;
  margin: 4px 0 0;
  color: #718196;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-result-status {
  color: #66788a;
  font-size: 14px;
  font-weight: 700;
}

.group-result-status.owner,
.group-result-status.approved {
  color: #13845a;
}

.join-request-list {
  display: grid;
  gap: 9px;
}

.join-request-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid #e0e7ef;
  border-radius: 10px;
}

.join-request-item p {
  margin: 3px 0;
  color: #6d7e90;
  font-size: 14px;
}

.join-request-item small {
  color: #98a4b1;
}

.join-review-actions {
  display: flex;
  gap: 6px;
}

.comment-actions button.active {
  color: #e02d56;
  font-weight: 800;
}

.comment-actions .featured-comment-toggle {
  color: #55708f;
  transition: color 0.15s ease, background 0.15s ease;
}

.comment-actions .featured-comment-toggle:hover,
.comment-actions .featured-comment-toggle.active {
  color: #0f7a5f;
  font-weight: 800;
}

.comment-actions .featured-comment-toggle.active:hover {
  color: #55708f;
}

.btn-sm {
  min-height: 30px;
  padding: 5px 11px;
  font-size: 12px;
}

.form-card {
  padding: 0 0 22px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.page-heading {
  margin: 0 0 16px;
  font-size: 20px;
}

.field {
  margin-bottom: 16px;
}

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

.taxonomy-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.taxonomy-field-header label {
  margin-bottom: 0;
}

.field label,
.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
}

.input,
.select,
.textarea,
.token-input {
  width: 100%;
  border: 1px solid #cfd9e7;
  border-radius: 8px;
  outline: none;
  background: white;
}

.input,
.select {
  height: 40px;
  padding: 0 15px;
  font-size: 13px
}

.input:focus,
.select:focus,
.textarea:focus,
.token-input:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(8, 119, 249, 0.09);
}

.rich-editor {
  overflow: visible;
  min-height: 290px;
  border: 1px solid #cfd9e7;
  border-radius: 10px;
  background: white;
}

.editor-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 43px;
  padding: 6px 9px;
  border-bottom: 1px solid var(--line);
}

.tool-btn {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  color: #4d5b70;
  background: transparent;
  font-size: 14px;
}

.tool-btn:hover,
.tool-btn.active {
  color: var(--blue);
  background: var(--blue-100);
}

.editor-color-tool {
  position: relative;
  cursor: pointer;
  font-weight: 700;
  align-content: center;
}

.editor-color-tool span {
  border-bottom: 3px solid currentColor;
}

.editor-color-tool input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.editor-emoji-tool,
.emoji-field {
  position: relative;
}

.editor-emoji-tool .emoji-picker {
  top: 36px;
  right: 0;
  bottom: auto;
  left: auto;
}

.emoji-field .emoji-picker {
  right: 8px;
  bottom: 44px;
  left: auto;
}

.emoji-field-trigger {
  position: absolute;
  right: 10px;
  bottom: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}

.editor-area {
  min-height: 240px;
  padding: 13px;
  outline: none;
  color: #536174;
  cursor: text;
}

.editor-area.editor-fallback {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.rich-editor .ck-editor {
  border: 0;
  box-shadow: none;
}

.rich-editor .ck-editor__editable_inline {
  min-height: 240px;
  border: 0;
  padding: 13px;
  color: #536174;
}

.editor-extra-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 4px 9px;
  border-top: 1px solid var(--line);
}

.editor-extra-tools .tool-btn {
  width: auto;
  padding: 0 8px;
}

.editor-color-palette {
  display: grid;
  grid-template-columns: repeat(9, 14px);
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.editor-color-swatch {
  width: 14px;
  height: 14px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 2px;
  cursor: pointer;
}

.editor-color-swatch:hover {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.editor-color-swatch.active {
  outline: 2px solid var(--blue-700);
  outline-offset: 1px;
}

.editor-area:empty::before {
  color: #9aa6b7;
  content: attr(data-placeholder);
}

.token-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 6px 8px;
}

.token-input input {
  flex: 1;
  min-width: 110px;
  border: 0;
  outline: 0;
}

.suggestions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  color: #8390a2;
  font-size: 12px;
}

.suggestion {
  border: 0;
  border-radius: 6px;
  color: #1764c0;
  background: #edf5ff;
  font-size: 12px;
  font-weight: 700;
}

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

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #5e6b7d;
  font-size: 13px;
}

.check input {
  accent-color: var(--blue);
}

.upload-box {
  display: flex;
  align-items: center;
  align-content: center;
  justify-content: center;
  min-height: 108px;
  border: 1px dashed #aebed2;
  border-radius: 10px;
  color: #7b899c;
  background: #fbfdff;
  text-align: center;
  cursor: pointer;
}

.upload-box:hover {
  border-color: var(--blue);
  background: #f4f9ff;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.permissions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}

.permissions-card {
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 15px 18px;
  border-bottom: 1px solid #edf1f6;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #6f7c90;
  background: #fafbfd;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.role-link {
  color: var(--blue);
}

.table-actions {
  display: flex;
  gap: 14px;
}

.link-btn {
  border: 0;
  color: #718096;
  background: transparent;
  font-size: 12px;
}

.link-btn.danger {
  color: var(--red);
}

.pagination {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}

.page-btn {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: #657286;
  background: transparent;
}

.page-btn.active {
  color: white;
  background: var(--blue);
}

.feed-grid,
.community-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 50px;
}

.community-grid{
  margin-top: 30px
}

.search-bar {
  position: relative;
  margin-bottom: 12px;
}

.search-bar .input {
  padding-left: 41px;
}

.search-icon {
  position: absolute;
  top: 12px;
  left: 14px;
  color: #6b788b;
}

.search-suggestions {
  position: absolute;
  z-index: 35;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: 0 14px 34px rgba(26, 48, 78, 0.16);
}

.search-suggestions[hidden] {
  display: none;
}

.search-suggestions button {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid #edf1f6;
  background: white;
  text-align: left;
}

.search-suggestions button:hover {
  color: var(--blue);
  background: var(--blue-50);
}

.search-suggestion-empty {
  padding: 13px 14px;
  color: var(--muted);
}

.filter-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr 1fr 1.15fr;
  gap: 9px;
}

.filter-label {
  margin-bottom: 4px;
  color: #7d8999;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.filter-grid .select {
  height: 38px;
  font-size: 13px;
}

.active-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 13px;
  color: #778496;
  font-size: 12px;
}

.question-list {
  display: grid;
  gap: 12px;
}

.question-card {
  padding: 14px 16px;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.question-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.question-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 182px;
  gap: 16px;
  margin-top: 10px;
}

.question-body.no-image {
  grid-template-columns: 1fr;
}

.question-title {
  margin: 3px 0 8px;
  color: #0753b9;
  font-size: 17px;
  line-height: 1.42;
}

.question-excerpt {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 12px;
  color: #657286;
  font-size: 13px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.question-thumb {
  width: 182px;
  height: 108px;
  object-fit: cover;
  border-radius: 9px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-50);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-badge.pending {
  color: var(--red);
  background: #fff0f2;
}

.right-rail {
  max-height: 870px;
  position: sticky;
  top: 30px;
  display: grid;
  align-content: start;
  gap: 15px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.panel {
  padding: 15px;
  margin-bottom:10px;
}

@media (min-width: 1081px) {
  .group-panel {
    display: flex;
    flex-direction: column;
    height: 320px;
    max-height: 320px;
    overflow: hidden;
  }

  .group-panel-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
  }

  .group-panel-list .joined-groups-list {
    max-height: none;
    overflow: visible;
  }

  .group-create-button {
    flex: 0 0 auto;
  }
}

.feed-info-panel{
  margin-top: 56px;
}

.panel-title {
  margin: 0 0 13px;
  font-size: 15px;
}

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

.joined-groups-list {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.trending-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 7px;
  font-size: 13px;
}

.trending-item.no-index {
  grid-template-columns: 1fr;
}

.group-category {
  margin-top: 16px;
}

.group-category:first-of-type {
  margin-top: 0;
}

.group-category h4 {
  margin: 0 0 9px;
  color: #42536a;
  font-size: 14px;
}

.trend-no {
  color: #ff5f00;
  font-size: 18px;
  font-weight: 800;
}

.trend-title {
  font-weight: 600;
  line-height: 1.4;
}

.trend-meta {
  color: #9aa5b4;
  font-size: 12px;
}

.rule-list {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #627085;
  font-size: 12px;
}

.rule-list li {
  display: flex;
  gap: 7px;
}

.rule-check {
  color: var(--blue);
  font-weight: 800;
}

.chat-panel {
  padding-bottom: 10px;
}

.chat-log {
  display: grid;
  gap: 8px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.chat-message {
  max-width: 88%;
  padding: 8px 10px;
  border-radius: 10px 10px 10px 3px;
  color: #687588;
  background: #f7f9fc;
  font-size: 12px;
}

.chat-message.mine {
  justify-self: end;
  border-radius: 10px 10px 3px;
  color: white;
  background: var(--blue);
}

.chat-author {
  margin-bottom: 2px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.chat-message.mine .chat-author {
  color: #d9ebff;
  text-align: right;
}

.chat-input-row {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}

.chat-typing {
  min-height: 18px;
  padding: 0 4px 5px;
  color: #7b879a;
  font-size: 13px;
  font-style: italic;
}

.chat-input-row .input {
  height: 34px;
  font-size: 12px;
}

.send-btn {
  width: 10%;
  height: 30px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--blue);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 278px;
  gap: 16px;
}

.breadcrumb {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--blue);
  font-size: 12px;
}

.detail-question {
  margin-bottom: 13px;
  padding: 17px;
}

.detail-question .question-body {
  grid-template-columns: minmax(0, 1fr) 210px;
}

.answer-card {
  margin-bottom: 13px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.answer-card.accepted {
  border-color: #20bd69;
  background: #f0fff7;
}

.answer-copy {
  margin: 12px 0;
  color: #3e4a5c;
  font-size: 13px;
  white-space: pre-line;
}

.accepted-label {
  color: white;
  background: var(--green);
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
  animation: fade-in 0.18s ease;
}

.post-modal {
  position: relative;
  width: min(740px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border-radius: 20px;
  background: white;
  box-shadow: 0 28px 80px rgba(13, 28, 50, 0.25);
  animation: rise 0.22s ease;
}

.post-modal .api-post {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.modal-close {
  position: sticky;
  z-index: 3;
  top: 12px;
  float: right;
  width: 34px;
  height: 34px;
  margin: 12px 12px -46px 0;
  border: 0;
  border-radius: 50%;
  color: #607086;
  background: rgba(246, 249, 253, 0.96);
}

.modal-body {
  padding: 20px 20px 0;
}

.article-text {
  color: #536174;
  font-size: 14px;
  white-space: pre-line;
}

.modal-comment {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: white;
}

.comment-input {
  width: 100%;
  min-height: 32px;
  max-height: 160px;
  padding: 0;
  resize: none;
  overflow-y: auto;
  border: 0;
  outline: 0;
  color: inherit;
  background: transparent;
  line-height: 1.2;
}

.message-composer {
  flex: 1;
  min-width: 0;
  padding: 11px 13px 7px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f2f3f5;
}

.composer-image-preview {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface, white);
}

.composer-image-preview[hidden] {
  display: none;
}

.composer-preview-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 56px;
  overflow: hidden;
  border-radius: 8px;
  background: #e7edf5;
}

.composer-preview-frame img {
  width: auto;
  max-width: none;
  height: 100%;
}

.composer-image-preview span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-image-preview button {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: #e3e8ef;
  cursor: pointer;
  font-size: 18px;
}

.inline-reply-form .message-composer {
  min-width: 0;
}

:root[data-theme="dark"] .message-composer {
  background: #353638;
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 28px;
  margin-top: 5px;
  color: var(--muted);
}

.composer-tools button,
.composer-tools label {
  padding: 2px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 15px;
}

.composer-tools .composer-send {
  margin-left: auto;
  font-size: 20px;
}

.emoji-picker {
  position: absolute;
  z-index: 1200;
  bottom: 48px;
  left: 10px;
  display: grid;
  width: min(310px, calc(100vw - 64px));
  max-width: calc(100vw - 24px);
  max-height: min(260px, calc(100vh - 80px));
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(18, 31, 51, 0.2);
}

.formula-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.formula-mathfield {
  display: block;
  width: 100%;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font-size: 18px;
  --selection-background-color: transparent;
  --selection-color: inherit;
  --contains-highlight-background-color: transparent;
}

.formula-chip {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
}

.formula-chip:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-50);
}

.emoji-picker[hidden] {
  display: none;
}

.emoji-picker button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 21px;
}

.emoji-picker button:hover {
  background: var(--blue-100);
}

@media (max-width: 640px) {
  .emoji-picker,
  .editor-emoji-tool .emoji-picker,
  .emoji-field .emoji-picker {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
}

.message-composer {
  position: relative;
}

.comment-time {
  color: var(--muted);
  font-size: 11px;
}

.media-image-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  height: auto;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #eef3f8;
}

.media-image-frame img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.comment-image-frame {
  max-width: min(280px, 100%);
  max-height: 180px;
  margin: 7px 0;
  border-radius: 12px;
}

.comment-image-frame img {
  max-height: 180px;
}

.chat-image-frame {
  max-width: min(190px, 100%);
  max-height: 124px;
  margin-top: 6px;
  border-radius: 9px;
}

.chat-image-frame img {
  max-height: 124px;
}

.comment-list p {
  font-size: 13px;
  margin-bottom: 5px;
  white-space: pre-wrap;

}


.poll-box {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafcff;
}

.poll-option {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0;
  padding: 10px 12px;
  border: 1px solid #dce5f1;
  border-radius: 8px;
  background: white;
  font-size: 13px;
}

.poll-option::before {
  position: absolute;
  z-index: 0;
  inset: 0 auto 0 0;
  width: var(--poll-width, 0);
  background: #eaf3ff;
  content: "";
}

.poll-option > * {
  position: relative;
  z-index: 1;
}

.poll-option.selected {
  border-color: var(--blue);
  color: #075fc8;
}

.empty-state {
  padding: 50px 20px;
  color: var(--muted);
  text-align: center;
}

.mobile-menu {
  display: none;
}

#toast-root {
  position: fixed;
  z-index: 200;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
}

.toast {
  min-width: 230px;
  padding: 11px 14px;
  border-radius: 10px;
  color: white;
  background: #17233b;
  box-shadow: var(--shadow);
  animation: rise 0.2s ease;
  font-size: 14px;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
}

@media (max-width: 1080px) {
  .feed-grid,
  .community-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .right-rail {
    position: static;
    grid-template-columns: repeat(2, 1fr);
    max-height: none;
    overflow: visible;
  }

  .chat-panel {
    grid-column: 1 / -1;
  }

  .filter-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 60;
    top: 64px;
    left: 0;
    width: 260px;
    transform: translateX(-105%);
    box-shadow: 15px 0 40px rgba(18, 41, 72, 0.14);
    transition: transform 0.22s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-menu {
    display: grid;
  }

  .topbar {
    padding: 0 16px;
  }

  .top-links {
    gap: 8px;
  }

  .top-link {
    display: none;
  }

  .main {
    padding: 16px 14px 42px;
  }

  .hot-grid {
    grid-template-columns: repeat(3, 300px);
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .brand span {
    display: none;
  }

  .section-tabs {
    overflow-x: auto;
  }

  .section-tab {
    flex: 0 0 auto;
  }

  .hot-grid {
    grid-template-columns: repeat(3, 270px);
  }

  .field-grid,
  .checkboxes,
  .right-rail {
    grid-template-columns: 1fr;
  }

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

  .question-body,
  .detail-question .question-body {
    grid-template-columns: 1fr;
  }

  .question-thumb {
    width: 100%;
    height: auto;
  }

  .permissions-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .modal-backdrop {
    padding: 0;
  }

  .post-modal {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
}

/* New phase: group switching, reactions, menus and threaded comments */
.reload-btn {
  margin-left: auto;
  border: none;
  background: #fff;
  color: #31557c;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px
}

.rail-tools {
  display: flex;
  justify-content: stretch;
}

.rail-tools .reload-btn {
  width: 100%;
  margin-left: 0;
}

.load-more {
  display: block;
  margin: 18px auto;
}

.latest-section {
  position: relative;
  min-height: 80px;
}

.latest-section.is-filter-loading .latest-list {
  min-height: 180px;
  opacity: 0.35;
  pointer-events: none;
}

.section-filter-loader {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 180px;
  color: #1764c0;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 700;
}

.read-more {
  margin-top: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1769d2;
  cursor: pointer;
  font-weight: 500;
  margin-bottom: 20px;
  font-size: 13px;
}

.reaction-wrap,
.post-menu-wrap {
  position: relative;
  display: inline-flex;
}

.reaction-picker {
  position: absolute;
  z-index: 20;
  top: 50%;
  left: calc(100% + 8px);
  display: flex;
  gap: 4px;
  padding: 7px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(32, 54, 86, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%) translateX(-5px);
  transition: 0.15s ease;
}

.reaction-wrap:hover .reaction-picker,
.reaction-picker:focus-within {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

.reaction-picker button {
  border: 0;
  border-radius: 50%;
  background: transparent;
  padding: 5px;
  font-size: 23px;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.reaction-picker button:hover {
  transform: scale(1.25);
}

.reaction-counts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.reaction-summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 18px;
  line-height: 1;
}

.reaction-unselected {
  font-size: 23px;
  line-height: 1;
}

.reaction-total {
  font-size: 13px;
}

.reaction-count-item {
  white-space: nowrap;
  font-size: 13px;
}

.post-menu {
  position: absolute;
  z-index: 15;
  top: calc(100% + 6px);
  right: 0;
  min-width: 170px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(32, 54, 86, 0.16);
}

.post-menu button {
  display: block;
  width: 100%;
  padding: 10px 13px;
  border: 0;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.post-menu button:hover {
  background: #f5f8fc;
}

.poll-option-inputs {
  display: grid;
  gap: 9px;
  margin-top: 8px;
}

.add-poll-option {
  margin-top: 10px;
}

.poll-settings {
  display: grid;
  gap: 8px;
  margin-top: 13px;
}

.comments-section {
  padding:16px;
}

.comments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.comments-head h3 {
  margin: 0;
  font-size: 15px;
}

.comment-sort {
  width: auto;
}

.comment-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.comment-enter {
  animation: comment-enter 0.22s ease-out;
}

.comment-posted {
  animation: comment-posted 1.2s ease-out;
}

@keyframes comment-enter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

@keyframes comment-posted {
  0% {
    background: #e9fff6;
    box-shadow: 0 0 0 1px #9be7ca;
  }
  100% {
    background: transparent;
    box-shadow: 0 0 0 0 transparent;
  }
}

.comment-head {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.comment-head > div {
  min-width: 0;
  flex: 1;
}

.comment-meta-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.comment-text {
  display: block;
  margin: 5px 0;
}

.comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.comment-actions button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #55708f;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.comment-replies {
  display: grid;
  gap: 12px;
  margin-top: 10px;
  margin-left: 32px;
  padding-left: 12px;
  border-left: 2px solid #e5ebf3;
}

.comment-replies:empty {
  display: none;
}

.comment-item.depth-2 {
  margin-left: 20px;
}

.inline-loader {
  display: inline-block;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: inline-spin 0.7s linear infinite;
}

@keyframes inline-spin {
  to {
    transform: rotate(360deg);
  }
}

.chip .inline-loader,
.reload-btn .inline-loader,
.btn .inline-loader {
  margin-right: 5px;
}

.reload-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.post-stream {
  position: relative;
  min-height: 180px;
}

.post-stream.is-loading > :not(.stream-loading) {
  opacity: 0.38;
  pointer-events: none;
}

.stream-loading {
  position: absolute;
  z-index: 25;
  top: 88px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border: 1px solid #dfe8f3;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #24486e;
  box-shadow: 0 12px 30px rgba(33, 57, 88, 0.16);
  font-weight: 700;
  transform: translateX(-50%);
}

.draft-status {
  margin-bottom: 14px;
  padding: 9px 12px;
  border: 1px solid #dbe9fa;
  border-radius: 9px;
  background: #f3f8ff;
  color: #41678f;
  font-size: 14px;
}

.pin-group-options {
  min-height: 38px;
}

.inline-reply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  width: 100%;
  max-width: none;
}

.inline-reply-form .input {
  min-height: 38px;
  padding: 8px 11px;
  border-radius: 9px;
}

.inline-reply-form .send-btn {
  width: 36px;
  height: 36px;
}

.inline-cancel {
  border: 0;
  background: transparent;
  color: #60758e;
  cursor: pointer;
  font-weight: 700;
}

.ask-inline-btn {
  margin: 12px 0 16px;
}

.permission-taxonomies {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 250px;
}

.permission-taxonomies .tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.permission-role {
  min-width: 150px;
}

.add-taxonomy-btn {
  padding: 7px 10px;
  border: 1px dashed #7ca5d4;
  border-radius: 999px;
  background: #f5f9ff;
  color: #1769d2;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.ui-dialog-backdrop {
  z-index: 1100;
}

.ui-dialog {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(17, 36, 62, 0.28);
}

.dialog-form {
  display: flex;
  max-height: calc(100vh - 40px);
  flex-direction: column;
}

.compact-dialog {
  width: min(520px, calc(100vw - 32px));
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 17px;
  border-bottom: 1px solid #e8eef5;
}

.dialog-header h2 {
  margin: 4px 0 0;
  color: #183b61;
  font-size: 20px;
}

.dialog-header p {
  margin: 5px 0 0;
  color: #6c7e91;
  font-size: 13px;
}

.dialog-header .modal-close {
  position: static;
  flex: 0 0 34px;
  float: none;
  margin: 0;
  cursor: pointer;
}

.dialog-eyebrow {
  color: #3276c8;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.dialog-scroll {
  overflow-y: auto;
  padding: 20px 24px;
}

.dialog-scroll textarea.input {
  height: auto;
  min-height: 92px;
  padding-top: 10px;
  resize: vertical;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 24px;
  border-top: 1px solid #e8eef5;
  background: #fbfcfe;
}

.post-editor-form .editor-area,
.question-dialog-form .editor-area {
  min-height: 150px;
}

.edit-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 9px;
}

.edit-image-frame {
  width: 100%;
  height: 92px;
  border-radius: 9px;
}

.taxonomy-picker-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.create-group-taxonomies {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.create-group-taxonomies .taxonomy-picker-item {
  min-width: 0;
}

.chat-panel-empty {
  min-height: 150px;
}

.chat-panel {
  max-height: 620px;
}

.chat-log {
  align-content: start;
  align-items: start;
  grid-auto-rows: max-content;
  height: 250px;
  max-height: 250px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.chat-input-row .message-composer {
  width: 100%;
}

.chat-input-row textarea {
  width: 100%;
  max-height: 120px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
}

.group-description {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-settings-btn {
  float: right;
  margin-top: 14px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.chat-empty-message {
  display: grid;
  min-height: 90px;
  place-items: center;
  padding: 14px;
  border: 1px dashed #cad7e7;
  border-radius: 10px;
  color: var(--muted);
  background: #f8fbff;
  text-align: center;
}

.taxonomy-picker-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid #e1e8f0;
  border-radius: 10px;
  cursor: pointer;
}

.taxonomy-picker-item:hover {
  border-color: #86acd7;
  background: #f6faff;
}

.taxonomy-tree {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 6px;
  align-items: start;
}

.taxonomy-tree-node {
  display: grid;
  gap: 5px;
  margin-left: calc(var(--taxonomy-depth, 0) * 18px);
}

.taxonomy-tree-node .taxonomy-tree-node {
  margin-left: 18px;
}

.taxonomy-tree-node.is-collapsed > .taxonomy-tree-children {
  display: none;
}

.taxonomy-tree-children {
  display: grid;
  gap: 5px;
}

.taxonomy-tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.taxonomy-tree-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}

.taxonomy-toggle {
  display: inline-grid;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  padding: 0;
  place-items: center;
  border: none;
  color: #4f6d8e;
  background: none;
  cursor: pointer;
  line-height: 1;
  font-size: 14px;
}

.taxonomy-toggle:hover {
  border-color: #7ea5d0;
  background: #f2f7fd;
}

.taxonomy-picker-item small {
  color: #73869a;
}

@media (max-width: 760px) {
  .taxonomy-tree {
    grid-template-columns: 1fr;
  }
}

.btn-danger {
  border: 1px solid #dc4857;
  background: #dc4857;
  color: #fff;
}

@media (max-width: 720px) {
  .ui-dialog {
    width: 100vw;
    max-height: 100dvh;
    border-radius: 16px 16px 0 0;
  }

  .ui-dialog-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .dialog-form {
    max-height: 94dvh;
  }

  .dialog-header,
  .dialog-scroll,
  .dialog-footer {
    padding-right: 16px;
    padding-left: 16px;
  }

  .dialog-footer .btn {
    flex: 1;
  }

  .create-group-taxonomies {
    grid-template-columns: 1fr;
  }

  .inline-reply-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .inline-cancel {
    grid-column: auto;
    justify-self: center;
  }
}

.post-image-frame {
  width: 100%;
  max-width: 100%;
  max-height: 520px;
  margin-top: 14px;
  border-radius: 12px;
}

.post-image-frame img {
  max-width: 100%;
  max-height: 520px;
}

.api-poll {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #dce8fa;
  border-radius: 12px;
  background: #f8fbff;
}

.poll-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.poll-status {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.poll-status.open {
  color: #08714e;
  background: #dff7ec;
}

.poll-status.closed {
  color: #6c7480;
  background: #e9edf2;
}

.poll-closes-at {
  color: #6d7f93;
  font-size: 13px;
}

.poll-close-btn {
  justify-self: end;
  padding: 6px 0;
  border: 0;
  color: #b3283d;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.poll-close-btn:hover {
  text-decoration: underline;
}

.poll-option:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.poll-option:disabled:hover {
  border-color: #d3e1f5;
  background: #fff;
}

.poll-close-field {
  margin-top: 12px;
}

.poll-option {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d3e1f5;
  border-radius: 9px;
  color: #26364c;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.poll-option:hover,
.poll-option.selected {
  border-color: #0878f9;
  background: #edf5ff;
}

.poll-option b {
  white-space: nowrap;
  color: #0878f9;
}

.taxonomy-checks,
.group-checks {
  padding: 12px;
  border: 1px solid #d5dfed;
  border-radius: 8px;
}

[hidden] {
  display: none !important;
}

.login-page {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(440px, 1.08fr) minmax(440px, 0.92fr);
  background: #fff;
}

.login-loading-page {
  grid-template-columns: 1fr;
  background: #f7faff;
}

.login-visual {
  position: relative;
  display: flex;
  min-height: 100vh;
  align-items: center;
  overflow: hidden;
  padding: clamp(52px, 7vw, 112px);
  color: #fff;
  background:
    radial-gradient(circle at 12% 15%, rgba(69, 179, 255, 0.52), transparent 30%),
    linear-gradient(145deg, #075fcf 0%, #087bf8 48%, #16a7ee 100%);
}

.login-visual::after {
  position: absolute;
  right: -100px;
  bottom: -120px;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  content: "";
}

.login-visual-content {
  position: relative;
  z-index: 2;
  max-width: 620px;
}

.login-visual-content > img {
  width: 64px;
  height: 64px;
  margin-bottom: 34px;
  padding: 8px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(0, 42, 112, 0.22);
}

.login-eyebrow {
  display: block;
  margin-bottom: 12px;
  color: #0877f9;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.login-visual .login-eyebrow {
  color: rgba(255, 255, 255, 0.8);
}

.login-visual h1 {
  max-width: 590px;
  margin: 0 0 22px;
  font-size: clamp(40px, calc(4.2vw + 2px), 66px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.login-visual-content > p {
  max-width: 550px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 19px;
}

.login-features {
  display: grid;
  gap: 12px;
  margin-top: 38px;
  color: rgba(255, 255, 255, 0.94);
  font-weight: 600;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.11);
  filter: blur(1px);
}

.orb-one {
  top: 9%;
  right: 8%;
  width: 180px;
  height: 180px;
}

.orb-two {
  right: 25%;
  bottom: 8%;
  width: 90px;
  height: 90px;
}

.login-form-side {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 42px;
  background:
    linear-gradient(rgba(247, 250, 255, 0.82), rgba(255, 255, 255, 0.96)),
    radial-gradient(circle at 100% 0, #dcecff, transparent 44%);
}

.login-card {
  width: min(100%, 470px);
}

.login-card h2,
.login-loading-card h1 {
  margin: 0 0 10px;
  color: #14233c;
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.login-subtitle,
.login-loading-card p {
  margin: 0 0 30px;
  color: #718096;
}

.login-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 34px;
  color: #0877f9;
  font-size: 20px;
}

.login-mobile-brand img,
.login-logo {
  width: 45px;
  height: 45px;
}

.sso-login-btn {
  display: grid;
  width: 100%;
  min-height: 72px;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 13px 16px;
  border: 1px solid #cfe2fb;
  border-radius: 13px;
  color: #173356;
  background: #fff;
  box-shadow: 0 7px 20px rgba(22, 74, 141, 0.07);
  text-align: left;
  transition:
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.sso-login-btn:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: #0877f9;
  box-shadow: 0 12px 28px rgba(8, 119, 249, 0.13);
}

.sso-login-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.sso-login-btn span:nth-child(2) {
  display: grid;
}

.sso-login-btn small {
  margin-top: 2px;
  color: #7d8aa0;
  font-size: 14px;
}

.sso-login-btn > b {
  color: #0877f9;
  font-size: 22px;
}

.sso-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #0877f9, #15a7e9);
  font-size: 22px;
  font-weight: 900;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 25px 0;
  color: #8995a8;
  font-size: 14px;
  text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
  height: 1px;
  flex: 1;
  background: #dde5ef;
  content: "";
}

.test-login-form {
  display: grid;
  gap: 10px;
}

.test-login-form label {
  color: #3d4b61;
  font-size: 15px;
  font-weight: 700;
}

.login-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
}

.login-hint,
.test-login-note,
.login-footer {
  color: #8a96a8;
  font-size: 14px;
}

.login-hint {
  margin: 8px 0 0;
}

.test-login-note {
  margin: 12px 0 0;
}

.login-footer {
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid #e3eaf2;
  text-align: center;
}

.login-alert {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #ffcbd0;
  border-radius: 10px;
  color: #a52835;
  background: #fff4f5;
  font-size: 15px;
}

.login-alert button {
  margin-left: 8px;
  border: 0;
  color: #0877f9;
  background: transparent;
  font-weight: 700;
}

.login-alert code {
  font-size: 13px;
}

.login-loading-card {
  display: grid;
  width: 100%;
  min-height: 100vh;
  place-items: center;
  justify-items: center;
  align-content: center;
  text-align: center;
}

.login-loading-card .login-logo {
  margin-bottom: 24px;
}

.login-spinner {
  width: 34px;
  height: 34px;
  margin-bottom: 22px;
  border: 3px solid #dceafe;
  border-top-color: #0877f9;
  border-radius: 50%;
  animation: login-spin 0.8s linear infinite;
}

@keyframes login-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }

  .login-form-side {
    padding: 28px;
  }

  .login-mobile-brand {
    display: flex;
  }
}

@media (max-width: 520px) {
  .login-form-side {
    align-items: start;
    padding: 24px 18px;
  }

  .login-card {
    margin-top: 20px;
  }

  .login-card h2 {
    font-size: 29px;
  }
}

/* Mobile refinement: layout-only overrides. Desktop rules remain unchanged. */
@media (max-width: 860px) {
  html,
  body {
    overflow-x: hidden;
  }

  .topbar {
    height: 56px;
    padding: 0 12px;
  }

  .brand {
    gap: 7px;
    font-size: 16px;
  }

  .brand img {
    width: 32px;
    height: 32px;
  }

  .sidebar {
    top: 56px;
    height: calc(100vh - 56px);
    padding: 14px 12px 16px;
  }

  .main {
    padding: 14px 12px 32px;
  }

  .right-rail {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .panel {
    margin-top: 0;
    margin-bottom: 0;
  }
}

@media (max-width: 640px) {
  .top-actions,
  .top-links {
    gap: 4px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .notification-popover {
    position: fixed;
    top: 62px;
    right: 10px;
    left: 10px;
    width: auto;
  }

  .notification-popover::before {
    right: 24px;
  }

  .main {
    padding: 10px 10px 28px;
  }

  .section-tabs {
    gap: 2px;
    margin: 0 -10px 14px;
    padding: 0 10px;
    scrollbar-width: none;
  }

  .section-tabs::-webkit-scrollbar {
    display: none;
  }

  .section-tab {
    min-height: 44px;
    padding: 10px 12px 12px;
    white-space: nowrap;
  }

  .section-title {
    margin: 14px 0 10px;
    font-size: 17px;
  }

  .hot-grid {
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 84vw);
    grid-template-columns: none;
    gap: 10px;
    margin-right: -10px;
    padding-right: 10px;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }

  .post-card,
  .question-card,
  .form-card {
    border-radius: 12px;
  }

  .post-card {
    padding: 12px;
  }

  .post-meta,
  .question-author {
    gap: 8px;
  }

  .author-block {
    min-width: 0;
    gap: 8px;
  }

  .author-name {
    max-width: 58vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .meta-line {
    max-width: 62vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .post-copy h3 {
    margin-top: 12px;
    font-size: 15px;
    line-height: 1.4;
  }

  .post-copy-content {
    padding: 0;
    margin-top: 14px;
    margin-bottom: 14px;
  }

  .post-image-frame {
    height: auto;
    max-height: 420px;
  }

  .post-image-frame img {
    max-height: 420px;
  }

  .feed-actions {
    align-items: flex-start;
    gap: 10px;
  }

  .feed-actions-left {
    min-width: 0;
    gap: 12px;
  }

  .feed-actions .card-action {
    min-height: 34px;
    padding: 4px 0;
    white-space: nowrap;
  }

  .reaction-picker {
    top: auto;
    right: auto;
    bottom: calc(100% + 7px);
    left: 0;
    transform: translateY(5px);
  }

  .reaction-wrap:hover .reaction-picker,
  .reaction-picker:focus-within {
    transform: translateY(0);
  }

  .reaction-picker button {
    padding: 4px;
    font-size: 21px;
  }

  .tags {
    gap: 5px;
  }

  .tag {
    padding: 4px 7px;
    font-size: 11px;
  }

  .form-card {
    padding-bottom: 14px;
  }

  .page-heading {
    font-size: 19px;
  }

  .field {
    margin-bottom: 13px;
  }

  .field-grid,
  .checkboxes,
  .right-rail,
  .taxonomy-tree {
    grid-template-columns: 1fr;
  }

  .rich-editor {
    min-height: 230px;
  }

  .editor-tools {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .editor-tools::-webkit-scrollbar {
    display: none;
  }

  .editor-area {
    min-height: 180px;
  }

  .form-footer {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    gap: 8px;
    margin: 0 -10px;
    padding: 10px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
  }

  .form-footer .btn {
    flex: 1;
  }

  .taxonomy-checks,
  .group-checks {
    padding: 10px;
  }

  .taxonomy-tree {
    column-gap: 0;
  }

  .taxonomy-tree-label {
    min-height: 34px;
  }

  .taxonomy-toggle {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }

  .comments-section {
    padding: 12px;
  }

  .comments-head {
    align-items: flex-start;
  }

  .comment-list {
    gap: 12px;
  }

  .comment-actions {
    gap: 12px;
  }

  .comment-actions button {
    min-height: 30px;
  }

  .comment-replies {
    margin-left: 16px;
    padding-left: 9px;
  }

  .comment-item.depth-2 {
    margin-left: 8px;
  }

  .modal-body {
    padding: 12px 12px 0;
  }

  .modal-comment {
    gap: 7px;
    padding: 9px 12px;
  }

  .modal-comment .avatar {
    display: none;
  }

  .post-modal .post-card {
    padding: 0 0 8px;
  }

  .modal-close {
    width: 32px;
    height: 32px;
    margin-right: 8px;
  }

  .ui-dialog {
    width: 100vw;
  }

  .dialog-header,
  .dialog-footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .dialog-body {
    padding: 14px;
  }

  .btn {
    min-height: 42px;
    padding: 8px 13px;
  }

  #toast-root {
    top: 66px;
    right: 10px;
    left: 10px;
    transform: none;
  }

  .toast {
    min-width: 0;
    width: 100%;
  }

  .hot-grid {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    width: 100%;
    max-width: calc(100vw - 20px);
    grid-template-columns: none;
    grid-auto-columns: unset;
    order: 0;
    margin-right: -10px;
    padding-right: 10px;
    overflow-x: scroll;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
  }

  /* Mobile content order: supporting panels come before the post stream. */
  .feed-grid {
    display: flex;
    flex-direction: column;
  }

  .feed-grid > .right-rail {
    order: -1;
  }

  .community-grid {
    display: flex;
    flex-direction: column;
  }

  .community-grid > div:first-child {
    display: contents;
  }

  .community-grid > div:first-child > .search-bar {
    order: 0;
  }

  .community-grid > div:first-child > .ask-inline-btn,
  .community-grid > div:first-child > .group-settings-btn {
    order: 1;
  }

  .community-grid > div:first-child > .pending-join-card {
    order: 2;
  }

  .community-grid > .right-rail {
    order: 3;
  }

  .community-grid > div:first-child > .post-stream {
    order: 4;
  }

  .hot-grid > .api-post,
  .hot-grid > .question-card {
    flex: 0 0 280px;
    width: 280px;
    min-width: 280px;
    max-width: none;
    height: auto;
    align-self: stretch;
  }

  .hot-grid > .api-post.pinned-post:not(.full-post) {
    height: auto;
  }

  .latest-list,
  .question-list {
    width: 100%;
    min-width: 0;
    overflow: visible;
  }

  .latest-list > *,
  .question-list > * {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .latest-list > .api-post,
  .question-list > .api-post,
  .question-list > .question-card {
    overflow: hidden;
  }

  .latest-list .post-copy,
  .latest-list .post-copy-content,
  .latest-list .formatted-content,
  .question-list .post-copy,
  .question-list .post-copy-content,
  .question-list .formatted-content {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .latest-list img,
  .question-list img {
    max-width: 100%;
  }

  .latest-section,
  .question-list {
    order: 1;
  }
}
