.wrap { width: min(1180px, calc(100% - 48px)); min-width: 0; }
.hero-grid { grid-template-columns: minmax(0, 1.35fr) minmax(290px, .65fr); }
.hero-card, .profile-panel, .forum-card, .viewbar, .post-card, .reply-box {
  border: 1px solid var(--community-line);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.045));
  box-shadow: 0 26px 100px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.09);
  min-width: 0;
}
.hero-card { min-height: 320px; padding: 30px; }
.hero-card h1 { font-size: clamp(36px, 4.6vw, 58px); }
.hero-card .lead { font-size: 16px; }
.profile-panel .avatar { background: transparent; border: 0; box-shadow: none; }
.profile-panel .avatar img { object-fit: contain; border-radius: 0; }
.official-layout { grid-template-columns: minmax(0, 1fr); }
.forum-list, .topics, .post-view { min-width: 0; }
.forum-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 264px;
  gap: 18px;
  align-items: center;
  padding: 20px;
  border-radius: 18px;
}
.forum-card > div { min-width: 0; }
.forum-title { flex-wrap: wrap; }
.forum-title h3 { overflow-wrap: anywhere; }
.count-stack { width: 264px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; }
.count-stack > b, .count-stack > span { grid-column: 1 / -1; }
.count-stack .danger-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  height: 40px;
  margin: 4px 0 0;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.count-stack [data-edit-category] {
  color: #ddd6fe;
  border-color: rgba(196, 181, 253, .22);
  background: rgba(139, 92, 246, .08);
}
.count-stack [data-edit-category]:hover {
  color: #fff;
  border-color: rgba(196, 181, 253, .55);
  background: rgba(139, 92, 246, .18);
}
.count-stack [data-delete-category] {
  color: #fda4af;
  border-color: rgba(251, 113, 133, .22);
  background: rgba(244, 63, 94, .06);
}
.count-stack [data-delete-category]:hover {
  color: #ffe4e6;
  border-color: rgba(251, 113, 133, .55);
  background: rgba(244, 63, 94, .16);
}
.count-stack :is([data-edit-category], [data-delete-category])::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background: currentColor;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}
.count-stack [data-edit-category]::before { mask-image: url('/static/icons/pencil.svg'); }
.count-stack [data-delete-category]::before { mask-image: url('/static/icons/trash-2.svg'); }
.open-hint { color: #c4b5fd; }
.section-head > div { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-width: 0; }
.section-head > div > p { flex-basis: 100%; }
.section-head .btn { flex: none; white-space: nowrap; min-height: 40px; padding: 8px 14px; }
.viewbar { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; padding: 24px; }
.viewbar > div { min-width: 0; }
.viewbar .empty-actions { width: 280px; display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 8px; margin: 0; }
.viewbar .empty-actions > button { width: 100%; white-space: normal; margin: 0; min-height: 38px; justify-content: center; }
.topic-description, .post-text { overflow-wrap: anywhere; }
.topic { border-radius: 18px; background: var(--community-surface); }
.post-head { flex-wrap: wrap; gap: 8px; }
.post-actions { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.post-card { grid-template-columns: 210px minmax(0, 1fr); overflow: hidden; }
.post-body, .post-text { min-width: 0; }
.post-text img, .post-text video { max-width: 100%; height: auto; }
.dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100svh - 32px); overflow-y: auto; border-radius: 26px; background: #101525; }
.dialog .field { min-width: 0; }
.dialog :is(input, select, textarea, .rich-editor) { border-radius: 14px; background-color: rgba(0,0,0,.24); }
.dialog select:disabled { opacity: 1; color: #c4b5fd; }
.dialog .rich-editor { min-height: 160px; }
.editor-toolbar { flex-wrap: wrap; }
.modal .admin-note { font-size: 12px; }
.dialog .form-actions { display: flex; justify-content: flex-end; gap: 10px; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .profile-panel { display: none; }
  .post-card { grid-template-columns: 170px minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .hero { padding-top: 24px; }
  .hero-card { padding: 22px; min-height: 0; }
  .forum-card { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 16px; }
  .count-stack { grid-column: 1 / -1; width: min(100%, 264px); text-align: left; }
  .count-stack > b, .count-stack > span { grid-column: 1 / -1; }
  .count-stack .open-hint { display: none; }
  .viewbar { grid-template-columns: 1fr; padding: 18px; }
  .viewbar .empty-actions { width: 100%; grid-template-columns: 1fr 1fr; }
  .post-card { grid-template-columns: 1fr; }
  .post-actions { justify-content: flex-start; }
  .dialog { padding: 16px; }
}
