:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --ink: #111827;
  --muted: #667085;
  --dim: #98a2b3;
  --line: #e4e7ec;
  --brand: #ff5a1f;
  --brand-2: #7c3aed;
  --blue: #2563eb;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  --soft: #f8fafc;
  --text: var(--ink);
  --danger: var(--red);
  --focus: 0 0 0 4px rgba(255, 90, 31, 0.14);
}

body[data-theme="dark"] {
  --bg: #080b12;
  --surface: #101522;
  --surface-2: #171d2c;
  --ink: #eef2ff;
  --muted: #a7b0c2;
  --dim: #667085;
  --line: #232b3d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --soft: #0b101b;
  --text: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 90, 31, 0.12), transparent 28rem),
    radial-gradient(circle at 82% 4%, rgba(124, 58, 237, 0.12), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-theme="dark"] {
  background:
    radial-gradient(circle at top left, rgba(255, 90, 31, 0.15), transparent 28rem),
    radial-gradient(circle at 82% 4%, rgba(124, 58, 237, 0.16), transparent 28rem),
    var(--bg);
}

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

button {
  cursor: pointer;
}

button:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 68px;
  display: grid;
  grid-template-columns: 260px minmax(220px, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 0 22px;
  background: rgba(245, 247, 251, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(228, 231, 236, 0.8);
}

body[data-theme="dark"] .topbar {
  background: rgba(8, 11, 18, 0.82);
}

.nav-menu-wrap {
  position: relative;
}

.nav-menu-button {
  min-width: 42px;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 60;
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100vh - 88px);
  overflow: auto;
  display: grid;
  gap: 7px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform-origin: top left;
  animation: navDropdownIn 0.16s ease-out;
}

@keyframes navDropdownIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.nav-dropdown-item {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 9px;
  align-items: center;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 8px 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.nav-dropdown-account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--surface-2);
}

.nav-dropdown-account b,
.nav-dropdown-account small {
  display: block;
}

.nav-dropdown-account small,
.nav-dropdown-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.nav-dropdown-section {
  display: grid;
  gap: 3px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.nav-dropdown-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.nav-dropdown-label {
  padding: 2px 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-dropdown-item:hover,
.nav-dropdown-item:focus-visible,
.nav-dropdown-item.active {
  outline: none;
  background: var(--surface-2);
  color: var(--brand);
}

.nav-dropdown-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--soft);
}

.nav-dropdown-badge {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--brand);
  color: white;
  font-size: 12px;
}

.brand {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 14px 30px rgba(255, 90, 31, 0.28);
}

.search {
  position: relative;
}

.search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 13px 48px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.search input:focus {
  border-color: rgba(255, 90, 31, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 90, 31, 0.12);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  border: 0;
  border-radius: 13px;
  padding: 11px 16px;
  font-weight: 800;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
}

.btn.primary {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 18px 36px rgba(255, 90, 31, 0.22);
}

.btn.danger {
  color: var(--red);
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.08);
}

.btn.ghost {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 320px;
  gap: 22px;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.sidebar,
.rightbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.panel-pad {
  padding: 16px;
}

.nav-item,
.community-row,
.stat-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  background: transparent;
  padding: 12px 14px;
  color: var(--muted);
  text-align: left;
  border-radius: 14px;
  font-weight: 700;
}

.nav-item.active,
.community-row.active {
  color: var(--ink);
  background: linear-gradient(135deg, rgba(255, 90, 31, 0.12), rgba(124, 58, 237, 0.1));
}

.community-row.muted {
  opacity: 0.52;
}

.backend-count-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.backend-count-grid span {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: var(--soft);
}

.backend-count-grid b,
.backend-count-grid small {
  display: block;
}

.backend-count-grid small {
  color: var(--muted);
  margin-top: 2px;
}

.user-discovery-panel {
  margin-bottom: 14px;
}

.user-result-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.user-result-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: var(--soft);
}

.user-result-card small,
.user-result-card p {
  display: block;
  color: var(--muted);
  margin: 4px 0 0;
}

.user-result-name {
  font-weight: 800;
  color: var(--ink);
}

.mini-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 900;
}

.community-dot {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  flex: 0 0 auto;
}

.section-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  padding: 24px;
  margin-bottom: 16px;
  background:
    linear-gradient(135deg, rgba(255, 90, 31, 0.95), rgba(124, 58, 237, 0.92)),
    #1f2937;
  border-radius: 28px;
  color: white;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero p {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.78);
  max-width: 620px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.hero-secondary {
  color: white;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
}

.hero-card {
  width: 210px;
  min-height: 170px;
  border-radius: 24px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(10px);
}

.hero-card strong {
  display: block;
  font-size: 34px;
  letter-spacing: -0.06em;
}

.feed-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 9px 13px;
  font-weight: 800;
  white-space: nowrap;
}

.chip.active {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}

.post-list {
  display: grid;
  gap: 14px;
}

.post-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.post-card.locked {
  opacity: 0.86;
}

.post-card.news-post {
  border-color: rgba(8, 145, 178, 0.24);
}

.vote-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 8px;
  background: #f8fafc;
  border-right: 1px solid var(--line);
}

body[data-theme="dark"] .vote-rail,
body[data-theme="dark"] .action,
body[data-theme="dark"] .trend-card {
  background: #0b101b;
}

.vote-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  font-size: 18px;
  font-weight: 900;
}

.vote-btn:hover,
.vote-btn.active {
  color: var(--brand);
  background: rgba(255, 90, 31, 0.12);
}

.score {
  font-weight: 900;
  font-size: 13px;
}

.post-main {
  padding: 16px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
}

.post-title {
  margin: 10px 0 8px;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.post-body {
  color: #475467;
  line-height: 1.6;
  margin: 0;
}

body[data-theme="dark"] .post-body {
  color: #c7d2e4;
}

.media-card {
  margin-top: 14px;
  min-height: 180px;
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 90, 31, 0.15), rgba(124, 58, 237, 0.18)),
    var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
  font-size: 38px;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.action {
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 11px;
  font-weight: 800;
  font-size: 13px;
}

.action.saved {
  color: var(--brand-2);
  border-color: rgba(124, 58, 237, 0.28);
  background: rgba(124, 58, 237, 0.08);
}

.danger-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--red);
  background: rgba(220, 38, 38, 0.1);
  font-size: 12px;
  font-weight: 900;
}

.news-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 8px;
  color: #0891b2;
  background: rgba(8, 145, 178, 0.1);
  font-size: 12px;
  font-weight: 900;
}

.news-thumb {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  display: block;
  margin-top: 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.link-action {
  text-decoration: none;
}

.news-hero {
  background:
    linear-gradient(135deg, rgba(8, 145, 178, 0.96), rgba(37, 99, 235, 0.92)),
    #0f172a;
}

.news-controls {
  align-items: flex-start;
  flex-direction: column;
}

.insight {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 14px;
  color: var(--amber);
  background: rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(217, 119, 6, 0.18);
  font-size: 13px;
  font-weight: 700;
}

.mod-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.quality {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--green);
  background: rgba(22, 163, 74, 0.1);
  font-size: 12px;
  font-weight: 900;
}

