.community-page .site-footer,
.community-cta {
  position: relative;
  z-index: 10;
}
.community-page .site-header [aria-current='page'] {
  color: var(--color-primary);
}
.community-section {
  padding: 78px 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.community-section .eyebrow {
  margin-bottom: 10px;
  color: var(--color-primary);
}
.community-section h2 {
  max-width: none;
  font-size: clamp(27.6px, 3.04vw, 43px);
}
.section-intro {
  margin: 10px 0 30px;
  font-size: var(--text-lead);
}
.community-hero {
  overflow: hidden;
  background:
    radial-gradient(circle at 94% 15%, rgba(229, 31, 43, 0.07), transparent 29%),
    var(--color-surface);
}
.community-hero-grid {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 70px;
  align-items: center;
}
.community-hero h1 {
  font-size: clamp(35.8px, 3.84vw, 55.8px);
}
.community-hero-copy > p:not(.eyebrow) {
  max-width: 530px;
  margin: 17px 0 23px;
  font-size: var(--text-lead);
}
.community-hero .button.secondary {
  color: var(--color-ink);
  background: var(--color-surface);
  border-color: var(--color-border);
}
.community-scene {
  position: relative;
  min-height: 365px;
  padding: 35px 105px;
}
.bot-card,
.platform-float {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}
.bot-card {
  position: relative;
  z-index: 2;
  padding: 21px;
}
.bot-card header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
}
.bot-card header span {
  flex: 1;
}
.bot-card header b,
.bot-card header small {
  display: block;
}
.bot-card header b {
  font-size: var(--text-ui);
}
.bot-card header b i {
  padding: 2px 4px;
  color: #fff;
  background: #6879e9;
  border-radius: 3px;
  font-size: 9px;
  font-style: normal;
}
.bot-card header small,
.bot-card > p {
  color: var(--color-text-muted);
  font-size: var(--text-small);
}
.bot-card > strong {
  font-size: var(--text-ui);
}
.bot-card > p {
  margin: 3px 0 12px;
}
.bot-card code {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  color: var(--color-text-muted);
  background: var(--color-surface-soft);
  border-radius: 7px;
  font-size: var(--text-small);
}
.bot-success {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 11px;
  background: #e5f7ef;
  border-radius: 7px;
}
.bot-success i {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #17a877;
  border-radius: 50%;
  font-style: normal;
}
.bot-success b,
.bot-success small {
  display: block;
}
.bot-success b {
  font-size: var(--text-ui);
}
.bot-success small {
  color: #5e746a;
  font-size: var(--text-small);
}
.platform-float {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  font-size: var(--text-ui);
}
.discord-float {
  left: 0;
  top: 80px;
  transform: rotate(-4deg);
}
.telegram-float {
  right: 0;
  bottom: 65px;
  transform: rotate(4deg);
}
.community-note {
  position: absolute;
  right: 0;
  top: 20px;
  color: #8e7775;
  font: italic 1rem/1.1 var(--font-display);
  transform: rotate(-7deg);
}
.community-note span {
  display: block;
  color: var(--color-primary);
  font-size: 1.4rem;
}
.community-assurances {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 40px;
}
.community-assurances > div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.community-assurances i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  border-radius: 50%;
  font-style: normal;
}
.community-assurances b,
.community-assurances small {
  display: block;
}
.community-assurances b {
  font-size: var(--text-ui);
}
.community-assurances small {
  color: var(--color-text-muted);
  font-size: var(--text-small);
}
.community-flow-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}
.community-flow-grid > span {
  color: var(--color-primary);
  font-size: 1.35rem;
}
.community-flow-grid article {
  min-height: 175px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 9px;
  padding: 18px;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.community-flow-grid .active {
  border-color: rgba(229, 31, 43, 0.35);
  box-shadow: 0 14px 36px rgba(229, 31, 43, 0.07);
}
.community-flow-grid i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-weight: 700;
}
.community-flow-grid .active i {
  color: #fff;
  background: var(--color-primary);
  border-radius: 7px;
}
.community-flow-grid b {
  font-size: var(--text-ui);
}
.community-flow-grid small {
  color: var(--color-text-muted);
  font-size: var(--text-small);
}
.community-platforms {
  background: var(--color-surface-warm);
}
.platform-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.platform-grid article {
  min-height: 415px;
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.platform-heading {
  display: flex;
  align-items: center;
  gap: 15px;
}
.platform-heading h3 {
  font-size: 25px;
}
.platform-heading p {
  margin: 4px 0 0;
  font-size: var(--text-body);
}
.command-preview {
  margin: 24px 0;
  padding: 15px;
  background: var(--color-surface-soft);
  border-radius: 8px;
}
.command-preview code {
  display: block;
  padding: 9px;
  color: var(--color-ink);
  background: var(--color-surface);
  border-radius: 5px;
  font-size: var(--text-small);
}
.command-preview p {
  margin: 12px 0 0;
}
.command-preview b,
.command-preview small {
  display: block;
}
.command-preview b {
  font-size: var(--text-ui);
}
.command-preview small {
  color: var(--color-text-muted);
  font-size: var(--text-small);
}
.platform-grid ul {
  display: grid;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}
.platform-grid li {
  position: relative;
  padding-left: 19px;
  color: var(--color-text-muted);
  font-size: var(--text-body);
}
.platform-grid li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #17a877;
}
.platform-grid a {
  margin-top: auto;
  color: var(--color-primary);
  font-size: var(--text-ui);
  font-weight: 700;
}
.automation-heading {
  max-width: 780px;
}
.automation-heading > p:last-child {
  font-size: var(--text-lead);
}
.automation-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 30px;
}
.automation-grid article {
  min-height: 205px;
  padding: 22px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.automation-grid i {
  display: block;
  margin-bottom: 20px;
  color: var(--color-primary);
  font-style: normal;
  font-size: 1.7rem;
}
.automation-grid h3 {
  font-size: 20px;
}
.automation-grid p {
  font-size: var(--text-body);
}
.community-boundary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}
.community-boundary > div {
  padding: 25px;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.community-boundary h3 {
  font-size: 23px;
}
.community-boundary ul {
  display: grid;
  gap: 8px;
  margin: 17px 0 0;
  padding: 0;
  list-style: none;
}
.community-boundary li {
  position: relative;
  padding-left: 20px;
  color: var(--color-text-muted);
  font-size: var(--text-body);
}
.community-boundary li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-primary);
}
.setup-grid,
.faq-grid {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 65px;
}
.setup-grid > div > p:not(.eyebrow) {
  font-size: var(--text-body);
}
.setup-grid .button {
  margin-top: 15px;
}
.setup-grid ol {
  margin: 0;
  padding: 12px 22px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  list-style: none;
}
.setup-grid li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
}
.setup-grid li + li {
  border-top: 1px solid var(--color-border);
}
.setup-grid li > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  color: var(--color-primary);
  background: var(--color-surface-soft);
  border-radius: 50%;
  font-weight: 700;
}
.setup-grid li p {
  margin: 0;
}
.setup-grid li b,
.setup-grid li small {
  display: block;
}
.setup-grid li b {
  font-size: var(--text-ui);
}
.setup-grid li small {
  color: var(--color-text-muted);
  font-size: var(--text-small);
}
.community-faq details {
  border-top: 1px solid var(--color-border);
}
.community-faq details:last-child {
  border-bottom: 1px solid var(--color-border);
}
.community-faq summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  font-size: var(--text-ui);
  font-weight: 600;
}
.community-faq summary::-webkit-details-marker {
  display: none;
}
.community-faq details[open] summary span {
  color: var(--color-primary);
  transform: rotate(45deg);
}
.community-faq details p {
  margin: 0;
  padding: 0 50px 17px 0;
  font-size: var(--text-body);
}
.community-cta {
  position: relative;
  z-index: 10;
  padding: 70px 0;
  color: #f5f2ed;
  background: #111213;
}
.community-cta .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 35px;
}
.community-cta .eyebrow {
  color: #f05e64;
}
.community-cta h2 {
  max-width: none;
  color: #f5f2ed;
  font-size: clamp(27.6px, 3.04vw, 43px);
}
.community-cta p:last-child {
  margin-bottom: 0;
  color: #b2ada5;
  font-size: var(--text-body);
}
html[data-theme='dark'] .community-section {
  background: #0e0f10;
}
html[data-theme='dark'] .community-hero {
  background: radial-gradient(circle at 94% 15%, rgba(229, 31, 43, 0.1), transparent 29%), #0e0f10;
}
html[data-theme='dark'] .bot-card,
html[data-theme='dark'] .platform-float,
html[data-theme='dark'] .community-flow-grid article,
html[data-theme='dark'] .platform-grid article,
html[data-theme='dark'] .automation-grid article,
html[data-theme='dark'] .setup-grid ol {
  background: #191a1c;
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: none;
}
html[data-theme='dark'] .bot-card code,
html[data-theme='dark'] .command-preview,
html[data-theme='dark'] .community-boundary > div,
html[data-theme='dark'] .setup-grid li > span {
  background: #222326;
}
html[data-theme='dark'] .bot-success {
  background: rgba(23, 168, 119, 0.13);
}
html[data-theme='dark'] .bot-success small {
  color: #a7c4b8;
}
html[data-theme='dark'] .community-hero .button.secondary {
  color: #f5f2ed;
  background: #1e1f21;
  border-color: rgba(255, 255, 255, 0.14);
}
html[data-theme='dark'] .community-platforms {
  background: #111213;
}
html[data-theme='dark'] .command-preview code {
  background: #292a2d;
}
html[data-theme='dark'] .community-boundary > div {
  border-color: rgba(255, 255, 255, 0.09);
}
html[data-theme='dark'] .community-cta {
  background: #090a0b;
}
/* ==========================================================
   Lighthouse accessibility contrast fixes
   ========================================================== */

