/*
 * MolDraw Community — feed layout and components (loaded after the page's
 * base styles). Flat timeline: hairline dividers instead of boxed cards, one
 * button style, real icons, light and dark themes from the same tokens.
 * Markup the server renders for search engines is unchanged; this only
 * restyles it.
 */

:root {
  --c-bg: #ffffff;
  --c-surface: #ffffff;
  --c-surface-2: #f7f9f9;
  --c-surface-3: #eff3f4;
  --c-hover: rgba(15, 20, 25, 0.035);
  --c-press: rgba(15, 20, 25, 0.07);
  --c-line: #eff3f4;
  --c-line-strong: #cfd9de;
  --c-text: #0f1419;
  --c-text-2: #536471;
  --c-text-3: #8b98a5;
  --c-accent: #2c7a7b;
  --c-accent-strong: #236566;
  --c-accent-soft: rgba(44, 122, 123, 0.1);
  --c-accent-ring: rgba(44, 122, 123, 0.35);
  --c-on-accent: #ffffff;
  --c-up: #0f8a5f;
  --c-up-soft: rgba(15, 138, 95, 0.1);
  --c-like: #f91880;
  --c-like-soft: rgba(249, 24, 128, 0.1);
  --c-danger: #e0245e;
  --c-backdrop: rgba(15, 20, 25, 0.42);
  --c-shadow-pop: 0 0 15px rgba(101, 119, 134, 0.2), 0 0 3px 1px rgba(101, 119, 134, 0.15);
  --c-shadow-sheet: 0 -8px 32px rgba(15, 23, 42, 0.16);
  --c-radius: 16px;
  --c-radius-sm: 10px;
  --c-font: Inter, 'Libre Franklin', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  --c-topbar-h: 45px;
  --c-tabbar-h: 56px;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --c-bg: #0d1114;
  --c-surface: #0d1114;
  --c-surface-2: #161b1f;
  --c-surface-3: #1f262b;
  --c-hover: rgba(231, 233, 234, 0.04);
  --c-press: rgba(231, 233, 234, 0.08);
  --c-line: #262d32;
  --c-line-strong: #39434a;
  --c-text: #e7e9ea;
  --c-text-2: #8b98a5;
  --c-text-3: #6b7680;
  --c-accent: #47b5b6;
  --c-accent-strong: #5fc6c7;
  --c-accent-soft: rgba(71, 181, 182, 0.14);
  --c-accent-ring: rgba(71, 181, 182, 0.45);
  --c-on-accent: #061314;
  --c-up: #34c38f;
  --c-up-soft: rgba(52, 195, 143, 0.14);
  --c-backdrop: rgba(91, 112, 131, 0.4);
  --c-shadow-pop: 0 0 15px rgba(255, 255, 255, 0.08), 0 0 3px 1px rgba(255, 255, 255, 0.06);
  --c-shadow-sheet: 0 -8px 32px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

/* ── Page ─────────────────────────────────────────────────────────── */
html,
body {
  background: var(--c-bg);
}
body {
  color: var(--c-text);
  font-family: var(--c-font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}
.visually-hidden,
.comment-heading {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Shared site top bar follows the theme. */
[data-theme='dark'] .site-topbar-root {
    background: rgba(13, 17, 20, 0.86) !important;
    border-bottom-color: var(--c-line) !important;
  }
[data-theme='dark'] .site-topbar-wordmark,
[data-theme='dark'] .site-topbar-link:not(.site-topbar-cta) {
    color: var(--c-text) !important;
  }
[data-theme='dark'] .site-topbar-by {
    color: var(--c-text-2) !important;
  }
[data-theme='dark'] .site-topbar-link:not(.site-topbar-cta):hover {
    background: var(--c-hover) !important;
  }

/* ── Shell: left rail | feed | right rail ─────────────────────────── */
.community-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 600px) 330px;
  justify-content: center;
  column-gap: 28px;
  width: 100%;
  max-width: 1290px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
  align-items: start;
}

/* Left rail */
.community-sidebar {
  position: sticky;
  top: var(--c-topbar-h);
  height: calc(100vh - var(--c-topbar-h));
  height: calc(100dvh - var(--c-topbar-h));
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 0 12px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow-y: auto;
  scrollbar-width: none;
}
.community-sidebar::-webkit-scrollbar {
  display: none;
}
.community-sidebar .sidebar-title {
  margin: 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--c-text-2);
}
.community-sidebar .sidebar-text {
  margin: 2px 12px 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--c-text-2);
}
.rail-nav,
.community-sidebar .tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}
.community-sidebar .tab-btn,
.rail-link {
  display: flex;
  align-items: center;
  gap: 16px;
  width: fit-content;
  max-width: 100%;
  min-height: 48px;
  padding: 0 18px 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--c-text);
  font: inherit;
  font-size: 19px;
  font-weight: 450;
  text-decoration: none;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 0.15s ease;
}
.community-sidebar .tab-btn:hover,
.rail-link:hover {
  background: var(--c-press);
}
.community-sidebar .tab-btn.active,
.rail-link.is-active {
  font-weight: 700;
  background: transparent;
  color: var(--c-text);
  border: 0;
}
.rail-icon {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
}
.rail-link[hidden] {
  display: none;
}
.rail-post-btn {
  margin: 14px 12px 6px 0;
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  background: var(--c-accent);
  color: var(--c-on-accent);
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.rail-post-btn:hover {
  background: var(--c-accent-strong);
}
.rail-post-btn:active {
  transform: scale(0.98);
}
.rail-post-btn .rail-icon {
  display: none;
}
.rail-account {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 12px 0 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--c-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.rail-account:hover {
  background: var(--c-press);
}
.rail-account[hidden] {
  display: none;
}
.rail-account .avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}
.rail-account-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.rail-account-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-account-sub {
  font-size: 13px;
  color: var(--c-text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.community-sidebar .seo-summary {
  margin: auto 12px 0 0;
  padding: 16px 12px 4px;
  border: 0;
  border-top: 1px solid var(--c-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  line-height: 1.45;
  color: var(--c-text-3);
}
.community-sidebar .seo-summary h2 {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--c-text-2);
}
.community-sidebar .seo-summary p,
.community-sidebar .seo-summary dl,
.community-sidebar .seo-summary dd {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--c-text-3);
}
.community-sidebar .seo-summary dt {
  margin: 6px 0 1px;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-2);
}
.community-sidebar .seo-summary .community-policy-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Feed column */
.community-main {
  min-width: 0;
  min-height: calc(100vh - var(--c-topbar-h));
  margin: 0;
  padding: 0 0 80px;
  border-left: 1px solid var(--c-line);
  border-right: 1px solid var(--c-line);
  background: var(--c-surface);
}
.feed-header {
  position: sticky;
  top: var(--c-topbar-h);
  z-index: 20;
  background: color-mix(in srgb, var(--c-surface) 86%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--c-line);
}
.feed-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
}
.feed-header .community-page-title,
.community-page-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--c-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.community-page-title a {
  color: inherit;
  text-decoration: none;
}
.feed-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--c-text);
  cursor: pointer;
}
.feed-icon-btn:hover {
  background: var(--c-press);
}
.feed-icon-btn svg {
  width: 20px;
  height: 20px;
}
.feed-search-toggle {
  display: none;
}
.feed-tabs {
  display: flex;
}
.feed-tabs[hidden] {
  display: none;
}
.feed-tab {
  position: relative;
  flex: 1 1 0;
  min-height: 50px;
  border: 0;
  background: transparent;
  color: var(--c-text-2);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.feed-tab:hover {
  background: var(--c-hover);
}
.feed-tab[aria-selected='true'] {
  color: var(--c-text);
  font-weight: 700;
}
.feed-tab[aria-selected='true']::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 56px;
  height: 4px;
  border-radius: 999px;
  background: var(--c-accent);
  transform: translateX(-50%);
}
.feed-search {
  padding: 8px 16px 10px;
}
.feed-search[hidden] {
  display: none;
}