.trend-list,
.comment-list {
  display: grid;
  gap: 10px;
}

.trend-card {
  padding: 14px;
  border-radius: 16px;
  background: #f8fafc;
}

.health-ring {
  width: 132px;
  height: 132px;
  margin: 4px auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--green);
  font-size: 32px;
  font-weight: 900;
  background:
    radial-gradient(circle at center, var(--surface) 58%, transparent 59%),
    conic-gradient(var(--green), var(--brand-2), var(--brand), var(--green));
}

.trend-card b {
  display: block;
  margin-bottom: 4px;
}

.comment {
  display: grid;
  gap: 8px;
  border-left: 3px solid var(--line);
  padding: 10px 0 10px 12px;
}

.comment small {
  color: var(--muted);
  font-weight: 700;
}

.reply-btn {
  width: fit-content;
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--blue);
  background: rgba(37, 99, 235, 0.09);
  font-weight: 800;
  font-size: 12px;
}

.composer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.48);
}

.composer {
  width: min(680px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.composer h2 {
  margin: 0 0 14px;
  letter-spacing: -0.04em;
}

.composer.compact {
  width: min(520px, 100%);
}

.composer.detail {
  width: min(820px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
}

.modal-subtitle {
  margin: -4px 0 16px;
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 12px;
}

.field,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 13px 14px;
  color: var(--ink);
  background: #fbfcfe;
  outline: none;
}

.textarea {
  min-height: 130px;
  resize: vertical;
}

.textarea.small {
  min-height: 86px;
}

.compose-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quality-preview,
.summary-box,
.empty-mini {
  padding: 12px 14px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 700;
}

.summary-box {
  margin: 14px 0;
}

.summary-box p {
  margin-bottom: 0;
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.empty {
  padding: 44px 18px;
  text-align: center;
  color: var(--muted);
}

.profile-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 18px;
  background: var(--surface-2);
}

.profile-avatar {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-size: 28px;
  font-weight: 900;
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  font-weight: 1000;
  line-height: 1;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-button {
  padding: 4px !important;
}

.top-actions .avatar-button {
  width: auto;
  min-width: 0;
  max-width: 180px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px !important;
  border-radius: 999px;
}

.top-actions .avatar-button .avatar {
  width: 30px !important;
  height: 30px !important;
}

.top-actions .avatar-button span:not(.avatar) {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.profile-card b,
.profile-card span {
  display: block;
}

.profile-card span {
  margin-top: 3px;
  color: var(--muted);
}

.profile-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

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

.settings-sheet {
  max-width: 920px;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.settings-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.settings-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  min-height: 420px;
}

.settings-nav {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--soft);
}

.settings-nav-item,
.settings-action-row {
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.settings-nav-item {
  padding: 11px 12px;
}

.settings-nav-item.active,
.settings-nav-item:hover {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.settings-content {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.setting-row {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.settings-card,
.settings-action-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.settings-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.avatar-manager-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 800;
}

.avatar-manager-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.file-btn {
  cursor: pointer;
}

.settings-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.settings-action-row span {
  color: var(--brand);
  font-size: 12px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.rep-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--brand);
  background: rgba(99, 102, 241, 0.1);
  font-size: 11px;
  font-weight: 900;
}

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

.notification-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.notification-tabs,
.notification-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.notification-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.notification-tab span {
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 11px;
}

.notification-tab.active {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.12);
  color: var(--brand);
}

.notification-toolbar {
  align-items: center;
  justify-content: space-between;
}

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-card {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: flex-start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.notification-card.unread {
  border-color: rgba(99, 102, 241, 0.28);
  background: rgba(99, 102, 241, 0.08);
}

.notification-avatar,
.notification-avatar-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--brand);
  font-weight: 1000;
}

.notification-avatar-wrap i {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--brand);
  color: white;
  font-style: normal;
  font-size: 10px;
}

.notification-body p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.notification-message {
  display: flex;
  gap: 8px;
  align-items: center;
}

.unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--brand);
}

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

.notification-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.danger-text {
  color: var(--danger) !important;
}

.messages-shell {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 14px;
}

.messages-list,
.message-thread {
  min-height: 640px;
  overflow: hidden;
}