/* Red eyebrow on the warm Platforms section */
.community-platforms > .shell > .eyebrow {
  color: var(--color-primary-hover);
}

/*
 * Small white APP badge.
 * Existing #6879e9 does not have enough contrast with white.
 */
.bot-card header b i {
  background: #5361c6;
}

/*
 * Small white success icon.
 * Existing #17a877 is too light behind white.
 */
.bot-success i {
  background: #0d7a56;
}

/* Dark-mode red */
html[data-theme='dark'] .community-platforms > .shell > .eyebrow {
  color: #ec6972;
}
@media (max-width: 1000px) {
  .community-hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .community-scene {
    max-width: 700px;
  }
  .community-flow-grid {
    grid-template-columns: 1fr auto 1fr auto 1fr;
  }
  .automation-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 700px) {
  .community-section {
    padding: 58px 0;
  }
  .community-scene {
    min-height: 440px;
    padding: 55px 15px;
  }
  .discord-float {
    top: 0;
  }
  .telegram-float {
    bottom: 10px;
  }
  .community-note {
    display: none;
  }
  .community-assurances,
  .community-flow-grid,
  .platform-grid,
  .automation-grid,
  .community-boundary,
  .setup-grid,
  .faq-grid {
    grid-template-columns: 1fr;
  }
  .community-flow-grid > span {
    transform: rotate(90deg);
    text-align: center;
  }
  .community-flow-grid article {
    min-height: 140px;
  }
  .platform-grid article {
    min-height: 0;
  }
  .setup-grid,
  .faq-grid {
    gap: 35px;
  }
  .community-cta .shell {
    align-items: flex-start;
    flex-direction: column;
  }
  .community-assurances {
    gap: 18px;
  }
}