/* Search field (right rail and inline) */
.search-field {
  position: relative;
  display: flex;
  align-items: center;
}
.search-field svg {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  color: var(--c-text-2);
  pointer-events: none;
}
.search-field input {
  width: 100%;
  min-height: 44px;
  padding: 0 40px 0 48px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--c-surface-3);
  color: var(--c-text);
  font: inherit;
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
}
.search-field input::placeholder {
  color: var(--c-text-2);
}
.search-field input:focus {
  border-color: var(--c-accent);
  background: var(--c-surface);
  box-shadow: 0 0 0 1px var(--c-accent);
}
.search-field input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.search-clear {
  position: absolute;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: var(--c-accent);
  color: #fff;
  cursor: pointer;
}
.search-clear[hidden] {
  display: none;
}
.search-clear svg {
  position: static;
  width: 14px;
  height: 14px;
  color: #fff;
}
.search-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-line);
  font-size: 15px;
  color: var(--c-text-2);
}
.search-results-head[hidden] {
  display: none;
}
.search-results-head strong {
  color: var(--c-text);
}

/* Slim sign-in banner (phones, signed out) */
.signin-banner {
  display: none;
}

/* Right rail */
.community-right-rail {
  position: sticky;
  top: var(--c-topbar-h);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - var(--c-topbar-h));
  padding: 10px 0 24px;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow-y: auto;
  scrollbar-width: none;
}
.community-right-rail::-webkit-scrollbar {
  display: none;
}
#community-rail-default {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.rail-search {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0;
  padding: 2px 0 4px;
  background: var(--c-bg);
}
.community-right-rail .auth-panel,
.rail-card,
.community-right-rail .cta-card {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--c-line);
  border-radius: var(--c-radius);
  background: var(--c-surface);
  box-shadow: none;
  color: var(--c-text);
}
.community-right-rail .auth-panel strong,
.rail-card-title,
.community-right-rail .cta-card h2 {
  display: block;
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--c-text);
}
.community-right-rail .auth-panel p,
.community-right-rail .cta-card p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--c-text-2);
}
.community-right-rail .auth-row {
  display: flex;
  gap: 8px;
}
.community-right-rail .auth-row .btn {
  width: 100%;
}
body.is-signed-in .community-right-rail .auth-panel {
  display: none;
}
.rail-card {
  padding: 12px 0 4px;
}
.rail-card-title {
  padding: 0 16px 6px;
}
.trending-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.trending-item a {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.trending-item a:hover {
  background: var(--c-hover);
}
.trending-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12.5px;
  color: var(--c-text-2);
}
.trending-title {
  display: block;
  margin: 2px 0 2px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--c-text);
}
.trending-count {
  font-size: 13px;
  color: var(--c-text-2);
}
.trending-empty {
  padding: 6px 16px 12px;
  font-size: 14px;
  color: var(--c-text-2);
}
.rail-card-more {
  display: block;
  padding: 12px 16px 12px;
  border-radius: 0 0 var(--c-radius) var(--c-radius);
  color: var(--c-accent);
  font-size: 15px;
  text-decoration: none;
}
.rail-card-more:hover {
  background: var(--c-hover);
}
.community-right-rail .learn-cta {
  display: block;
  text-decoration: none;
  background: linear-gradient(135deg, var(--c-accent-soft), transparent 70%), var(--c-surface);
  border-color: var(--c-accent-ring);
}
.learn-cta-kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-accent);
}
.learn-cta-btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--c-text);
  color: var(--c-bg);
  font-size: 14px;
  font-weight: 700;
}
.community-right-rail .stat-list {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.community-right-rail .stat-list li {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--c-text-2);
}
.community-right-rail .stat-list strong {
  display: block;
  font-size: 15px;
  color: var(--c-text);
}
.community-right-rail .community-policy-link {
  display: inline-flex;
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.community-right-rail .community-policy-link:hover {
  text-decoration: underline;
}
.rail-footer {
  padding: 0 16px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--c-text-3);
}