.messages-head,
.thread-head,
.thread-user,
.thread-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.messages-head,
.thread-head {
  justify-content: space-between;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.messages-head p,
.thread-user span,
.message-safety {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.messages-list .field {
  width: calc(100% - 24px);
  margin: 12px;
}

.message-request-strip {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin: 0 12px 12px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(99, 102, 241, 0.09);
  color: var(--muted);
  font-weight: 900;
}

.conversation-list {
  display: grid;
  gap: 6px;
  padding: 0 8px 12px;
}

.conversation-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 10px;
  cursor: pointer;
}

.conversation-row.active,
.conversation-row:hover {
  background: var(--surface-2);
}

.conversation-row small {
  display: block;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.conversation-row i {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--brand);
  color: white;
  font-style: normal;
  font-size: 11px;
  font-weight: 1000;
}

.message-safety {
  margin: 12px 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.message-bubbles {
  display: grid;
  align-content: end;
  gap: 10px;
  min-height: 430px;
  max-height: 52vh;
  overflow: auto;
  padding: 14px;
}

.message-bubble {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 72%;
}

.message-bubble.own {
  justify-self: end;
}

.message-bubble > div {
  padding: 11px 13px;
  border-radius: 18px;
  background: var(--surface-2);
}

.message-bubble.own > div {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
}

.message-bubble p {
  margin: 0 0 5px;
}

.message-bubble small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.message-bubble.own small {
  color: rgba(255,255,255,0.76);
}

.message-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.help-shell,
.help-layout {
  display: grid;
  gap: 14px;
}

.help-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(32px, 5vw, 56px);
  letter-spacing: -0.05em;
}

.help-hero p {
  color: var(--muted);
  font-weight: 750;
}

.help-layout {
  grid-template-columns: 220px 1fr;
}

.help-nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.help-article-grid,
.support-center,
.ticket-list {
  display: grid;
  gap: 12px;
}

.help-article,
.ticket-card,
.support-form {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.help-article small,
.ticket-card small {
  display: block;
  margin-top: 3px;
  color: var(--brand);
  font-weight: 900;
}

.help-article p,
.ticket-card p {
  color: var(--muted);
  font-weight: 700;
}

.help-article ul {
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.support-center {
  margin-top: 18px;
  grid-template-columns: minmax(240px, 0.85fr) 1fr;
}

.support-form {
  display: grid;
  gap: 10px;
  align-content: start;
}

.ticket-replies {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.ticket-reply-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.avatar-crop-preview {
  width: 220px;
  height: 220px;
  margin: 14px auto;
  border: 5px solid var(--surface-2);
  border-radius: 999px;
  background-repeat: no-repeat;
  box-shadow: var(--shadow);
}

.mod-dashboard {
  display: grid;
  gap: 18px;
}

.mod-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.6fr);
  gap: 18px;
  align-items: stretch;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(99, 102, 241, 0.16), transparent 34%),
    linear-gradient(135deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
}

.mod-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: -0.05em;
}

.mod-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.mod-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mod-stat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.mod-stat b {
  display: block;
  font-size: 24px;
}

.mod-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mod-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mod-panel,
.report-card,
.rule-card,
.appeal-card,
.audit-card,
.analytics-card,
.list-card,
.note-card,
.community-notes {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.mod-panel {
  overflow: hidden;
}

.mod-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.mod-panel-header h2 {
  margin: 0;
  font-size: 18px;
}

.mod-panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.mod-panel-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.report-card,
.rule-card,
.appeal-card,
.audit-card,
.analytics-card,
.list-card {
  padding: 14px;
}

.report-card-top,
.moderation-row,
.appeal-top,
.audit-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.report-card h3,
.rule-card h3,
.appeal-card h3,
.analytics-card h3,
.list-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.report-card p,
.rule-card p,
.appeal-card p,
.audit-card p,
.analytics-card p,
.list-card p,
.moderation-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.status-pill,
.risk-pill,
.role-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.risk-pill.high,
.status-pill.escalated,
.status-pill.removed {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.risk-pill.medium,
.status-pill.review {
  color: #b45309;
  background: rgba(245, 158, 11, 0.14);
}

.status-pill.resolved,
.role-pill {
  color: var(--brand-2);
  background: rgba(16, 185, 129, 0.12);
}

.ai-box {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed rgba(99, 102, 241, 0.35);
  border-radius: 16px;
  background: rgba(99, 102, 241, 0.08);
}

.ai-box b {
  color: var(--ink);
}

.mod-actions,
.note-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.danger-link {
  color: var(--danger) !important;
}

.community-notes {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 12px;
  background: var(--surface-2);
}

.community-notes::before {
  content: "Community Notes";
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.note-card {
  padding: 12px;
  background: var(--surface);
  box-shadow: none;
}

.note-card p {
  margin: 6px 0;
  color: var(--ink);
  line-height: 1.5;
}

.note-card small,
.note-card a {
  color: var(--muted);
}

.removed-post {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--muted);
}

.removed-post strong {
  display: block;
  color: var(--ink);
  margin-bottom: 5px;
}

.removed-comment {
  border-style: dashed;
  opacity: 0.82;
}

.rules-preview {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
}

.rules-preview b {
  color: var(--ink);
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.analytics-card b {
  display: block;
  font-size: 28px;
}

.analytics-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.audit-card {
  display: grid;
  gap: 8px;
}

.audit-top b {
  font-size: 14px;
}

.crisis-banner {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
  font-weight: 900;
}

.onboarding-backdrop {
  z-index: 120;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(18px);
}

.onboarding-card {
  width: min(760px, calc(100vw - 28px));
  max-height: min(860px, calc(100vh - 28px));
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(circle at top left, rgba(99, 102, 241, 0.12), transparent 34%),
    var(--surface);
  box-shadow: var(--shadow);
}

.onboarding-progress {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.onboarding-progress div {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.onboarding-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.onboarding-welcome,
.onboarding-step {
  display: grid;
  gap: 16px;
}

.onboarding-welcome {
  text-align: center;
  place-items: center;
  padding: 24px 8px 12px;
}

.onboarding-mark {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--brand-2), #ef4444);
  box-shadow: 0 18px 38px rgba(99, 102, 241, 0.25);
  font-size: 34px;
  font-weight: 900;
}

.onboarding-welcome h1,
.onboarding-step h2 {
  margin: 0;
  max-width: 680px;
  color: var(--ink);
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1;
  letter-spacing: -0.06em;
}

.onboarding-step h2 {
  font-size: clamp(26px, 4vw, 42px);
}

.onboarding-welcome p,
.onboarding-step > p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.onboarding-actions,
.onboarding-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.onboarding-nav {
  justify-content: space-between;
  margin-top: 4px;
}

.social-row,
.interest-grid,
.recommend-grid,
.benefit-list,
.onboarding-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.interest-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 10px 14px;
  font-weight: 900;
}

.interest-chip.active {
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--brand);
  background: rgba(99, 102, 241, 0.1);
}

.recommend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.recommend-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.recommend-card {
  display: grid;
  gap: 8px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
  color: var(--ink);
  padding: 14px;
  font: inherit;
}

.recommend-card.active {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.1);
}

.recommend-card small,
.recommend-card p,
.field-hint {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.success-link {
  color: var(--brand-2);
}

.form-error {
  padding: 11px 13px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 14px;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
  font-weight: 900;
}

.profile-setup {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
}

.profile-upload {
  width: 130px;
  display: grid;
  gap: 8px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 12px;
  font: inherit;
  font-weight: 900;
}

.profile-upload span,
.profile-upload img {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  object-fit: cover;
  font-size: 28px;
}

.benefit-list span,
.onboarding-summary span {
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 900;
}

.onboarding-language {
  margin-top: 4px;
}

.command-palette {
  width: min(560px, 100%);
  padding: 12px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.command-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.command-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  padding: 12px;
  font-weight: 800;
}

.command-row:hover {
  background: var(--surface-2);
}

kbd {
  min-width: 26px;
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  transform: translateX(-50%);
  padding: 12px 16px;
  border-radius: 999px;
  color: white;
  background: #111827;
  box-shadow: var(--shadow);
  font-weight: 800;
}

body[data-density="compact"] .post-main,
body[data-density="compact"] .panel-pad {
  padding: 12px;
}

body[data-density="compact"] .post-title {
  font-size: 18px;
}

body[data-density="compact"] .media-card {
  min-height: 110px;
}

body[data-font-size="small"] {
  font-size: 14px;
}

body[data-font-size="large"] {
  font-size: 18px;
}

body[data-font-size="large"] .post-title,
body[data-font-size="large"] .hero h1 {
  font-size: 1.18em;
}

body[data-high-contrast="true"] {
  --line: #94a3b8;
  --muted: #1f2937;
  --dim: #374151;
  --brand: #005fcc;
  --brand-2: #004eb0;
}

body[data-theme="dark"][data-high-contrast="true"] {
  --line: #e5e7eb;
  --muted: #f8fafc;
  --dim: #d1d5db;
  --brand: #67e8f9;
  --brand-2: #38bdf8;
}

body[data-reduce-motion="true"] *,
body[data-reduce-motion="true"] *::before,
body[data-reduce-motion="true"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: 0.001ms !important;
}

/* Desktop polish pass: preserves the Reddit-style layout while tightening hierarchy. */
@media (min-width: 1121px) {
  .topbar {
    grid-template-columns: 250px minmax(360px, 1fr) auto;
    padding-inline: max(24px, calc((100vw - 1480px) / 2 + 24px));
  }

  .layout {
    align-items: start;
  }

  .sidebar,
  .rightbar {
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 106px);
    overflow: auto;
    scrollbar-width: thin;
  }

  .feed {
    min-width: 0;
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  min-width: 0;
  min-height: 44px;
  font-size: 19px;
  font-weight: 1000;
  letter-spacing: -0.03em;
}

.topbar > *,
.search,
.top-actions {
  min-width: 0;
}

.top-actions .btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn,
.chip,
.action,
.nav-item,
.community-row,
.settings-nav-item,
.notification-tab,
.conversation-row {
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover,
.chip:hover,
.action:hover,
.settings-action-row:hover,
.conversation-row:hover {
  transform: translateY(-1px);
}

.btn:focus-visible,
.chip:focus-visible,
.action:focus-visible,
.nav-item:focus-visible,
.community-row:focus-visible,
.settings-nav-item:focus-visible,
.notification-tab:focus-visible,
.conversation-row:focus-visible,
.field:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: rgba(255, 90, 31, 0.52);
  box-shadow: var(--focus);
}

.btn.ghost {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

body[data-theme="dark"] .btn.ghost {
  background: rgba(16, 21, 34, 0.78);
}

.nav-item,
.community-row {
  position: relative;
  min-height: 46px;
}

.nav-item span:first-child {
  width: 24px;
  display: inline-grid;
  place-items: center;
}

.nav-item.active::before,
.community-row.active::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
}

.community-row b,
.stat-row span,
.conversation-row b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel,
.post-card,
.composer,
.settings-content,
.settings-nav,
.notification-card,
.messages-list,
.message-thread {
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 18px 50px rgba(15, 23, 42, 0.05);
}

body[data-theme="dark"] .panel,
body[data-theme="dark"] .post-card,
body[data-theme="dark"] .composer,
body[data-theme="dark"] .settings-content,
body[data-theme="dark"] .settings-nav,
body[data-theme="dark"] .notification-card,
body[data-theme="dark"] .messages-list,
body[data-theme="dark"] .message-thread {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025), 0 22px 54px rgba(0, 0, 0, 0.18);
}

.feed-controls {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.post-card {
  position: relative;
}

.post-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body[data-theme="dark"] .post-card::after {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.post-card:hover {
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
}

.vote-rail {
  justify-content: flex-start;
}

.vote-btn {
  display: grid;
  place-items: center;
}

.post-meta {
  row-gap: 6px;
}

.meta-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.meta-link:hover {
  color: var(--brand);
}

.post-title {
  max-width: 880px;
}

.post-actions {
  align-items: center;
}

.action {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.action:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
  background: color-mix(in srgb, var(--brand) 9%, var(--surface));
}

.rightbar .panel {
  border-radius: 20px;
}

.rightbar .panel-pad {
  padding: 18px;
}

.trend-card,
.stat-row {
  border: 1px solid var(--line);
}

.stat-row {
  justify-content: flex-start;
  min-height: 48px;
  background: var(--soft);
}

.stat-row b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  flex: 0 0 auto;
}

.health-ring {
  box-shadow: inset 0 0 0 1px var(--line), 0 20px 42px rgba(22, 163, 74, 0.12);
}

.settings-sheet {
  width: min(980px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.settings-layout {
  min-height: 0;
}

.settings-nav,
.settings-content {
  max-height: min(620px, calc(100vh - 210px));
  overflow: auto;
}

.settings-nav-item.active {
  color: var(--brand);
}

.settings-card,
.settings-action-row,
.setting-row {
  min-height: 52px;
}

.setting-row span {
  color: var(--ink);
}

.setting-row small {
  color: var(--muted);
}

.toggle-row {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.toggle-row input {
  accent-color: var(--brand);
}

.modal-actions {
  align-items: center;
}

.modal-actions::before {
  content: "Changes apply instantly and are saved locally.";
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.notification-center {
  padding: 18px;
}

.notification-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.notification-card {
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
}

.notification-card.unread {
  box-shadow: inset 4px 0 0 var(--brand), 0 18px 48px rgba(15, 23, 42, 0.06);
}

.notification-actions {
  min-width: 130px;
}

.messages-shell {
  align-items: stretch;
}

.messages-list,
.message-thread {
  border-radius: 22px;
}

.message-thread {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

.thread-head {
  background: color-mix(in srgb, var(--surface) 86%, var(--surface-2));
}

.message-bubbles {
  padding: 18px;
  scroll-behavior: smooth;
}

.message-bubble > div {
  border: 1px solid var(--line);
}

.message-bubble.own > div {
  border-color: transparent;
  box-shadow: 0 16px 34px rgba(255, 90, 31, 0.16);
}

.message-composer {
  background: color-mix(in srgb, var(--surface) 86%, var(--surface-2));
}

.message-composer .field {
  border-radius: 999px;
}

.fast-composer-backdrop {
  justify-items: end;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
}

.fast-composer {
  width: min(860px, calc(100vw - 84px));
  margin-right: 24px;
  border-left: 1px solid var(--line);
  border-radius: 28px 0 0 28px;
}

.fast-composer-header,
.fast-composer-footer {
  padding: 16px 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
}

.composer-textarea {
  min-height: 210px;
}

.composer-title,
.composer-textarea {
  letter-spacing: -0.02em;
}

.composer-tool,
.composer-type {
  min-height: 38px;
}

.composer-preview,
.upload-drop,
.quality-preview {
  border-style: dashed;
}

.composer-success {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  text-align: center;
  padding: 40px;
}

.empty strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
  margin: 10px 0 6px;
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: 1fr;
    height: auto;
    gap: 12px;
    padding: 14px;
  }

  .top-actions {
    flex-wrap: wrap;
  }

  .layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .rightbar {
    display: none;
  }
}

@media (max-width: 760px) {
  .topbar {
    height: auto;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }

  .top-actions {
    justify-content: space-between;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .sidebar {
    order: 2;
  }

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

  .hero-card {
    width: 100%;
  }

  .post-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

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

  .mod-hero,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .report-card-top,
  .moderation-row,
  .appeal-top,
  .audit-top {
    display: grid;
  }

  .recommend-grid,
  .recommend-grid.compact,
  .profile-setup {
    grid-template-columns: 1fr;
  }

  .onboarding-nav {
    display: grid;
  }
}

/* Twitter-inspired visual refresh: flatter timeline, left rail, blue action system. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f9f9;
  --ink: #0f1419;
  --muted: #536471;
  --dim: #8b98a5;
  --line: #eff3f4;
  --brand: #1d9bf0;
  --brand-2: #0f8de8;
  --blue: #1d9bf0;
  --green: #00ba7c;
  --red: #f4212e;
  --amber: #ff7a00;
  --shadow: 0 8px 24px rgba(15, 20, 25, 0.08);
}

body[data-theme="dark"] {
  --bg: #000000;
  --surface: #000000;
  --surface-2: #16181c;
  --ink: #e7e9ea;
  --muted: #71767b;
  --dim: #536471;
  --line: #2f3336;
  --shadow: none;
}

body,
body[data-theme="dark"] {
  background: var(--bg);
}

.app-shell {
  grid-template-rows: auto 1fr;
}

.topbar {
  height: 58px;
  grid-template-columns: 260px minmax(260px, 600px) auto;
  gap: 16px;
  padding: 0 max(20px, calc((100vw - 1260px) / 2));
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
}

body[data-theme="dark"] .topbar {
  background: rgba(0, 0, 0, 0.86);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  font-size: 18px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: none;
}

.search input {
  border-color: transparent;
  background: var(--surface-2);
  box-shadow: none;
  padding: 11px 44px;
}

.search input:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--brand);
}

.top-actions .btn.ghost {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
}

.top-actions #openAuth,
.top-actions #openOnboarding {
  width: auto;
  min-width: 92px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  white-space: nowrap;
}

.top-actions .avatar-button {
  width: auto;
  min-width: 0;
  max-width: 190px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px !important;
  border-radius: 999px;
}

.top-actions .avatar-button .avatar {
  width: 30px !important;
  height: 30px !important;
}

.top-actions .avatar-button span:not(.avatar) {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.btn {
  border-radius: 999px;
  box-shadow: none;
}

.btn.primary {
  background: var(--brand);
  box-shadow: none;
}

.btn.primary:hover,
.chip.active,
.action:hover,
.reply-btn:hover {
  filter: brightness(0.97);
}

.layout {
  grid-template-columns: 260px minmax(0, 600px) 330px;
  gap: 0;
  width: min(1260px, 100%);
  padding: 0;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
  padding: 10px 12px 20px 0;
  overflow: auto;
  border-right: 1px solid var(--line);
}

.feed {
  min-height: calc(100vh - 58px);
  border-right: 1px solid var(--line);
}

.rightbar {
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
  padding: 14px 0 20px 16px;
  overflow: auto;
}

.panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.rightbar .panel {
  margin-right: 12px;
  border-radius: 18px;
  background: var(--surface-2);
}

.sidebar .panel {
  padding: 8px 12px;
}

.nav-item,
.community-row,
.stat-row {
  border-radius: 999px;
  padding: 12px 14px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.community-row {
  font-size: 15px;
}

.nav-item span {
  width: 26px;
  text-align: center;
}

.nav-item:hover,
.community-row:hover {
  background: var(--surface-2);
}

.nav-item.active,
.community-row.active {
  color: var(--brand);
  background: rgba(29, 155, 240, 0.1);
}

.section-title {
  color: var(--muted);
  letter-spacing: 0.08em;
}

.community-dot {
  border-radius: 999px;
}

.hero {
  display: block;
  margin: 0;
  padding: 18px 20px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: blur(12px);
}

body[data-theme="dark"] .hero {
  background: rgba(0, 0, 0, 0.82);
}

.hero h1 {
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.hero p {
  max-width: none;
  color: var(--muted);
  font-size: 15px;
}

.hero-card {
  display: none;
}

.hero-secondary {
  color: var(--brand);
  border-color: rgba(29, 155, 240, 0.2);
  background: rgba(29, 155, 240, 0.08);
}

.feed-controls {
  position: sticky;
  top: 58px;
  z-index: 10;
  margin: 0;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
}

body[data-theme="dark"] .feed-controls {
  background: rgba(0, 0, 0, 0.88);
}

.chip {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 12px;
}

.chip:hover {
  background: var(--surface-2);
}

.chip.active {
  color: var(--brand);
  background: rgba(29, 155, 240, 0.1);
}

.post-list {
  gap: 0;
}

.post-card {
  grid-template-columns: 54px minmax(0, 1fr);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}

.post-card:hover {
  background: rgba(247, 249, 249, 0.56);
}

body[data-theme="dark"] .post-card:hover {
  background: rgba(22, 24, 28, 0.55);
}

.vote-rail {
  padding: 16px 6px;
  background: transparent;
  border-right: 0;
}

.vote-btn {
  border-radius: 999px;
}

.vote-btn:hover,
.vote-btn.active {
  color: var(--brand);
  background: rgba(29, 155, 240, 0.12);
}

.post-main {
  padding: 14px 16px 14px 4px;
}

.post-meta {
  color: var(--muted);
}

.post-meta b {
  color: var(--ink);
}

.post-title {
  margin: 5px 0 6px;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.post-body {
  color: var(--ink);
  line-height: 1.5;
}

.post-actions {
  justify-content: space-between;
  max-width: 520px;
}

.action {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 7px 8px;
}

.action:hover {
  color: var(--brand);
  background: rgba(29, 155, 240, 0.1);
}

.action.saved {
  color: var(--brand);
  border-color: transparent;
  background: rgba(29, 155, 240, 0.1);
}

.media-card,
.news-thumb {
  border-radius: 16px;
}

.quality,
.news-pill,
.rep-badge {
  color: var(--brand);
  background: rgba(29, 155, 240, 0.1);
}

.trend-card {
  background: transparent;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.rightbar .trend-card:last-child {
  border-bottom: 0;
}

.health-ring {
  color: var(--brand);
  background:
    radial-gradient(circle at center, var(--surface-2) 58%, transparent 59%),
    conic-gradient(var(--brand), #8ecdf8, var(--brand));
}

.composer {
  border-radius: 18px;
}

.toast {
  background: var(--brand);
}

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 240px minmax(0, 1fr);
    width: 100%;
  }

  .rightbar {
    display: none;
  }

  .topbar {
    grid-template-columns: 240px minmax(220px, 1fr) auto;
    padding: 0 14px;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr;
    height: auto;
  }

  .layout {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px 12px;
  }

  .sidebar .panel:first-child {
    display: flex;
    overflow-x: auto;
    gap: 4px;
  }

  .nav-item {
    width: auto;
    white-space: nowrap;
    font-size: 15px;
  }

  .feed {
    border-right: 0;
  }

  .feed-controls {
    top: 0;
  }

  .post-card {
    grid-template-columns: 46px minmax(0, 1fr);
  }
}

.meta-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font: inherit;
  font-weight: 700;
}

.meta-link:hover {
  color: var(--brand);
  text-decoration: underline;
}

.profile-sheet {
  width: min(920px, calc(100vw - 28px));
  max-height: min(900px, calc(100vh - 28px));
  padding: 0;
  overflow: auto;
}

.profile-cover {
  height: 150px;
  background:
    radial-gradient(circle at 22% 10%, rgba(29, 155, 240, 0.55), transparent 34%),
    linear-gradient(135deg, rgba(29, 155, 240, 0.18), rgba(0, 186, 124, 0.14)),
    var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.profile-close {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(255, 255, 255, 0.82);
}

.profile-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  padding: 0 22px;
  margin-top: -54px;
}

.profile-photo {
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  border: 4px solid var(--surface);
  border-radius: 50%;
  overflow: hidden;
  color: white;
  background: var(--brand);
  font-size: 38px;
  font-weight: 900;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-photo .avatar,
.composer-avatar .avatar {
  width: 100% !important;
  height: 100% !important;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 8px;
}

.profile-header-block {
  padding: 14px 22px 8px;
}

.profile-header-block h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.profile-header-block p {
  margin: 4px 0;
  color: var(--muted);
  line-height: 1.45;
}

.profile-meta-line,
.profile-follow-line {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.profile-follow-line b {
  color: var(--ink);
}

.profile-grid,
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 10px 22px;
}

.profile-card-modern,
.profile-pinned,
.profile-edit-block,
.profile-privacy {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 14px;
}

.profile-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
}

.profile-card-head b {
  color: var(--ink);
}

.rep-progress {
  height: 9px;
  margin: 12px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.rep-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--green));
}

.trust-list,
.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trust-list span,
.profile-badge {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--brand);
  background: rgba(29, 155, 240, 0.1);
  font-weight: 900;
  font-size: 12px;
}

.profile-pinned {
  margin: 10px 22px;
}

.profile-pinned h3,
.profile-edit-block h3 {
  margin: 0 0 10px;
}

.pinned-card,
.profile-content-row,
.profile-activity-row {
  width: 100%;
  display: grid;
  gap: 4px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 12px 0;
}

.pinned-card:first-of-type,
.profile-content-row:first-child,
.profile-activity-row:first-child {
  border-top: 0;
}

.pinned-card span,
.profile-content-row span,
.profile-activity-row span,
.profile-activity-row small {
  color: var(--muted);
  font-weight: 800;
}

.profile-stat {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}

.profile-stat b {
  display: block;
  font-size: 22px;
}

.profile-stat span {
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
}

.profile-badges {
  padding: 10px 22px;
}

.profile-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.profile-tab-toolbar {
  padding: 10px 22px 0;
}

.profile-tab-content {
  padding: 10px 22px 22px;
}

.profile-badge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-badge-card,
.profile-community-row {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}

.profile-badge-card p,
.profile-community-row p {
  margin: 4px 0 0;
  color: var(--muted);
}

.profile-community-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.profile-privacy,
.profile-edit-block {
  margin: 0 22px 14px;
}

.profile-privacy summary {
  cursor: pointer;
  font-weight: 900;
}

@media (max-width: 760px) {
  .profile-grid,
  .profile-stats-grid,
  .profile-badge-grid {
    grid-template-columns: 1fr;
  }

  .profile-hero {
    display: grid;
  }

  .profile-actions {
    padding-bottom: 0;
  }
}

.composer-fab {
  position: fixed;
  right: max(18px, calc((100vw - 1260px) / 2 + 18px));
  bottom: 24px;
  z-index: 35;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--brand);
  box-shadow: 0 12px 30px rgba(29, 155, 240, 0.35);
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.composer-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 16px 40px rgba(29, 155, 240, 0.42);
}

.fast-composer-backdrop {
  z-index: 110;
  align-items: stretch;
  padding: 0;
  background: rgba(15, 23, 42, 0.42);
}

.fast-composer {
  width: min(760px, 100vw);
  height: 100vh;
  max-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  animation: composerSlide 0.2s ease-out;
}

@keyframes composerSlide {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.fast-composer-header,
.fast-composer-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.fast-composer-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  overflow-x: auto;
}

.fast-composer-body {
  overflow: auto;
  padding: 16px;
}

.composer-identity {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.composer-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  color: white;
  background: var(--brand);
  font-weight: 900;
}

.composer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.composer-identity span {
  display: block;
  color: var(--muted);
  margin: 2px 0 8px;
}

.composer-pill-select {
  border: 1px solid rgba(29, 155, 240, 0.28);
  border-radius: 999px;
  color: var(--brand);
  background: rgba(29, 155, 240, 0.08);
  padding: 6px 10px;
  font-weight: 900;
}

.composer-type-row,
.share-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.composer-type,
.composer-tool {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 8px 11px;
  white-space: nowrap;
  font-weight: 900;
}

.composer-type.active,
.composer-tool:hover {
  color: var(--brand);
  border-color: rgba(29, 155, 240, 0.28);
  background: rgba(29, 155, 240, 0.08);
}

.composer-textarea {
  width: 100%;
  min-height: 170px;
  border: 0;
  outline: none;
  resize: vertical;
  background: transparent;
  color: var(--ink);
  padding: 14px 0;
  font-size: 22px;
  line-height: 1.35;
}

.composer-title {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  outline: none;
  background: transparent;
  color: var(--ink);
  padding: 13px 0;
  font-weight: 900;
}

.composer-controls-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.composer-controls-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
}

.composer-preview,
.upload-drop {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}

.composer-preview p {
  margin: 6px 0;
}

.composer-preview span,
.draft-state {
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.composer-schedule {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.draft-drawer {
  position: absolute;
  top: 58px;
  right: 14px;
  width: min(360px, calc(100vw - 28px));
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 8px;
}

.draft-row {
  width: 100%;
  display: grid;
  gap: 4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 10px;
}

.draft-row:hover {
  background: var(--surface-2);
}

.draft-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.composer-success {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
}

.composer-success h2 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.04em;
}

@media (min-width: 760px) {
  .fast-composer-backdrop {
    place-items: center;
    padding: 28px;
  }

  .fast-composer {
    height: min(860px, calc(100vh - 56px));
    border-radius: 24px;
  }
}

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

  .settings-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 12px;
  }

  .settings-nav-item {
    white-space: nowrap;
  }

  .notification-card {
    grid-template-columns: 38px 1fr;
  }

  .notification-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .messages-shell,
  .help-layout,
  .support-center {
    grid-template-columns: 1fr;
  }

  .messages-list,
  .message-thread {
    min-height: auto;
  }

  .message-bubble {
    max-width: 88%;
  }

  .ticket-reply-row {
    grid-template-columns: 1fr;
  }

  .composer-fab {
    right: 18px;
    bottom: 18px;
  }

  .composer-controls-grid {
    grid-template-columns: 1fr;
  }

  .composer-textarea {
    font-size: 20px;
  }
}
/* Editorial premium refinement: calmer, less colorful, smaller typography. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f5f6f8;
  --ink: #171717;
  --muted: #777b84;
  --dim: #b4b8c0;
  --line: #e8eaee;
  --brand: #343740;
  --brand-2: #4a4f5b;
  --charcoal: #343740;
  --charcoal-2: #4a4f5b;
  --glass: rgba(232, 239, 250, 0.72);
  --glass-strong: rgba(219, 230, 247, 0.82);
  --glass-border: rgba(186, 205, 232, 0.72);
  --glass-text: #252832;
  --glass-glow: rgba(92, 125, 176, 0.14);
  --blue: #2563eb;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --shadow: 0 18px 44px rgba(17, 24, 39, 0.07);
  --soft: #f7f8fa;
  --focus: 0 0 0 3px rgba(23, 23, 23, 0.08);
}

body[data-theme="dark"] {
  --bg: #090a0c;
  --surface: #111318;
  --surface-2: #171a20;
  --ink: #f4f5f7;
  --muted: #9ba1ad;
  --dim: #676d78;
  --line: #242832;
  --brand: #d9dde6;
  --brand-2: #c5cad4;
  --charcoal: #d9dde6;
  --charcoal-2: #c5cad4;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-text: #f4f5f7;
  --glass-glow: rgba(148, 163, 184, 0.14);
  --shadow: 0 20px 54px rgba(0, 0, 0, 0.42);
  --soft: #0e1014;
}

body {
  background: var(--bg);
  font-size: 14px;
  letter-spacing: -0.015em;
}

body[data-theme="dark"] {
  background: var(--bg);
}

.app-shell::before {
  display: none;
}

.topbar {
  height: 64px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  backdrop-filter: blur(14px);
}

body[data-theme="dark"] .topbar {
  background: rgba(9, 10, 12, 0.92);
  border-bottom-color: var(--line);
}

.brand {
  font-size: 17px;
  letter-spacing: -0.035em;
}

.brand-mark,
.onboarding-mark,
.profile-avatar,
.profile-upload span,
.profile-upload img,
.community-dot,
.nav-dropdown-icon,
.notification-avatar {
  border-radius: 16px;
  color: var(--glass-text);
  background:
    linear-gradient(135deg, var(--glass-strong), var(--glass)),
    rgba(225, 235, 250, 0.58);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 14px 32px var(--glass-glow);
  backdrop-filter: blur(16px) saturate(1.2);
}

body[data-theme="dark"] .brand-mark,
body[data-theme="dark"] .onboarding-mark,
body[data-theme="dark"] .profile-avatar,
body[data-theme="dark"] .profile-upload span,
body[data-theme="dark"] .profile-upload img,
body[data-theme="dark"] .community-dot,
body[data-theme="dark"] .nav-dropdown-icon,
body[data-theme="dark"] .notification-avatar {
  color: var(--glass-text);
  background: linear-gradient(135deg, var(--glass-strong), var(--glass));
}

.community-dot {
  border-radius: 999px;
  font-size: 13px;
  background:
    linear-gradient(135deg, var(--glass-strong), var(--glass)),
    rgba(225, 235, 250, 0.58) !important;
}

.community-dot:empty::before {
  content: "#";
  color: var(--glass-text);
  font-weight: 1000;
}

.layout {
  grid-template-columns: 258px minmax(0, 1fr) 312px;
  gap: 18px;
  padding: 18px;
  width: min(1400px, 100%);
}

.panel,
.post-card,
.composer,
.command-palette,
.onboarding-card,
.mod-panel,
.report-card,
.rule-card,
.appeal-card,
.audit-card,
.analytics-card,
.list-card,
.note-card,
.community-notes,
.messages-list,
.message-thread {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: none;
  backdrop-filter: none;
}

body[data-theme="dark"] .panel,
body[data-theme="dark"] .post-card,
body[data-theme="dark"] .composer,
body[data-theme="dark"] .command-palette,
body[data-theme="dark"] .onboarding-card,
body[data-theme="dark"] .mod-panel,
body[data-theme="dark"] .report-card,
body[data-theme="dark"] .rule-card,
body[data-theme="dark"] .appeal-card,
body[data-theme="dark"] .audit-card,
body[data-theme="dark"] .analytics-card,
body[data-theme="dark"] .list-card,
body[data-theme="dark"] .note-card,
body[data-theme="dark"] .community-notes,
body[data-theme="dark"] .messages-list,
body[data-theme="dark"] .message-thread {
  background: var(--surface);
  border-color: var(--line);
}

.panel,
.post-card {
  border-radius: 18px;
}

.panel-pad,
.post-main {
  padding: 15px;
}

.search input,
.field,
.textarea,
.select {
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: none;
}

.search input:focus,
.field:focus,
.textarea:focus,
.select:focus {
  border-color: #b8bdc7;
  box-shadow: var(--focus);
}

.btn {
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 13px;
  box-shadow: none;
}

.btn.primary,
.message-bubble.own > div,
.composer-fab,
.onboarding-progress i {
  color: var(--glass-text);
  background:
    linear-gradient(135deg, var(--glass-strong), var(--glass)),
    rgba(225, 235, 250, 0.6);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 14px 32px var(--glass-glow);
  backdrop-filter: blur(16px) saturate(1.2);
}

body[data-theme="dark"] .btn.primary,
body[data-theme="dark"] .message-bubble.own > div,
body[data-theme="dark"] .composer-fab,
body[data-theme="dark"] .onboarding-progress i {
  color: var(--glass-text);
  background: linear-gradient(135deg, var(--glass-strong), var(--glass));
}

.btn:hover,
.chip:hover,
.action:hover,
.notification-tab:hover,
.composer-type:hover,
.composer-tool:hover,
.mini-btn:hover,
.post-card:hover,
.nav-item:hover,
.community-row:hover {
  transform: none;
  box-shadow: none;
}

.nav-item,
.community-row,
.stat-row {
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 13px;
  color: var(--muted);
}

.nav-item.active,
.community-row.active,
.chip.active {
  color: var(--glass-text);
  background:
    linear-gradient(135deg, var(--glass-strong), var(--glass)),
    rgba(225, 235, 250, 0.6);
  border-color: var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 14px 34px var(--glass-glow);
  backdrop-filter: blur(16px) saturate(1.2);
}

body[data-theme="dark"] .nav-item.active,
body[data-theme="dark"] .community-row.active,
body[data-theme="dark"] .chip.active {
  color: var(--glass-text);
  background: linear-gradient(135deg, var(--glass-strong), var(--glass));
  border-color: var(--glass-border);
}

.section-title {
  font-size: 11px;
  letter-spacing: 0.09em;
}

.hero,
.mod-hero,
.news-hero {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
}

.hero h1,
.help-hero h1,
.mod-hero h1,
.onboarding-welcome h1,
.onboarding-step h2 {
  font-size: clamp(25px, 3.2vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.055em;
}

.hero p,
.help-hero p,
.mod-hero p,
.onboarding-welcome p,
.onboarding-step > p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.hero-secondary {
  color: var(--ink);
  background:
    linear-gradient(135deg, var(--glass-strong), var(--glass)),
    rgba(225, 235, 250, 0.6);
  border-color: var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 14px 32px var(--glass-glow);
  backdrop-filter: blur(16px) saturate(1.2);
}

.hero-card {
  width: 190px;
  min-height: 142px;
  border-radius: 16px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: none;
}

.hero-card strong {
  font-size: 28px;
}

.chip,
.action,
.notification-tab,
.composer-type,
.composer-tool,
.mini-btn {
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: none;
  font-size: 12px;
}

.btn.ghost,
.hero-secondary,
.settings-nav-item.active,
.settings-nav-item:hover,
.conversation-row.active,
.conversation-row:hover,
.command-row:hover,
.draft-row:hover,
.notification-tab.active,
.interest-chip.active,
.recommend-card.active,
.composer-type.active,
.composer-tool:hover {
  color: var(--glass-text);
  background:
    linear-gradient(135deg, var(--glass-strong), var(--glass)),
    rgba(225, 235, 250, 0.58);
  border-color: var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 12px 28px var(--glass-glow);
  backdrop-filter: blur(16px) saturate(1.2);
}

body[data-theme="dark"] .btn.ghost,
body[data-theme="dark"] .hero-secondary,
body[data-theme="dark"] .settings-nav-item.active,
body[data-theme="dark"] .settings-nav-item:hover,
body[data-theme="dark"] .conversation-row.active,
body[data-theme="dark"] .conversation-row:hover,
body[data-theme="dark"] .command-row:hover,
body[data-theme="dark"] .draft-row:hover,
body[data-theme="dark"] .notification-tab.active,
body[data-theme="dark"] .interest-chip.active,
body[data-theme="dark"] .recommend-card.active,
body[data-theme="dark"] .composer-type.active,
body[data-theme="dark"] .composer-tool:hover {
  color: var(--glass-text);
  background: linear-gradient(135deg, var(--glass-strong), var(--glass));
  border-color: var(--glass-border);
}

.post-card {
  grid-template-columns: 52px minmax(0, 1fr);
  background: var(--surface) !important;
}

.community-row,
.nav-item,
.conversation-row,
.nav-dropdown-item {
  min-width: 0;
}

.community-row > div:not(.community-dot),
.conversation-row > div,
.nav-dropdown-item span {
  min-width: 0;
}

.community-row b,
.conversation-row b,
.nav-dropdown-item span {
  overflow-wrap: anywhere;
}

.post-card:nth-child(n),
body[data-theme="dark"] .post-card:nth-child(n) {
  background: var(--surface) !important;
}

.vote-rail,
body[data-theme="dark"] .vote-rail,
body[data-theme="dark"] .action,
body[data-theme="dark"] .trend-card {
  background: var(--surface-2);
}

.vote-rail {
  min-height: 132px;
  justify-content: flex-start;
}

.vote-btn {
  width: 30px;
  height: 30px;
  font-size: 16px;
}

.vote-btn:disabled {
  opacity: 0.42;
  color: var(--muted);
}

.vote-btn:hover,
.vote-btn.active {
  color: var(--ink);
  background: rgba(17, 17, 17, 0.08);
}

.score {
  font-size: 12px;
}

.post-meta {
  font-size: 12px;
}

.post-title {
  margin: 8px 0 7px;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.post-body {
  color: #50545d;
  font-size: 13.5px;
  line-height: 1.58;
}

body[data-theme="dark"] .post-body {
  color: #c5c9d2;
}

.media-card {
  min-height: 150px;
  border-radius: 15px;
  background: var(--surface-2);
  font-size: 30px;
  box-shadow: none;
}

.news-thumb {
  max-height: 230px;
  border-radius: 15px;
  box-shadow: none;
}

.news-pill,
.quality,
.rep-badge,
.status-pill,
.risk-pill,
.role-pill {
  font-size: 10.5px;
  padding: 4px 7px;
}

.trend-card,
.settings-card,
.settings-action-row,
.help-article,
.ticket-card,
.support-form,
.recommend-card,
.quality-preview,
.summary-box,
.empty-mini,
.message-safety,
.composer-preview,
.upload-drop,
.notification-card,
.user-result-card,
.profile-card,
.message-request-strip {
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

body[data-theme="dark"] .trend-card,
body[data-theme="dark"] .settings-card,
body[data-theme="dark"] .settings-action-row,
body[data-theme="dark"] .help-article,
body[data-theme="dark"] .ticket-card,
body[data-theme="dark"] .support-form,
body[data-theme="dark"] .recommend-card,
body[data-theme="dark"] .quality-preview,
body[data-theme="dark"] .summary-box,
body[data-theme="dark"] .empty-mini,
body[data-theme="dark"] .message-safety,
body[data-theme="dark"] .composer-preview,
body[data-theme="dark"] .upload-drop,
body[data-theme="dark"] .notification-card,
body[data-theme="dark"] .user-result-card,
body[data-theme="dark"] .profile-card,
body[data-theme="dark"] .message-request-strip {
  background: var(--surface-2);
}

.settings-nav,
.settings-content {
  border-radius: 16px;
}

.settings-nav-item,
.settings-action-row,
.conversation-row,
.command-row,
.draft-row {
  border-radius: 12px;
}

.notification-card {
  grid-template-columns: 38px 1fr auto;
  padding: 11px;
}

.notification-avatar,
.notification-avatar-wrap {
  width: 38px;
  height: 38px;
}

.notification-card.unread {
  border-color: #d3d7df;
  background: #f1f3f6;
}

body[data-theme="dark"] .notification-card.unread {
  border-color: #3a404c;
  background: #1b1f27;
}

.composer,
.onboarding-card {
  border-radius: 20px;
}

.onboarding-card {
  padding: 22px;
}

.onboarding-mark {
  width: 62px;
  height: 62px;
  font-size: 28px;
}

.composer-textarea {
  font-size: 19px;
}

.toast {
  color: var(--glass-text);
  background: linear-gradient(135deg, var(--glass-strong), var(--glass));
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 14px 34px var(--glass-glow);
  backdrop-filter: blur(16px) saturate(1.2);
}

@media (min-width: 1121px) {
  .topbar {
    grid-template-columns: 258px minmax(360px, 1fr) auto;
    padding-inline: max(18px, calc((100vw - 1400px) / 2 + 18px));
  }

  .layout {
    width: min(1400px, 100%);
  }

  .sidebar,
  .rightbar {
    top: 82px;
    max-height: calc(100vh - 98px);
  }
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: 1fr;
    height: auto;
    gap: 10px;
    padding: 14px;
  }

  .top-actions {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .top-actions::-webkit-scrollbar {
    display: none;
  }

  .top-actions > * {
    flex: 0 0 auto;
  }

  .layout {
    grid-template-columns: 236px minmax(0, 1fr);
    width: 100%;
  }

  .rightbar {
    display: none;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 13.5px;
  }

  .topbar {
    padding: 12px;
  }

  .search input {
    padding-block: 10px;
  }

  .layout {
    display: grid;
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .sidebar {
    order: 0;
  }

  .hero h1,
  .help-hero h1,
  .mod-hero h1,
  .onboarding-welcome h1,
  .onboarding-step h2 {
    font-size: clamp(23px, 8vw, 32px);
  }

  .sidebar .panel:first-child {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sidebar .panel:first-child::-webkit-scrollbar {
    display: none;
  }

  .sidebar .panel:first-child .nav-item {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }
}
