/* Земельный Практикум — компактный единый блок «Сообщество» v3.
   Внешние размеры .home-community-kpi не меняются. */

body[data-role="student"][data-active="home"] .home-community-kpi {
  --hc-surface: rgba(255, 255, 255, 0.74);
  --hc-surface-strong: rgba(255, 255, 255, 0.92);
  --hc-border: rgba(47, 99, 63, 0.16);
  --hc-ink: #18221c;
  --hc-muted: #727981;
  --hc-green: #2f8a42;
  --hc-green-soft: rgba(47, 138, 66, 0.10);
  --hc-blue: #2f79c7;
  --hc-blue-soft: rgba(47, 121, 199, 0.10);
  --hc-divider: rgba(36, 58, 44, 0.12);
  overflow: hidden;
}

body[data-theme="dark"][data-role="student"][data-active="home"] .home-community-kpi {
  --hc-surface: rgba(8, 21, 15, 0.58);
  --hc-surface-strong: rgba(8, 20, 14, 0.78);
  --hc-border: rgba(91, 148, 107, 0.24);
  --hc-ink: #f1f6f3;
  --hc-muted: rgba(220, 231, 224, 0.70);
  --hc-green: #74dc80;
  --hc-green-soft: rgba(72, 168, 87, 0.18);
  --hc-blue: #55a9ff;
  --hc-blue-soft: rgba(38, 112, 192, 0.20);
  --hc-divider: rgba(130, 166, 141, 0.20);
}

body[data-role="student"][data-active="home"] .home-community-kpi .home-community-head {
  margin-bottom: 0 !important;
}

body[data-role="student"][data-active="home"] .home-community-kpi .home-community-head .link-btn {
  white-space: nowrap;
}

body[data-role="student"][data-active="home"] .home-community-compact-subtitle {
  margin: -2px 0 2px !important;
  color: var(--hc-muted) !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}

body[data-role="student"][data-active="home"] .home-community-compact-list {
  display: grid;
  gap: 9px;
  min-width: 0;
}

body[data-role="student"][data-active="home"] .home-community-topic-compact {
  position: relative;
  min-width: 0;
  padding: 11px 11px 9px;
  border: 1px solid var(--hc-border);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--hc-surface-strong), var(--hc-surface));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

body[data-theme="dark"][data-role="student"][data-active="home"] .home-community-topic-compact {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

body[data-role="student"][data-active="home"] .home-community-topic-open-compact {
  width: 100%;
  display: block;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

body[data-role="student"][data-active="home"] .home-community-topic-top-compact {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
}

body[data-role="student"][data-active="home"] .home-community-topic-avatar-compact {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--hc-green);
  border-radius: 50%;
  background: var(--hc-green-soft);
  color: var(--hc-green) !important;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

body[data-role="student"][data-active="home"] .home-community-topic-copy-compact {
  min-width: 0;
}

body[data-role="student"][data-active="home"] .home-community-topic-author-compact {
  display: block;
  margin: 0 0 2px;
  overflow: hidden;
  color: var(--hc-ink) !important;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-role="student"][data-active="home"] .home-community-topic-meta-compact {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: var(--hc-muted) !important;
  font-size: 10.5px;
  line-height: 1.2;
}

body[data-role="student"][data-active="home"] .home-community-topic-meta-compact span {
  overflow: hidden;
  color: inherit !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-role="student"][data-active="home"] .home-community-topic-meta-compact span + span::before {
  content: "•";
  margin-right: 6px;
  opacity: 0.55;
}

body[data-role="student"][data-active="home"] .home-community-topic-tag-compact {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 92px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

body[data-role="student"][data-active="home"] .home-community-topic-tag-compact.is-question {
  border: 1px solid color-mix(in srgb, var(--hc-green) 35%, transparent);
  background: var(--hc-green-soft);
  color: var(--hc-green) !important;
}

body[data-role="student"][data-active="home"] .home-community-topic-tag-compact.is-discussion {
  border: 1px solid color-mix(in srgb, var(--hc-blue) 35%, transparent);
  background: var(--hc-blue-soft);
  color: var(--hc-blue) !important;
}

body[data-role="student"][data-active="home"] .home-community-topic-title-compact {
  margin: 8px 0 0 !important;
  display: -webkit-box;
  overflow: hidden;
  color: var(--hc-ink) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.27 !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body[data-role="student"][data-active="home"] .home-community-topic-excerpt-compact {
  margin: 5px 0 0 !important;
  overflow: hidden;
  color: var(--hc-muted) !important;
  font-size: 10.5px !important;
  line-height: 1.3 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-role="student"][data-active="home"] .home-community-topic-footer-compact {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--hc-divider);
}

body[data-role="student"][data-active="home"] .home-community-topic-footer-compact .home-community-topic-heart,
body[data-role="student"][data-active="home"] .home-community-topic-footer-compact .home-community-topic-replies {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--hc-muted) !important;
  font-size: 10.5px;
  line-height: 1;
}

body[data-role="student"][data-active="home"] .home-community-topic-footer-compact .home-community-topic-heart:hover,
body[data-role="student"][data-active="home"] .home-community-topic-footer-compact .home-community-topic-heart:focus-visible,
body[data-role="student"][data-active="home"] .home-community-topic-footer-compact .home-community-topic-heart.is-active {
  color: #e54f72 !important;
}

body[data-role="student"][data-active="home"] .home-community-topic-mentor-compact {
  margin-left: auto;
  color: var(--hc-green) !important;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  body[data-role="student"][data-active="home"] .home-community-topic-top-compact {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  body[data-role="student"][data-active="home"] .home-community-topic-avatar-compact {
    width: 34px;
    height: 34px;
  }

  body[data-role="student"][data-active="home"] .home-community-topic-tag-compact {
    grid-column: 2;
    justify-self: start;
    margin-top: 4px;
  }
}