/* ── Buttons (one style) ──────────────────────────────────────────── */
.btn,
.btn-primary,
.btn-light,
.post-modal-submit,
.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}
.btn-primary,
.post-modal-submit {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: var(--c-on-accent);
}
.btn-primary:hover:not(:disabled),
.post-modal-submit:hover:not(:disabled) {
  background: var(--c-accent-strong);
  border-color: var(--c-accent-strong);
}
.btn-light {
  background: transparent;
  border-color: var(--c-line-strong);
  color: var(--c-text);
}
.btn-light:hover:not(:disabled) {
  background: var(--c-press);
}
.btn:disabled,
.post-modal-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.google-btn {
  width: 100%;
  min-height: 42px;
  background: var(--c-surface);
  border-color: var(--c-line-strong);
  color: var(--c-text);
}
.google-btn:hover {
  background: var(--c-hover);
}

/* ── Composer ─────────────────────────────────────────────────────── */
.composer.post-launcher {
  display: block;
  margin: 0;
  padding: 12px 16px 8px;
  border: 0;
  border-bottom: 1px solid var(--c-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.post-launcher-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}
.post-launcher-top .avatar,
#composer-avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}
.composer .inline-post-body {
  flex: 1 1 auto;
  min-height: 48px;
  margin: 0;
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--c-text-2);
  font: inherit;
  font-size: 20px;
  font-weight: 400;
  text-align: left;
  cursor: text;
  box-shadow: none;
}
.composer .inline-post-body:hover {
  background: transparent;
  color: var(--c-text-2);
}
.post-launcher-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 4px 0 0 52px;
  padding: 8px 0 0;
  border-top: 1px solid var(--c-line);
}
.post-action-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--c-accent);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.post-action-chip:hover {
  background: var(--c-accent-soft);
}
.post-action-chip svg {
  width: 19px;
  height: 19px;
}
.post-action-chip .chip-label {
  color: var(--c-text-2);
  font-weight: 500;
}
.post-launcher-post {
  margin-left: auto;
  min-height: 36px;
}
/* Inline expanded composer (desktop): the post form moves into the card. */
.post-modal .post-modal-cancel {
  display: none;
}
.composer-inline-host .post-modal-cancel {
  display: inline-flex;
}
.composer-inline-host:empty {
  display: none;
}
.composer.is-expanded .post-launcher-top,
.composer.is-expanded .post-launcher-actions {
  display: none;
}
.composer-inline-host .post-modal {
  position: static;
  width: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
  animation: none;
}
.composer-inline-host .post-modal-head {
  display: none;
}
.composer-inline-host .post-modal-body {
  padding: 0;
}

/* ── Feed + post cards ────────────────────────────────────────────── */
.feed {
  display: block;
  margin: 0;
  padding: 0;
}
.status:empty {
  display: none;
}
.community-main > .status {
  margin: 0;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--c-text-2);
}
.community-card {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 0;
  margin: 0;
  padding: 12px 16px 6px;
  border: 0;
  border-bottom: 1px solid var(--c-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: background-color 0.15s ease;
  cursor: pointer;
}
.community-card:hover {
  background: var(--c-hover);
}
.community-card.is-selected {
  background: var(--c-hover);
  box-shadow: none;
  outline: 0;
}
.community-card > * {
  grid-column: 2;
  min-width: 0;
}
.community-card > .card-top,
.community-card > .card-top > .author {
  display: contents;
}
.community-card > .card-top > .author > .avatar,
.community-card > .card-top > .author > :first-child:not(div) {
  grid-column: 1;
  grid-row: 1 / span 40;
  width: 40px;
  height: 40px;
  margin: 0;
  align-self: start;
}
.community-card > .card-top > .author > div {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 4px;
  min-width: 0;
  padding-right: 36px;
  line-height: 1.3;
}
.author-name {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--c-text);
}
.author-name::after,
.comment .author > div > strong::after {
  content: '·';
  margin-left: 0;
  font-weight: 400;
  color: var(--c-text-2);
}
.author-profile-link {
  color: var(--c-text);
  font-weight: 700;
  text-decoration: none;
}
.author-profile-link:hover {
  text-decoration: underline;
}
.author-meta {
  min-width: 0;
  font-size: 15px;
  font-weight: 400;
  color: var(--c-text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.author-meta a,
.comment-time-link {
  color: var(--c-text-2);
  text-decoration: none;
}
.author-meta a:hover,
.comment-time-link:hover {
  text-decoration: underline;
}
.edited-mark {
  color: var(--c-text-3);
}
/* Badges: Admin is a quiet chip; karma shows on hover, never at zero. */
.admin-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--c-accent-soft);
  color: var(--c-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  border: 0;
}
.karma-badge {
  display: none;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--c-surface-3);
  color: var(--c-text-2);
  font-size: 11px;
  font-weight: 600;
  border: 0;
}
.author-name:hover .karma-badge,
.author > div > strong:hover .karma-badge,
.thread-post .karma-badge,
.profile-header .karma-badge {
  display: inline-flex;
}
.karma-badge.is-zero {
  display: none !important;
}
.implemented-crown {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 18px;
  padding: 0 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #b8860b;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.implemented-crown:hover {
  background: rgba(201, 162, 39, 0.14);
}

/* Overflow (⋯) */
.community-card > .card-top > .post-overflow {
  position: absolute;
  top: 6px;
  right: 8px;
  grid-column: auto;
}
.post-overflow {
  position: relative;
}
.post-overflow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--c-text-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.post-overflow-btn:hover,
.post-overflow.is-open .post-overflow-btn {
  background: var(--c-accent-soft);
  color: var(--c-accent);
}
.post-overflow-menu {
  position: absolute;
  top: 4px;
  right: 0;
  z-index: 40;
  min-width: 220px;
  padding: 6px 0;
  border: 0;
  border-radius: 12px;
  background: var(--c-surface);
  box-shadow: var(--c-shadow-pop);
}
.post-overflow-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--c-text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.post-overflow-item:hover,
.post-overflow-item:focus-visible {
  background: var(--c-hover);
  outline: 0;
}
.post-overflow-item svg {
  width: 18px;
  height: 18px;
  color: var(--c-text-2);
}
.post-overflow-item.is-danger,
.post-overflow-item.is-danger svg {
  color: var(--c-danger);
}

/* Title, body, status */
.card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 2px 0 2px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.005em;
  color: var(--c-text);
}
.card-title-link {
  color: inherit;
  text-decoration: none;
}
.card-title-link:hover {
  text-decoration: underline;
}
.card-body {
  margin: 0 0 2px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--c-text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.comment-mention {
  color: var(--c-accent);
  font-weight: 500;
}
.feature-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.feature-status-symbol {
  font-size: 11px;
}
.feature-status-new {
  background: var(--c-surface-3);
  color: var(--c-text-2);
}
.feature-status-review {
  background: rgba(234, 179, 8, 0.16);
  color: #a16207;
}
.feature-status-progress {
  background: rgba(59, 130, 246, 0.14);
  color: #1d6fd8;
}
.feature-status-done,
.feature-status-already {
  background: var(--c-up-soft);
  color: var(--c-up);
}
[data-theme='dark'] .feature-status-review {
    color: #facc15;
  }
[data-theme='dark'] .feature-status-progress {
    color: #60a5fa;
  }
.status-select {
  height: 26px;
  padding: 0 24px 0 10px;
  border: 1px solid var(--c-line-strong);
  border-radius: 999px;
  background-color: var(--c-surface);
  color: var(--c-text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
}

/* Media grid: 1, 2, 3 or 4+ tiles, rounded like a single image */
.card-images {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  margin: 10px 0 2px;
  border: 1px solid var(--c-line);
  border-radius: var(--c-radius);
  overflow: hidden;
  background: var(--c-line);
  max-width: 100%;
}
.card-images > a,
.card-images > .card-video {
  display: block;
  min-height: 0;
  background: var(--c-surface-2);
  border-radius: 0;
  overflow: hidden;
}
.card-images img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: cover;
  border: 0;
  border-radius: 0;
}
.card-images > :only-child img {
  max-height: 520px;
  object-fit: cover;
  aspect-ratio: auto;
}
.community-card .card-images img {
  height: auto;
  object-fit: cover;
  background: var(--c-surface-2);
}
.community-card .card-images:has(> a:only-child) img {
  max-height: 520px;
  object-fit: cover;
}
.community-card .card-images:has(> a:nth-child(2)) {
  grid-template-columns: 1fr 1fr;
}
.community-card .card-images:has(> a:nth-child(2)) img {
  aspect-ratio: 4 / 3;
  height: 100%;
  max-height: 300px;
  object-fit: cover;
}
.community-card .card-images:has(> a:nth-child(3):last-child) > a:first-child {
  grid-row: span 2;
}
.community-card .card-images:has(> a:nth-child(3):last-child) > a:first-child img {
  aspect-ratio: auto;
  height: 100%;
  max-height: none;
}
.community-card .card-images:has(> a:nth-child(3):last-child) > a:not(:first-child) img {
  aspect-ratio: 4 / 3;
}
.community-card .card-images:has(> a:nth-child(4)) img {
  aspect-ratio: 16 / 10;
  max-height: 220px;
}
.community-card .card-images:has(.card-video) {
  background: var(--c-line);
  gap: 2px;
}
.community-card .card-video {
  grid-column: 1 / -1;
  border-radius: 0;
}
.card-video video {
  display: block;
  width: 100%;
  max-height: 520px;
  background: #000;
  border: 0;
  border-radius: 0;
}
.comment-images {
  max-width: 420px;
}

/* Action bar: reply · upvote · share · more */
.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 440px;
  margin: 4px 0 0 -8px;
  padding: 0;
  border: 0;
  background: none;
}
.card-actions .pill,
.act {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 0 8px 0 4px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--c-text-2);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  transition: color 0.15s ease;
}
.act-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0 -4px 0 0;
  border-radius: 999px;
  transition: background-color 0.15s ease;
}
.act-icon svg {
  width: 18.5px;
  height: 18.5px;
}
.act-count:empty {
  display: none;
}
.act-reply:hover,
.act-share:hover {
  color: var(--c-accent);
}
.act-reply:hover .act-icon,
.act-share:hover .act-icon {
  background: var(--c-accent-soft);
}
.act-vote:hover,
.act-vote.active,
.card-actions .pill.active {
  color: var(--c-up);
  background: transparent;
  border: 0;
}
.act-vote:hover .act-icon {
  background: var(--c-up-soft);
}
.act-vote.active .act-icon svg {
  fill: currentColor;
}
.act-vote.is-bumped .act-icon {
  animation: c-pop 0.32s ease;
}
@keyframes c-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.28); }
  100% { transform: scale(1); }
}

/* Reply composer: one line until focused */
.card-reply-composer {
  margin: 4px 0 8px;
  padding: 0;
  border: 0;
  background: none;
}
.card-reply-composer .comment-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}
.card-reply-composer .mention-composer {
  flex: 1 1 100%;
  min-width: 0;
}
.card-reply-composer textarea,
.reply-form textarea,
.comment-edit-form textarea {
  display: block;
  width: 100%;
  min-height: 38px;
  height: 38px;
  max-height: 240px;
  padding: 8px 14px;
  border: 1px solid var(--c-line);
  border-radius: 20px;
  background: var(--c-surface-2);
  color: var(--c-text);
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  resize: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, background-color 0.15s ease, min-height 0.15s ease;
}
.card-reply-composer textarea::placeholder {
  color: var(--c-text-2);
}
.card-reply-composer textarea:focus,
.reply-form textarea:focus,
.comment-edit-form textarea:focus {
  height: auto;
  min-height: 84px;
  border-color: var(--c-accent);
  background: var(--c-surface);
  border-radius: 14px;
  outline: none;
  box-shadow: 0 0 0 1px var(--c-accent);
}
.card-reply-composer:has(textarea:not(:placeholder-shown)) textarea {
  height: auto;
  min-height: 84px;
  border-radius: 14px;
}
.card-reply-composer .comment-image-chip,
.card-reply-composer .comment-form > .btn,
.card-reply-composer .inline-image-preview-grid:empty {
  display: none;
}
.card-reply-composer:focus-within .comment-image-chip,
.card-reply-composer:has(textarea:not(:placeholder-shown)) .comment-image-chip,
.card-reply-composer:has(.inline-image-preview-grid:not(:empty)) .comment-image-chip {
  display: inline-flex;
}
.card-reply-composer:focus-within .comment-form > .btn,
.card-reply-composer:has(textarea:not(:placeholder-shown)) .comment-form > .btn,
.card-reply-composer:has(.inline-image-preview-grid:not(:empty)) .comment-form > .btn {
  display: inline-flex;
  margin-left: auto;
}
.comment-image-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--c-accent);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.comment-image-chip:hover {
  background: var(--c-accent-soft);
}
.comment-image-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ── Comments (threaded, avatar column) ───────────────────────────── */
.comments {
  margin: 4px 0 0;
  padding: 0;
  border: 0;
}
.comments:empty {
  display: none;
}
.comment {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 10px;
  margin: 0;
  padding: 8px 0 0;
  border: 0;
  background: transparent;
  cursor: auto;
}
.comment > * {
  grid-column: 2;
  min-width: 0;
}
.comment > .author {
  display: contents;
}
.comment > .author > :first-child:not(div) {
  grid-column: 1;
  grid-row: 1 / span 40;
  width: 32px;
  height: 32px;
  margin: 0;
}
.comment > .author > div {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 4px;
  min-width: 0;
  font-size: 14px;
  line-height: 1.3;
}
.comment > .author > div > strong {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 14px;
  font-weight: 700;
}
.comment .author-meta {
  font-size: 14px;
}
.comment-body {
  margin: 1px 0 0;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--c-text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.comment-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin: 2px 0 0 -8px;
  padding: 0;
}
.comment-tool,
.comment-like-btn,
.comment-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--c-text-2);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.comment-tool:hover,
.comment-sort:hover {
  background: var(--c-accent-soft);
  color: var(--c-accent);
}
.comment-like-btn:hover,
.comment-like-btn.is-liked,
.comment-like-btn.active {
  color: var(--c-like);
}
.comment-like-btn:hover {
  background: var(--c-like-soft);
}
.comment-replies {
  grid-column: 2;
  margin: 0;
  padding: 0;
  border: 0;
}
.comment-reply {
  padding-top: 8px;
}
.comment.is-highlight {
  margin: 4px -8px 0;
  padding: 8px 8px 4px;
  border-radius: 12px;
  background: var(--c-accent-soft);
}
.comment.is-credited > .comment-body {
  border-left: 3px solid var(--c-up);
  padding-left: 8px;
}
.comment.is-pending {
  opacity: 0.6;
}
.more-thread {
  display: inline-block;
  margin: 6px 0 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-accent);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.more-thread:hover {
  text-decoration: underline;
}
.comments-heading {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 2px;
}
.comment-inline-slot:empty {
  display: none;
}
.comment-inline-slot {
  margin: 6px 0 2px;
}
.reply-form,
.comment-edit-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.reply-form .mention-composer,
.comment-edit-form textarea {
  flex: 1 1 100%;
}

/* ── Feature request call-to-action in the feed ──────────────────── */
.feature-cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 16px;
  border: 0;
  border-bottom: 1px solid var(--c-line);
  border-radius: 0;
  background: linear-gradient(135deg, var(--c-accent-soft), transparent 75%);
  box-shadow: none;
}
.feature-cta-card h2 {
  margin: 0 0 2px;
  font-size: 17px;
  font-weight: 800;
  color: var(--c-text);
}
.feature-cta-card p {
  margin: 0;
  font-size: 14px;
  color: var(--c-text-2);
}
.feature-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-line);
  font-size: 15px;
  color: var(--c-text-2);
}
.feature-filter-head[hidden] {
  display: none;
}
.feature-filter-head strong {
  color: var(--c-text);
}

/* ── Empty / loading / end states ─────────────────────────────────── */
.feed-empty {
  padding: 48px 32px;
  text-align: center;
}
.feed-empty-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  color: var(--c-text);
}
.feed-empty-text {
  margin: 0 auto 18px;
  max-width: 340px;
  font-size: 15px;
  color: var(--c-text-2);
}
.community-feed-more {
  padding: 0;
}
.feed-more-skeleton {
  display: block;
}
.feed-skeleton-card {
  height: 112px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--c-line);
  border-radius: 0;
  background:
    radial-gradient(circle 20px at 36px 32px, var(--c-surface-3) 98%, transparent) no-repeat,
    linear-gradient(var(--c-surface-3), var(--c-surface-3)) 68px 18px / 34% 12px no-repeat,
    linear-gradient(var(--c-surface-3), var(--c-surface-3)) 68px 42px / 72% 12px no-repeat,
    linear-gradient(var(--c-surface-3), var(--c-surface-3)) 68px 64px / 56% 12px no-repeat,
    var(--c-surface);
  animation: c-shimmer 1.4s ease-in-out infinite;
}
@keyframes c-shimmer {
  50% { opacity: 0.55; }
}
.feed-more-spinner {
  padding: 8px 16px 16px;
  font-size: 14px;
  color: var(--c-text-2);
  text-align: center;
}
.feed-more-end {
  margin: 0;
  padding: 28px 16px 36px;
  font-size: 14px;
  color: var(--c-text-3);
  text-align: center;
}
.feed-more-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 16px;
  font-size: 14px;
  color: var(--c-text-2);
}
.new-posts-pill {
  position: sticky;
  top: calc(var(--c-topbar-h) + 112px);
  z-index: 25;
  display: flex;
  justify-content: center;
  height: 0;
  overflow: visible;
}
.new-posts-pill button {
  margin-top: 10px;
  min-height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--c-accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.18);
  cursor: pointer;
}
.new-posts-pill[hidden] {
  display: none;
}

/* Server pagination stays for crawlers; the feed loads more by itself. */
.community-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 16px;
  font-size: 14px;
}
.community-pagination a,
.community-pagination span {
  min-width: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  text-align: center;
  color: var(--c-text-2);
  text-decoration: none;
}
.community-pagination a:hover {
  background: var(--c-hover);
}
.community-pagination [aria-current='page'] {
  background: var(--c-accent-soft);
  color: var(--c-accent);
  font-weight: 700;
}

/* ── Profile header ───────────────────────────────────────────────── */
.profile-header {
  border-bottom: 1px solid var(--c-line);
}
.profile-cover {
  height: 132px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(44, 122, 123, 0.55), transparent 60%),
    radial-gradient(120% 140% at 100% 0%, rgba(59, 130, 246, 0.35), transparent 60%),
    linear-gradient(135deg, #0f3b3c, #1b5b5c);
}
.profile-head-main {
  padding: 0 16px 14px;
}
.profile-head-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: -44px;
  margin-bottom: 10px;
}
.profile-head-top .avatar {
  width: 92px;
  height: 92px;
  flex: 0 0 92px;
  border: 4px solid var(--c-surface);
  font-size: 34px;
  box-sizing: content-box;
}
.profile-head-name {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--c-text);
}
.profile-head-sub {
  margin: 2px 0 10px;
  font-size: 15px;
  color: var(--c-text-2);
}
.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 14px;
  color: var(--c-text-2);
}
.profile-stats strong {
  color: var(--c-text);
  font-weight: 700;
}
.profile-tabs {
  display: flex;
  border-top: 1px solid var(--c-line);
}
.profile-tabs .feed-tab {
  flex: 1 1 0;
}

/* ── Thread view: wide panel on desktop, full page on phones ─────── */
.thread-modal {
  display: none;
}
.thread-modal.is-open,
body.thread-modal-open .thread-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 36px 16px;
}
.thread-modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--c-backdrop);
  cursor: default;
}
.thread-modal-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(680px, 100%);
  height: auto;
  max-height: calc(100vh - 72px);
  max-height: calc(100dvh - 72px);
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: var(--c-radius);
  background: var(--c-surface);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  overflow: hidden;
  animation: c-rise 0.18s ease-out;
}
@keyframes c-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.thread-modal-head {
  position: relative;
  flex: 0 0 auto;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 53px;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid var(--c-line);
  border-radius: var(--c-radius) var(--c-radius) 0 0;
  background: color-mix(in srgb, var(--c-surface) 90%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.thread-close,
#thread-panel-back,
.thread-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--c-text);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.thread-close {
  width: 36px;
  padding: 0;
  font-size: 22px;
  font-weight: 400;
}
.thread-close:hover,
#thread-panel-back:hover,
.thread-copy:hover {
  background: var(--c-press);
}
.thread-copy {
  margin-left: auto;
  color: var(--c-accent);
  font-weight: 600;
}
.thread-modal-body {
  flex: 1 1 auto;
  max-height: none;
  padding: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.thread-modal-body > .community-card,
.thread-post {
  border-bottom: 0;
  cursor: auto;
  padding: 14px 16px 12px;
}
.thread-modal-body > .community-card:hover,
.thread-post:hover {
  background: transparent;
}
.thread-post > .card-title,
.thread-modal-body > .community-card > .card-title {
  font-size: 20px;
  line-height: 1.3;
  margin-top: 4px;
}
.thread-post > .card-body,
.thread-modal-body > .community-card > .card-body {
  font-size: 16.5px;
  line-height: 1.5;
}
.thread-post > .comments,
.thread-modal-body > .community-card > .comments {
  margin-top: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--c-line);
}
.thread-reply-composer {
  margin-top: 10px;
}
body.thread-modal-open {
  overflow: hidden;
}

/* ── Dialogs (sign in, post, report, profile) ─────────────────────── */
.modal-backdrop {
  background: var(--c-backdrop);
}
.modal,
.post-modal {
  border: 0;
  border-radius: var(--c-radius);
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}
.modal h2,
.post-modal-head h2 {
  color: var(--c-text);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.modal p,
.file-note,
.post-modal-author span {
  color: var(--c-text-2);
}
.modal input:not([type='file']):not([type='checkbox']):not([type='radio']),
.modal select,
.modal textarea,
#post-title,
#post-body {
  border: 1px solid var(--c-line-strong);
  border-radius: 10px;
  background: var(--c-surface);
  color: var(--c-text);
  font: inherit;
}
.modal input:focus,
.modal select:focus,
.modal textarea:focus,
#post-title:focus,
#post-body:focus {
  border-color: var(--c-accent);
  outline: none;
  box-shadow: 0 0 0 1px var(--c-accent);
}
.composer-inline-host #post-title {
  border: 0;
  border-radius: 0;
  padding: 6px 0;
  font-size: 18px;
  font-weight: 700;
  box-shadow: none;
  background: transparent;
}
.composer-inline-host #post-body {
  border: 0;
  border-radius: 0;
  min-height: 84px;
  padding: 4px 0;
  font-size: 17px;
  box-shadow: none;
  background: transparent;
}
.composer-inline-host .post-modal-author {
  display: none;
}
.composer-inline-host .post-add-box {
  display: none;
}
.post-modal-error {
  margin: 6px 0 0;
  color: var(--c-danger);
  font-size: 14px;
}
.post-modal-error:empty {
  display: none;
}
.post-modal-footer {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--c-line);
}
.post-modal-footer .post-modal-submit {
  margin: 0 0 0 auto;
  width: auto;
  min-width: 86px;
}
.composer-inline-host .post-modal-footer .post-modal-cancel {
  margin-left: auto;
}
.composer-inline-host .post-modal-footer .post-modal-cancel + .post-modal-submit {
  margin-left: 8px;
}
.post-media-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--c-accent);
  cursor: pointer;
}
.post-media-btn:hover {
  background: var(--c-accent-soft);
}
.post-media-btn svg {
  width: 20px;
  height: 20px;
}
.post-media-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.post-draft-note {
  font-size: 12.5px;
  color: var(--c-text-3);
}

/* Confirm dialog + toasts */
.c-dialog-root {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--c-backdrop);
  animation: c-fade 0.12s ease-out;
}
@keyframes c-fade {
  from { opacity: 0; }
}
.c-dialog {
  width: min(320px, 100%);
  padding: 24px;
  border-radius: var(--c-radius);
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
}
.c-dialog h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
}
.c-dialog p {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--c-text-2);
}
.c-dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.c-dialog-actions .btn {
  width: 100%;
  min-height: 44px;
}
.c-dialog-danger {
  background: var(--c-danger);
  border-color: var(--c-danger);
  color: #fff;
}
.c-dialog-danger:hover {
  filter: brightness(0.94);
}
.posting-indicator {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 2500;
  transform: translateX(-50%);
  pointer-events: none;
}
.posting-indicator-progress {
  display: none;
}
.posting-indicator-toast {
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--c-accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.22);
  white-space: nowrap;
}
.posting-indicator.is-error .posting-indicator-toast {
  background: var(--c-danger);
}
.posting-indicator.is-visible {
  animation: c-toast 0.2s ease-out;
}
@keyframes c-toast {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Mobile tab bar + compose button: hidden on desktop */
.mobile-tabbar,
.compose-fab {
  display: none;
}

/* ── Narrow desktop: compact left rail ────────────────────────────── */
@media (max-width: 1240px) {
  .community-shell {
    grid-template-columns: 88px minmax(0, 600px) 330px;
    column-gap: 20px;
  }
  .community-sidebar {
    align-items: flex-end;
  }
  .community-sidebar .sidebar-title,
  .community-sidebar .sidebar-text,
  .community-sidebar .seo-summary,
  .rail-label,
  .rail-account-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .community-sidebar .tab-btn,
  .rail-link {
    width: 52px;
    height: 52px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }
  .rail-post-btn {
    width: 52px;
    min-height: 52px;
    margin: 12px 0 6px;
    padding: 0;
  }
  .rail-post-btn .rail-label {
    display: none;
  }
  .rail-post-btn .rail-icon {
    display: block;
    margin: 0 auto;
  }
  .rail-account {
    margin: 8px 0 0;
    padding: 6px;
  }
}
@media (max-width: 1060px) {
  .community-shell {
    grid-template-columns: 88px minmax(0, 600px);
  }
  .community-right-rail {
    display: none;
  }
  .feed-search-toggle {
    display: inline-flex;
  }
}

/* ── Phones and small tablets ─────────────────────────────────────── */
@media (max-width: 820px) {
  :root {
    --c-topbar-h: 45px;
  }
  .community-shell {
    display: block;
    padding: 0;
    width: 100%;
  }
  .community-sidebar {
    display: none;
  }
  .community-main {
    min-height: 100vh;
    border: 0;
    padding-bottom: calc(var(--c-tabbar-h) + 72px + env(safe-area-inset-bottom));
  }
  .feed-header-row {
    min-height: 48px;
  }
  .feed-header .community-page-title {
    font-size: 18px;
  }
  .signin-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--c-line);
    background: var(--c-accent-soft);
    font-size: 14px;
    line-height: 1.35;
    color: var(--c-text);
  }
  .signin-banner p {
    flex: 1 1 auto;
    margin: 0;
  }
  .signin-banner .btn {
    flex: 0 0 auto;
    min-height: 34px;
    font-size: 14px;
  }
  body.is-signed-in .signin-banner {
    display: none;
  }
  .composer.post-launcher {
    display: none !important;
  }
  .community-card {
    padding: 12px 14px 4px;
    column-gap: 10px;
  }
  .card-actions {
    max-width: none;
  }
  .author-meta {
    font-size: 14.5px;
  }
  .card-images:has(> :nth-child(2)) img {
    max-height: 190px;
  }

  .mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    display: flex;
    height: calc(var(--c-tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--c-line);
    background: color-mix(in srgb, var(--c-surface) 92%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
  }
  .mobile-tab {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 0;
    background: transparent;
    color: var(--c-text-2);
    font: inherit;
    font-size: 10.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
  }
  .mobile-tab svg {
    width: 24px;
    height: 24px;
  }
  .mobile-tab.is-active {
    color: var(--c-text);
  }
  .mobile-tab .avatar {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }
  .compose-fab {
    position: fixed;
    right: 16px;
    bottom: calc(var(--c-tabbar-h) + 16px + env(safe-area-inset-bottom));
    z-index: 901;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 999px;
    background: var(--c-accent);
    color: var(--c-on-accent);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
    cursor: pointer;
    transition: transform 0.15s ease;
  }
  .compose-fab:active {
    transform: scale(0.94);
  }
  .compose-fab svg {
    width: 26px;
    height: 26px;
  }
  body.thread-modal-open .mobile-tabbar,
  body.thread-modal-open .compose-fab {
    display: none;
  }

  /* Thread becomes a full page with a back header and a docked reply box */
  .thread-modal.is-open,
  body.thread-modal-open .thread-modal {
    padding: 0;
    overflow: hidden;
    z-index: 30001;
  }
  .thread-modal-backdrop {
    display: none;
  }
  .thread-modal-dialog {
    width: 100%;
    height: 100%;
    max-height: none !important;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    animation: c-slide 0.2s ease-out;
  }
  @keyframes c-slide {
    from { transform: translateX(24px); opacity: 0; }
    to { transform: none; opacity: 1; }
  }
  .thread-modal-head {
    position: relative;
    top: 0;
    flex: 0 0 auto;
    border-radius: 0;
  }
  .thread-close {
    display: none;
  }
  #thread-panel-back {
    padding: 0 10px 0 6px;
  }
  #thread-panel-back::before {
    content: '';
    width: 20px;
    height: 20px;
    margin-right: 2px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M12 19l-7-7 7-7'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M12 19l-7-7 7-7'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  .thread-modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 76px;
  }
  .thread-reply-composer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    margin: 0;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--c-line);
    background: var(--c-surface);
  }

  /* Dialogs slide up as sheets */
  .modal-backdrop.visible {
    align-items: flex-end;
  }
  .modal-backdrop .modal,
  .modal-backdrop .post-modal {
    width: 100%;
    max-width: none;
    max-height: 92vh;
    margin: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: var(--c-shadow-sheet);
    animation: c-sheet 0.22s ease-out;
    padding-bottom: env(safe-area-inset-bottom);
    overflow-y: auto;
  }
  @keyframes c-sheet {
    from { transform: translateY(40px); opacity: 0.4; }
    to { transform: none; opacity: 1; }
  }
  .posting-indicator {
    bottom: calc(var(--c-tabbar-h) + 84px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* Feed cards preview two replies; the third stays in the HTML for crawlers. */
.feed > .community-card > .comments > .comment:nth-of-type(n + 3) {
  display: none;
}
.community-card[hidden] {
  display: none !important;
}

/* Account menu under the rail account button */
.community-sidebar {
  position: sticky;
}
.rail-account-menu {
  position: absolute;
  left: 0;
  bottom: 78px;
  top: auto;
  right: auto;
  min-width: 240px;
}
@media (max-width: 1240px) {
  .rail-account-menu {
    left: auto;
    right: 0;
  }
}

.profile-head-actions {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 4px;
}
.profile-head-actions .btn {
  min-height: 34px;
  font-size: 14px;
}
.post-media-btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}
.post-media-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.feature-status-new .feature-status-symbol,
.feature-status-review .feature-status-symbol,
.feature-status-progress .feature-status-symbol {
  display: none;
}
.feature-status-label {
  display: inline !important;
}

.comment-like {
  gap: 4px;
}
.comment-like .comment-like-heart {
  display: inline-flex;
  width: 16px;
  height: 16px;
  font-size: 0;
}
.comment-like .comment-like-heart svg {
  width: 16px;
  height: 16px;
}
.comment-like[aria-pressed='true'] {
  color: var(--c-like);
}
.comment-like .comment-like-count:empty {
  display: none;
}
.comment-like-avatars {
  border: 0;
  background: transparent;
  padding: 0 4px;
  cursor: pointer;
}
.comment-likers {
  border: 0;
  border-radius: 12px;
  background: var(--c-surface);
  box-shadow: var(--c-shadow-pop);
  color: var(--c-text);
}

/* Theme toggle (light by default, dark on request) */
.theme-toggle .theme-icon-sun,
[data-theme='dark'] .theme-toggle .theme-icon-moon {
  display: none;
}
[data-theme='dark'] .theme-toggle .theme-icon-sun {
  display: block;
}
.feed-theme-toggle {
  display: none;
}
@media (max-width: 1060px) {
  .feed-theme-toggle {
    display: inline-flex;
  }
}
