/**
 * HB Community — layout helpers only.
 * Kleuren/typografie/menubalk = zelfde als HB DenkTank (/hb-css-systeem).
 * Enige merkverschil: koperen statusbalk (tijd / batterij / wifi).
 * Facebook-achtige 3-koloms structuur.
 */

.hb-community-body .hb-page {
  padding-top: 1rem;
}

/*
 * Alleen de statusstrook (safe-area boven de menubalk) is koper.
 * Logo, envelop, hamburger en menubalk blijven standaard DenkTank-chrome.
 */
body.hb-community-body .hb-main-nav::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: env(safe-area-inset-top, 0px);
  background: #c4a35a;
  pointer-events: none;
  z-index: 2;
}

/* Welkomst-/loginmuur — zelfde kaarten/typografie als DenkTank */
.hb-community-welcome {
  margin: 2rem auto;
  max-width: 420px;
  padding: 1.75rem 1.5rem;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift, var(--shadow));
  text-align: center;
}

.hb-community-welcome__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font);
}

.hb-community-welcome__title {
  margin: 0 0 0.65rem;
  font-size: 1.45rem;
  color: var(--text-main);
  font-family: var(--font);
}

.hb-community-welcome__text {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  line-height: 1.5;
  font-family: var(--font);
}

.hb-community-welcome__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin: 0;
}

/* Community: install-banner ook tonen op bredere schermen (test / tablet) */
@media (min-width: 901px) {
  body.hb-community-body .hb-pwa-install {
    display: flex !important;
    left: auto;
    right: 20px;
    bottom: 20px;
    width: min(380px, calc(100vw - 40px));
  }
}

/* Geen statusbalk-URL: links zonder href blijven klikbaar */
.hb-community-body a[data-hb-href],
.hb-community-body a[role="link"] {
  cursor: pointer;
}

.hb-community-shell {
  width: min(1180px, calc(100% - 1.5rem));
  margin: 0 auto 2.5rem;
}

.hb-community-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 280px;
  gap: 1rem;
  align-items: start;
}

/* Feed eerst in DOM; op desktop terug in het midden */
.hb-community-col--groups { grid-column: 1; grid-row: 1; }
.hb-community-col--feed { grid-column: 2; grid-row: 1; }
.hb-community-col--people { grid-column: 3; grid-row: 1; }

@media (max-width: 1024px) {
  .hb-community-grid {
    grid-template-columns: 1fr;
  }

  .hb-community-col--groups,
  .hb-community-col--feed,
  .hb-community-col--people {
    grid-column: auto;
    grid-row: auto;
  }
}

.hb-community-col {
  display: grid;
  gap: 0.85rem;
}

.hb-community-col--sticky {
  position: sticky;
  top: 5.5rem;
}

@media (max-width: 1024px) {
  .hb-community-col--sticky {
    position: static;
  }
}

.hb-community-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift, var(--shadow));
  padding: 0.9rem 1rem;
}

.hb-community-box__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.hb-community-box__head h2,
.hb-community-box__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font);
}

.hb-community-box__link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
}

.hb-community-box__link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.hb-community-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.hb-community-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.5rem;
  padding: 0.45rem 0.35rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid transparent;
}

.hb-community-list li:hover {
  background: var(--bg-soft);
  border-color: var(--border-soft);
}

.hb-community-list__meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.hb-community-list__name {
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hb-community-list__sub {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.hb-community-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.hb-community-composer textarea.hb-input {
  min-height: 88px;
  resize: vertical;
  width: 100%;
}

.hb-community-composer__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.65rem;
}

.hb-community-composer__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.hb-community-feed {
  display: grid;
  gap: 0.85rem;
}

.hb-community-post {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift, var(--shadow));
  padding: 0.95rem 1rem;
}

.hb-community-post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.hb-community-post__author {
  font-weight: 700;
  color: var(--text-main);
}

.hb-community-post__time,
.hb-community-post__group {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hb-community-post__group {
  color: var(--accent);
}

.hb-community-post__body {
  margin: 0 0 0.65rem;
  white-space: pre-wrap;
  line-height: 1.5;
  color: var(--text-main);
}

.hb-community-inline-link {
  color: var(--accent, #c4a35a);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
  cursor: pointer;
}

.hb-community-inline-link:hover {
  filter: brightness(1.08);
}

.hb-community-post__media {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.hb-community-post__media img,
.hb-community-post__media video {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--border-soft);
}

.hb-community-post__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-soft);
  align-items: center;
}

.hb-community-post__meta-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.hb-community-post__meta-row .hb-community-post__meta {
  flex: 1;
  min-width: 0;
}

.hb-community-post__edited {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.hb-community-link-preview {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100%;
  max-width: 100%;
  margin: 0 0 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  background: var(--bg-soft, rgba(0, 0, 0, 0.03));
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  cursor: default;
  box-sizing: border-box;
}

.hb-community-link-preview--open {
  cursor: pointer;
}

a.hb-community-link-preview:hover,
.hb-community-link-preview--open:hover,
.hb-community-link-preview--open:active {
  border-color: var(--accent, #c4a35a);
  background: var(--bg-card);
}

.hb-community-link-preview__media {
  display: block !important;
  width: 100%;
  min-height: 140px;
  max-height: 220px;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border-soft);
}

.hb-community-link-preview__media--empty {
  min-height: 0;
  height: 4px;
  aspect-ratio: auto;
  max-height: 4px;
  background: linear-gradient(90deg, var(--accent, #c4a35a), transparent);
  border-bottom: 0;
}

.hb-community-link-preview__body {
  padding: 0.7rem 0.85rem 0.8rem;
  display: grid;
  gap: 0.2rem;
}

.hb-community-link-preview__site {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 700;
}

.hb-community-link-preview__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.hb-community-link-preview__desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hb-community-link-preview__loading,
.hb-community-link-preview__error {
  padding: 0.7rem 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hb-community-link-preview__error {
  color: var(--error);
}

.hb-community-link-preview__dismiss {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 1.7rem;
  height: 1.7rem;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  z-index: 2;
}

.hb-community-link-preview__dismiss:hover {
  background: rgba(0, 0, 0, 0.75);
}

.hb-community-composer .hb-community-link-preview {
  margin-top: 0.55rem;
}

.hb-community-post__edit {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.hb-community-post__edit textarea {
  width: 100%;
  min-height: 5rem;
  resize: vertical;
}

.hb-community-post__edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.hb-community-post .hb-community-menu {
  margin-left: auto;
}

.hb-community-post .hb-community-menu__panel {
  min-width: 11rem;
}

.hb-community-comments {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--border-soft);
  display: grid;
  gap: 0.55rem;
}

.hb-community-comment {
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.4;
}

.hb-community-comment strong {
  color: var(--text-main);
}

.hb-community-comment__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  align-items: baseline;
  margin-bottom: 0.15rem;
  font-size: 0.8rem;
}

.hb-community-comment__body {
  white-space: pre-wrap;
  word-break: break-word;
}

.hb-community-comment__reply {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0;
  cursor: pointer;
}

.hb-community-comment__reply:hover {
  text-decoration: underline;
}

.hb-community-comment.is-reply,
.hb-community-comment__replies {
  margin-left: 0.85rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--border-soft);
}

.hb-community-comment__replies {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.hb-community-thread {
  margin-top: 0.35rem;
}

.hb-community-comment-form {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.35rem;
}

.hb-community-comment-form__row {
  display: flex;
  gap: 0.45rem;
  align-items: flex-end;
}

.hb-community-comment-form__row .hb-input {
  flex: 1;
  min-height: 42px;
  resize: vertical;
}

.hb-community-comment-form__replying {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hb-community-react-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border-soft);
}

.hb-community-react-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.hb-community-react-stat {
  position: relative;
}

.hb-community-react-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid var(--border-color);
  background: var(--bg-soft);
  color: var(--text-main);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.hb-community-react-chip:hover {
  border-color: var(--accent);
  background: var(--bg-card);
}

.hb-community-react-controls {
  position: relative;
}

.hb-community-react-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.35rem);
  z-index: 25;
  display: flex;
  gap: 0.25rem;
  padding: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hb-community-react-option {
  appearance: none;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 4px);
  background: var(--bg-soft);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
}

.hb-community-react-option:hover,
.hb-community-react-option.is-on {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.hb-community-react-who {
  position: absolute;
  left: 0;
  top: calc(100% + 0.3rem);
  z-index: 26;
  min-width: 10rem;
  max-width: 16rem;
  padding: 0.55rem 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 0.8rem;
}

.hb-community-react-who strong {
  display: block;
  margin-bottom: 0.35rem;
}

.hb-community-react-who ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.2rem;
}

.hb-community-emoji-wrap {
  position: relative;
  z-index: 40;
}

.hb-community-emoji-panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.55rem);
  z-index: 40;
  width: min(22.5rem, calc(100vw - 2rem));
  padding: 0.75rem;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 0.3rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.hb-community-emoji-panel::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.hb-community-emoji-panel::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  bottom: -0.4rem;
  width: 0.7rem;
  height: 0.7rem;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  transform: rotate(45deg);
}

.hb-community-emoji-btn {
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: calc(var(--radius) - 6px);
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0.2rem;
  transition: background 0.12s ease;
}

.hb-community-emoji-btn:hover,
.hb-community-emoji-btn:focus-visible {
  background: var(--bg-soft);
  outline: none;
}

.hb-community-empty {
  margin: 0;
  padding: 1.25rem 0.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.hb-community-search {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.hb-community-search .hb-input {
  flex: 1;
  min-width: 0;
}

.hb-community-chip {
  appearance: none;
  border: 1px solid var(--border-color);
  background: var(--bg-soft);
  color: var(--text-main);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.hb-community-chip:hover,
.hb-community-chip.is-on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.hb-community-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-muted);
  border: 1px solid var(--border-soft);
}

.hb-community-pill.is-on {
  background: var(--success-bg);
  color: var(--success);
  border-color: transparent;
}

.hb-community-pill.is-off {
  background: var(--error-bg);
  color: var(--error);
  border-color: transparent;
}

.hb-community-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.hb-community-toggle-row:last-child {
  border-bottom: 0;
}

.hb-community-switch {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-soft);
  cursor: pointer;
  flex-shrink: 0;
}

.hb-community-switch[aria-checked="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.hb-community-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-main);
  transition: transform 0.15s ease;
}

.hb-community-switch[aria-checked="true"]::after {
  transform: translateX(18px);
  background: var(--accent);
}

.hb-community-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
}

.hb-community-contacts-filter {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.65rem;
}

.hb-community-contacts-filter .hb-input {
  flex: 1 1 auto;
  min-width: 0;
}

.hb-community-contacts-filter__icon {
  color: var(--text-muted);
  display: grid;
  place-items: center;
}

.hb-community-tool-toggle__label {
  display: none;
  font: 600 0.82rem/1 var(--font);
}

.hb-community-fellow-search:not(.is-collapsed) .hb-community-tool-toggle__label {
  display: inline;
}

.hb-community-requests__count.is-empty,
.hb-community-requests__count[hidden] {
  display: none !important;
}

.hb-community-subnav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.hb-community-subnav a:hover,
.hb-community-subnav a.is-active {
  color: var(--text-main);
  border-color: var(--border-color);
  background: var(--bg-card);
}

.hb-community-signal {
  appearance: none;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  min-width: 3.4rem;
}

.hb-community-signal.is-red {
  background: var(--error-bg);
  color: var(--error);
  border-color: rgba(248, 113, 113, 0.45);
}

.hb-community-signal.is-green {
  background: var(--success-bg);
  color: var(--success);
  border-color: rgba(74, 222, 128, 0.45);
}

.hb-community-signal:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.hb-community-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  margin: 0;
  min-width: 0;
}

.hb-community-call-row {
  display: inline-flex;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
  gap: 0.35rem;
}

.hb-community-splitbtn {
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: stretch;
  width: 2.75rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  overflow: hidden;
  cursor: not-allowed;
  font: inherit;
  vertical-align: middle;
  background: var(--bg-soft);
  color: var(--text-main);
}

.hb-community-splitbtn.is-ready {
  cursor: pointer;
  border-color: var(--success);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--success) 45%, transparent);
}

.hb-community-splitbtn.is-ready:hover {
  filter: brightness(1.04);
}

.hb-community-splitbtn__track {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  pointer-events: none;
}

.hb-community-splitbtn__half {
  display: block;
  min-width: 0;
  height: 100%;
}

.hb-community-splitbtn__half.is-red {
  background: color-mix(in srgb, var(--error) 42%, var(--bg-card));
}

.hb-community-splitbtn__half.is-green {
  background: color-mix(in srgb, var(--success) 48%, var(--bg-card));
}

.hb-community-splitbtn__half.is-peer {
  border-left: 1px solid color-mix(in srgb, var(--text-main) 14%, transparent);
}

.hb-community-splitbtn__label {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  color: var(--text-main);
  pointer-events: none;
  filter: drop-shadow(0 0 4px var(--bg-card));
}

.hb-community-splitbtn__label svg {
  display: block;
}

.hb-community-menu {
  position: relative;
  flex-shrink: 0;
}

.hb-community-menu__trigger {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
}

.hb-community-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 30;
  min-width: 13.5rem;
  padding: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.15rem;
}

.hb-community-menu__label {
  margin: 0.15rem 0.45rem 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hb-community-menu__item {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-main);
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  padding: 0.45rem 0.55rem;
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
}

.hb-community-menu__item:hover {
  background: var(--bg-soft);
}

.hb-community-menu__item.is-danger {
  color: var(--error);
}

.hb-community-menu__dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid var(--border-soft);
}

.hb-community-menu__dot.is-red {
  background: var(--error);
}

.hb-community-menu__dot.is-green {
  background: var(--success);
}

.hb-community-menu__sep {
  height: 1px;
  margin: 0.25rem 0.35rem;
  background: var(--border-soft);
}

.hb-community-chat {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto auto auto;
  min-height: min(70vh, 640px);
  gap: 0.45rem;
}

#panelActive:not(.hb-is-hidden) {
  display: grid;
  grid-template-rows: auto auto minmax(200px, 1fr) auto auto auto auto;
  gap: 0.45rem;
  min-height: min(70vh, 640px);
}

.hb-community-chat__log {
  overflow: auto;
  display: grid;
  gap: 0.45rem;
  align-content: start;
  padding: 0.35rem;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: calc(var(--radius) - 4px);
  max-height: 52vh;
  min-height: 0;
}

/* Viewport-vaste chat: geen page-scroll, alleen intern scrollen in het log */
html:has(body.hb-community-chat-layout),
body.hb-community-chat-layout {
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
}

body.hb-community-chat-layout {
  display: flex;
  flex-direction: column;
}

body.hb-community-chat-layout > .hb-main-nav {
  flex-shrink: 0;
}

body.hb-community-chat-layout > .hb-page {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

body.hb-community-chat-layout .hb-community-shell {
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: min(1180px, calc(100% - 1.25rem));
}

body.hb-community-chat-layout .hb-community-subnav {
  flex-shrink: 0;
  margin-bottom: 0;
}

body.hb-community-chat-layout .hb-community-grid {
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
  overflow: hidden;
}

body.hb-community-chat-layout .hb-community-col {
  min-height: 0;
  overflow: auto;
  align-content: start;
}

body.hb-community-chat-layout .hb-community-chat,
body.hb-community-chat-layout #contactPanel.hb-community-chat,
body.hb-community-chat-layout #appRoot.hb-community-chat {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow: hidden;
}

body.hb-community-chat-layout #panelActive:not(.hb-is-hidden) {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow: hidden;
}

body.hb-community-chat-layout .hb-community-panel-empty {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
}

body.hb-community-chat-layout .hb-community-chat__log {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
}

body.hb-community-chat-layout .hb-community-chat__compose {
  flex-shrink: 0;
}

body.hb-community-chat-layout .hb-community-chat__compose .hb-input {
  max-height: 5.5rem;
  resize: none;
}

body.hb-community-chat-layout .hb-community-chat__hint:empty,
body.hb-community-chat-layout .hb-form-status:not(.is-visible) {
  display: none;
  margin: 0;
  min-height: 0;
  padding: 0;
}

body.hb-community-chat-layout .hb-community-media-preview {
  flex-shrink: 0;
  max-height: 5.5rem;
  overflow: auto;
}

body.hb-community-chat-layout .hb-community-panel-head,
body.hb-community-chat-layout #panelBanner,
body.hb-community-chat-layout .hb-community-chat__hint,
body.hb-community-chat-layout #chatStatus {
  flex-shrink: 0;
}

.hb-community-bubble {
  max-width: 85%;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--text-main);
}

.hb-community-bubble.is-mine {
  justify-self: end;
  background: var(--accent-soft);
  border: 1px solid rgba(91, 159, 212, 0.35);
}

.hb-community-bubble.is-theirs {
  justify-self: start;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.hb-community-bubble__time {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.hb-community-chat__compose {
  display: flex;
  gap: 0.45rem;
  align-items: flex-end;
  position: relative;
  z-index: 5;
}

.hb-community-chat__compose .hb-input {
  flex: 1;
  min-height: 44px;
  resize: vertical;
}

.hb-community-chat__tools {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  flex-shrink: 0;
}

.hb-community-icon-btn {
  appearance: none;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border-color);
  background: var(--bg-soft);
  color: var(--text-main);
  display: grid;
  place-items: center;
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}

.hb-community-icon-btn svg {
  display: block;
}

.hb-community-icon-btn:hover {
  background: var(--bg-card);
  border-color: var(--accent);
}

.hb-community-icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hb-community-icon-btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast, #fff);
}

.hb-community-icon-btn--primary:hover {
  background: var(--accent-hover, var(--accent));
  border-color: var(--accent-hover, var(--accent));
  color: var(--accent-contrast, #fff);
  filter: brightness(1.04);
}

.hb-community-icon-btn--danger {
  background: color-mix(in srgb, var(--error) 14%, var(--bg-soft));
  border-color: var(--error);
  color: var(--error);
}

.hb-community-icon-btn--danger:hover {
  background: color-mix(in srgb, var(--error) 22%, var(--bg-card));
  border-color: var(--error);
  color: var(--error);
}

.hb-community-icon-btn.is-recording {
  background: var(--error-bg);
  border-color: var(--error);
  color: var(--error);
  animation: hb-community-pulse 1.1s ease-in-out infinite;
}

.hb-community-icon-btn--sm {
  width: 2rem;
  height: 2rem;
}

.hb-community-search .hb-community-icon-btn {
  width: 2.4rem;
  height: 2.4rem;
}

@keyframes hb-community-pulse {
  50% { filter: brightness(1.08); }
}

.hb-community-chat__hint {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  min-height: 1em;
}

.hb-community-bubble__media {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.hb-community-chat-photo {
  appearance: none;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.hb-community-chat-photo:hover {
  border-color: var(--accent);
}

.hb-community-chat-photo img {
  display: block;
  width: 100%;
  max-width: 240px;
  max-height: 240px;
  object-fit: cover;
}

.hb-community-voice {
  display: grid;
  gap: 0.2rem;
}

.hb-community-voice audio {
  width: min(100%, 240px);
  height: 36px;
}

.hb-community-voice__dur {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.hb-community-bubble__text {
  white-space: pre-wrap;
  word-break: break-word;
}

.hb-community-media-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.55rem 0 0.15rem;
}

.hb-community-media-preview__item {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-soft);
  flex-shrink: 0;
}

.hb-community-media-preview__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hb-community-media-preview__badge {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.hb-community-media-preview__remove {
  appearance: none;
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  box-shadow: var(--shadow);
}

.hb-community-media-preview__remove:hover {
  background: var(--error-bg);
  border-color: var(--error);
  color: var(--error);
}

.hb-community-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
}

.hb-community-avatar--sm {
  width: 32px;
  height: 32px;
}

.hb-community-profile-avatar {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.hb-community-profile-avatar__preview {
  flex-shrink: 0;
}

.hb-community-profile-avatar__preview .hb-community-avatar {
  width: 72px;
  height: 72px;
  font-size: 1.35rem;
}

.hb-community-avatar--lg {
  width: 72px;
  height: 72px;
  font-size: 1.35rem;
}

.hb-community-avatar--placeholder {
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.hb-community-contact-row {
  cursor: pointer;
  align-items: center;
}

.hb-community-contact-row:hover,
.hb-community-contact-row.is-active {
  background: var(--bg-soft);
}

.hb-community-contact-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hb-community-panel-empty {
  display: grid;
  place-items: center;
  min-height: 280px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
  padding: 1.5rem;
}

.hb-community-panel-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  min-height: 0;
  padding: 0;
}

.hb-community-panel-head__meta {
  min-width: 0;
  flex: 0 1 auto;
}

.hb-community-panel-head__meta strong {
  display: block;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 8rem;
}

.hb-community-panel-head__actions {
  margin-left: auto;
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
}

.hb-community-panel-head__actions .hb-community-toolbar {
  width: 100%;
  justify-content: flex-end;
}

#panelBanner:empty {
  display: none;
  margin: 0;
  padding: 0;
}

@media (max-width: 640px) {
  .hb-community-panel-head {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .hb-community-panel-head__actions {
    flex: 1 1 100%;
    margin-left: 0;
  }

  .hb-community-panel-head__meta strong {
    max-width: 12rem;
  }
}

.hb-community-manage {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-soft);
}

.hb-community-banner {
  font-size: 0.8rem;
  padding: 0.45rem 0.65rem;
  border-radius: calc(var(--radius) - 4px);
  margin: 0 0 0.55rem;
  background: var(--warning-bg, var(--bg-soft));
  color: var(--text-main);
  border: 1px solid var(--border-soft);
}

.hb-community-mic-notice {
  flex-shrink: 0;
  margin: 0.15rem 0 0.35rem;
  padding: 0.7rem 0.8rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid color-mix(in srgb, var(--error, #e07070) 45%, var(--border-color));
  background:
    linear-gradient(
      160deg,
      color-mix(in srgb, var(--error, #e07070) 14%, var(--bg-soft)),
      var(--bg-card)
    );
  color: var(--text-main);
  box-shadow: 0 6px 18px -10px rgba(0, 0, 0, 0.45);
}

.hb-community-mic-notice--insecure {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-color));
  background:
    linear-gradient(
      160deg,
      color-mix(in srgb, var(--accent) 16%, var(--bg-soft)),
      var(--bg-card)
    );
}

.hb-community-mic-notice__title,
.hb-community-mic-notice__detail,
.hb-community-mic-notice__actions {
  margin: 0;
  line-height: 1.45;
}

.hb-community-mic-notice__title {
  font-size: 0.88rem;
  font-weight: 650;
}

.hb-community-mic-notice__detail {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hb-community-mic-notice__detail code,
.hb-community-mic-notice__steps code {
  display: inline-block;
  max-width: 100%;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: color-mix(in srgb, var(--bg-deep, #0b1220) 35%, var(--bg-soft));
  color: var(--text-main);
  font-size: 0.74rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}

.hb-community-mic-notice__workarounds {
  margin-top: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--border-color);
  background: color-mix(in srgb, var(--bg-elevated, var(--bg-soft)) 80%, var(--bg-card));
}

.hb-community-mic-notice__workarounds-title {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
}

.hb-community-mic-notice__steps {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.hb-community-mic-notice__steps strong {
  color: var(--text-main);
  font-weight: 650;
}

.hb-community-mic-notice__actions {
  margin-top: 0.55rem;
}

.hb-community-mic-notice__link {
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hb-community-mic-notice__link:hover {
  color: var(--accent-hover, var(--accent));
}

/* —— Contacttegels (rechterpaneel) —— */
.hb-community-contacts-stage {
  display: flex;
  flex-direction: column;
  min-height: min(70vh, 720px);
}

.hb-community-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 0.85rem;
  padding: 0.15rem 0.1rem 0.35rem;
  align-content: start;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.hb-community-tile {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.9rem 0.55rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--text-main);
  cursor: pointer;
  text-align: center;
  font: inherit;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.hb-community-tile:hover,
.hb-community-tile:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 65%, var(--border-color));
  outline: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lift, var(--shadow));
}

.hb-community-tile.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-soft));
  box-shadow: var(--shadow-lift, var(--shadow));
}

.hb-community-tile.is-paused {
  opacity: 0.72;
}

.hb-community-tile__name {
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hb-community-tile__badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* —— Zwevende peer-vensters (always-on-top) —— */
.hb-community-float {
  position: fixed;
  z-index: 14000;
  display: flex;
  flex-direction: column;
  min-width: 300px;
  min-height: 320px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border-color));
  border-radius: 12px;
  background: var(--bg-elevated, var(--bg-soft));
  box-shadow:
    0 28px 64px -12px rgba(0, 0, 0, 0.82),
    0 0 0 1px rgba(110, 176, 224, 0.22),
    0 0 40px rgba(110, 176, 224, 0.08);
  color: var(--text-main);
  overflow: hidden;
  touch-action: none;
}

.hb-community-float[hidden] {
  display: none !important;
}

.hb-community-float.is-dragging,
.hb-community-float.is-resizing {
  user-select: none;
  opacity: 0.98;
}

.hb-community-float__titlebar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 0.62rem 0.55rem 0.62rem 0.9rem;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border-color));
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--accent) 28%, var(--bg-elevated, var(--bg-soft))),
      color-mix(in srgb, var(--accent) 12%, var(--bg-card))
    );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: grab;
  user-select: none;
}

.hb-community-float__titlebar::before {
  content: "";
  width: 0.35rem;
  height: 1.15rem;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--accent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 70%, transparent);
}

.hb-community-float.is-dragging .hb-community-float__titlebar {
  cursor: grabbing;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--accent) 38%, var(--bg-elevated, var(--bg-soft))),
      color-mix(in srgb, var(--accent) 18%, var(--bg-card))
    );
}

.hb-community-float__title-wrap {
  flex: 1;
  min-width: 0;
}

.hb-community-float__title {
  display: block;
  font-weight: 700;
  font-size: 0.94rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.hb-community-float__controls {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.28rem;
  flex: 0 0 auto;
  margin-left: 0.25rem;
}

.hb-community-float__ctrl {
  appearance: none;
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-deep) 35%, transparent);
  color: var(--text-main);
  cursor: pointer;
  line-height: 1;
  font: inherit;
}

.hb-community-float__ctrl svg {
  display: block;
  pointer-events: none;
}

.hb-community-float__ctrl:hover,
.hb-community-float__ctrl:focus-visible {
  color: var(--text-main);
  background: color-mix(in srgb, var(--accent) 22%, var(--bg-card));
  border-color: var(--accent);
  outline: none;
}

/* Legacy close-class →zelfde look als minimize */
.hb-community-float__close {
  appearance: none;
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-deep) 35%, transparent);
  color: var(--text-main);
  cursor: pointer;
  line-height: 1;
  font: inherit;
}

.hb-community-float__close:hover,
.hb-community-float__close:focus-visible {
  color: var(--text-main);
  background: color-mix(in srgb, var(--accent) 22%, var(--bg-card));
  border-color: var(--accent);
  outline: none;
}

.hb-community-float.has-unread {
  box-shadow:
    0 28px 64px -12px rgba(0, 0, 0, 0.82),
    0 0 0 1px color-mix(in srgb, var(--accent) 70%, white),
    0 0 28px color-mix(in srgb, var(--accent) 45%, transparent);
  animation: hb-float-unread-pulse 1.6s ease-in-out infinite;
}

.hb-community-float.has-unread .hb-community-float__titlebar {
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--accent) 42%, var(--bg-elevated, var(--bg-soft))),
      color-mix(in srgb, var(--accent) 18%, var(--bg-card))
    );
}

@keyframes hb-float-unread-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}

.hb-community-float__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-card);
}

.hb-community-float__resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 48%, color-mix(in srgb, var(--accent) 75%, transparent) 48%);
  border-bottom-right-radius: 12px;
}

body.hb-community-float-interacting {
  user-select: none !important;
  cursor: inherit;
}

body.hb-community-float-interacting iframe {
  pointer-events: none;
}

.hb-community-float-peer {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  height: 100%;
  padding: 0.55rem 0.7rem 0.65rem;
  gap: 0.45rem;
}

.hb-community-float-peer__head {
  flex-shrink: 0;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.hb-community-float-peer__head .hb-community-panel-head__meta strong {
  max-width: 6.5rem;
}

.hb-community-float-peer__head .hb-community-panel-head__actions {
  flex: 1 1 auto;
  min-width: 0;
}

.hb-community-float-peer__head .hb-community-toolbar {
  flex-wrap: nowrap;
  gap: 0.3rem;
}

.hb-community-float-peer__chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  gap: 0.4rem;
}

.hb-community-float-peer__chat .hb-community-chat__log {
  flex: 1;
  min-height: 140px;
  max-height: none;
  overflow-y: auto;
}

.hb-community-float-peer__chat .hb-community-chat__compose,
.hb-community-float-compose {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  flex-shrink: 0;
  z-index: 6;
  width: 100%;
}

.hb-community-float-compose__input,
.hb-community-float-peer__chat .hb-community-chat__compose .hb-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  flex: 0 0 auto;
  min-height: 6.25rem;
  max-height: 12rem;
  padding: 0.75rem 0.85rem;
  font-size: 1.02rem;
  line-height: 1.5;
  resize: vertical;
  field-sizing: content;
}

.hb-community-float-compose__input:focus,
.hb-community-float-peer__chat .hb-community-chat__compose .hb-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent);
}

.hb-community-float-compose__actions,
.hb-community-float-peer__chat .hb-community-chat__tools {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  flex-shrink: 0;
}

.hb-community-float-compose__send,
.hb-community-float-peer__chat .hb-community-chat__tools .hb-community-icon-btn--primary {
  margin-left: auto;
}

/* Emoji tussen mic en verzenden; panel omhoog richting het tekstveld */
.hb-community-float .hb-community-emoji-panel {
  top: auto;
  bottom: calc(100% + 0.45rem);
  left: 0;
  width: min(18rem, calc(100vw - 3rem));
}

.hb-community-float .hb-community-emoji-panel::after {
  top: auto;
  bottom: -0.35rem;
  transform: rotate(45deg);
}

/* —— Dock: geminimaliseerde peer-chats rechtsonder —— */
.hb-community-peer-dock {
  position: fixed;
  right: max(0.85rem, env(safe-area-inset-right, 0px));
  bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
  z-index: 13950;
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 0.45rem;
  max-width: min(92vw, 420px);
  pointer-events: none;
}

.hb-community-peer-dock[hidden] {
  display: none !important;
}

.hb-community-peer-dock__item {
  pointer-events: auto;
  appearance: none;
  position: relative;
  width: 3.15rem;
  height: 3.15rem;
  padding: 0;
  border: 2px solid color-mix(in srgb, var(--accent) 55%, var(--border-color));
  border-radius: 999px;
  background:
    linear-gradient(
      160deg,
      color-mix(in srgb, var(--accent) 22%, var(--bg-elevated, var(--bg-soft))),
      var(--bg-card)
    );
  box-shadow:
    0 10px 28px -8px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(110, 176, 224, 0.18);
  cursor: pointer;
  display: grid;
  place-items: center;
  overflow: visible;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.hb-community-peer-dock__item:hover,
.hb-community-peer-dock__item:focus-visible {
  transform: translateY(-3px) scale(1.04);
  border-color: var(--accent);
  outline: none;
  box-shadow:
    0 14px 32px -8px rgba(0, 0, 0, 0.78),
    0 0 18px color-mix(in srgb, var(--accent) 35%, transparent);
}

.hb-community-peer-dock__item .hb-community-avatar {
  width: 2.55rem !important;
  height: 2.55rem !important;
  border-radius: 999px;
  pointer-events: none;
  font-size: 0.72rem;
}

.hb-community-peer-dock__badge {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg-deep, #0b1220);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.15rem;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg-card);
  pointer-events: none;
}

.hb-community-peer-dock__item.is-alert {
  border-color: var(--accent);
  animation: hb-dock-alert 1.35s ease-in-out infinite;
  box-shadow:
    0 10px 28px -8px rgba(0, 0, 0, 0.72),
    0 0 0 2px color-mix(in srgb, var(--accent) 65%, white),
    0 0 22px color-mix(in srgb, var(--accent) 50%, transparent);
}

@keyframes hb-dock-alert {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

@media (max-width: 640px) {
  .hb-community-peer-dock {
    max-width: calc(100vw - 1.2rem);
    gap: 0.35rem;
  }

  .hb-community-peer-dock__item {
    width: 2.85rem;
    height: 2.85rem;
  }

  .hb-community-peer-dock__item .hb-community-avatar {
    width: 2.3rem !important;
    height: 2.3rem !important;
  }
}

/* legacy class behouden voor eventuele andere markup */
.hb-community-peer-dialog {
  width: min(720px, 100%);
  max-height: min(92vh, 860px);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-bottom: 1rem;
}

.hb-community-peer-chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  gap: 0.45rem;
}

.hb-community-peer-chat .hb-community-chat__log {
  flex: 1;
  min-height: 220px;
}

/* —— Naamweergave-opties (instellingen) —— */
.hb-community-name-options {
  border: 0;
  margin: 0 0 0.85rem;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.hb-community-name-option {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-soft);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.hb-community-name-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 65%, var(--border-color));
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-soft));
}

.hb-community-name-option input {
  margin-top: 0.2rem;
}

.hb-community-name-option span {
  display: grid;
  gap: 0.15rem;
}

.hb-community-name-option strong {
  font-size: 0.92rem;
}

.hb-community-name-option .hb-muted {
  font-size: 0.8rem;
}

.hb-is-hidden {
  display: none !important;
}

/* ========== Mobiele PWA-chrome (feed-first, hamburger-nav) ========== */

.hb-community-actionbar,
.hb-community-tabbar,
.hb-community-sheet {
  display: none;
}

/* Badge op hamburger / envelop voor vriendschapsverzoeken */
.hb-community-nav-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: var(--error, #c45c5c);
  color: #fff;
  font: 700 0.62rem/1.05rem var(--font);
  text-align: center;
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 0 0 2px rgba(14, 20, 34, 0.9);
}

.hb-community-nav-badge:empty,
.hb-community-nav-badge.is-empty,
.hb-community-nav-badge[hidden] {
  display: none !important;
}

body.hb-community-body .hb-nav-toggle,
body.hb-community-body .hb-nav-inbox {
  position: relative;
}

@media (max-width: 900px) {
  /* Hamburger + envelop zichtbaar; horizontale tabs/subnav weg */
  body.hb-community-body .hb-nav-more {
    display: none !important;
  }

  body.hb-community-body .hb-nav-toggle {
    display: inline-flex !important;
  }

  body.hb-community-body .hb-nav-container--shell {
    justify-content: space-between;
  }

  body.hb-community-body .hb-community-subnav,
  body.hb-community-body .hb-community-tabbar,
  body.hb-community-has-tabbar .hb-community-tabbar {
    display: none !important;
  }

  body.hb-community-body .hb-page,
  body.hb-community-has-tabbar .hb-page {
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  }

  body.hb-community-home .hb-page {
    padding-top: 0.65rem;
    padding-left: 0;
    padding-right: 0;
  }

  body.hb-community-home .hb-community-shell {
    width: 100%;
    margin: 0 auto 0;
    padding: 0 0.75rem;
  }

  /* Desktop-zijkolommen: op mobiel via sheets */
  body.hb-community-home .hb-community-col--groups,
  body.hb-community-home .hb-community-col--people {
    display: none !important;
  }

  body.hb-community-home .hb-community-col--feed {
    display: grid;
    gap: 0.75rem;
  }

  /* Actiebalk uit: groepen via tabbar, delen = compacte composer (niet sticky) */
  .hb-community-actionbar,
  .hb-community-actionbar[hidden] {
    display: none !important;
  }

  /* Composer: compact bovenaan, scrollt mee (niet sticky) */
  body.hb-community-home .hb-community-composer {
    display: block !important;
    position: static !important;
    max-height: none !important;
    opacity: 1 !important;
    margin: 0 0 0.55rem;
    padding: 0.55rem 0.7rem;
    border-width: 1px;
    overflow: visible;
    order: -1;
    box-shadow: none;
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border-color));
  }

  body.hb-community-home .hb-community-composer #postBody {
    min-height: 2.6rem;
    max-height: 8rem;
    font-size: 0.95rem;
    padding: 0.55rem 0.7rem;
    resize: none;
  }

  body.hb-community-home .hb-community-composer__row {
    margin-top: 0.4rem;
    gap: 0.35rem;
  }

  body.hb-community-home .hb-community-composer__tools .hb-input,
  body.hb-community-home .hb-community-composer #postGroup {
    min-width: 0;
    max-width: 9.5rem;
    font-size: 0.82rem;
    padding: 0.35rem 0.5rem;
  }

  body.hb-community-home .hb-community-col--feed {
    display: flex;
    flex-direction: column;
  }

  /* Link-previews: altijd zichtbaar in mobiele feed + composer */
  body.hb-community-home .hb-community-post .hb-community-link-preview,
  body.hb-community-home .hb-community-composer .hb-community-link-preview,
  body.hb-community-body .hb-community-link-preview {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100%;
    max-width: 100%;
    pointer-events: auto;
  }

  body.hb-community-home .hb-community-link-preview__media {
    display: block !important;
    width: 100%;
    min-height: 120px;
    max-height: 200px;
    object-fit: cover;
  }

  body.hb-community-home .hb-community-link-preview__media--empty {
    min-height: 0;
    max-height: 4px;
    height: 4px;
  }

  body.hb-community-home .hb-community-feed {
    min-height: 50vh;
  }

  /* Onderste navigatiebalk */
  body.hb-community-body .hb-community-tabbar,
  body.hb-community-has-tabbar .hb-community-tabbar,
  .hb-community-tabbar {
    display: flex !important;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    gap: 0.1rem;
    padding: 0.35rem 0.35rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border-color);
    background: color-mix(in srgb, var(--bg-card) 94%, transparent);
    backdrop-filter: blur(14px);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.28);
  }

  .hb-community-tabbar__item {
    appearance: none;
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.35rem 0.15rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    text-decoration: none;
    font: 600 0.62rem/1.1 var(--font);
    cursor: pointer;
  }

  .hb-community-tabbar__item:hover,
  .hb-community-tabbar__item.is-active,
  .hb-community-tabbar__item[aria-current="page"] {
    color: var(--accent);
    background: var(--accent-soft);
  }

  .hb-community-tabbar__item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }

  .hb-community-tabbar__icon-wrap {
    position: relative;
    display: inline-flex;
  }

  .hb-community-tabbar__badge {
    position: absolute;
    top: -0.25rem;
    right: -0.45rem;
    min-width: 0.95rem;
    height: 0.95rem;
    padding: 0 0.22rem;
    border-radius: 999px;
    background: var(--error, #c45c5c);
    color: #fff;
    font: 700 0.58rem/0.95rem var(--font);
    text-align: center;
  }

  /* Bottom sheets */
  .hb-community-sheet {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 80;
    pointer-events: none;
  }

  .hb-community-sheet:not([hidden]) {
    pointer-events: auto;
  }

  .hb-community-sheet[hidden] {
    display: none !important;
  }

  .hb-community-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 10, 18, 0.55);
    border: 0;
    padding: 0;
    cursor: pointer;
  }

  .hb-community-sheet__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(78vh, 640px);
    display: flex;
    flex-direction: column;
    border-radius: 16px 16px 0 0;
    border: 1px solid var(--border-color);
    border-bottom: 0;
    background: var(--bg-card);
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.4);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateY(8px);
    animation: hb-community-sheet-up 0.22s ease forwards;
  }

  @keyframes hb-community-sheet-up {
    to { transform: translateY(0); }
  }

  .hb-community-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1rem 0.65rem;
    border-bottom: 1px solid var(--border-soft, var(--border-color));
  }

  .hb-community-sheet__head h2 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-main);
    font-family: var(--font);
  }

  .hb-community-sheet__close {
    appearance: none;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--text-muted);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
  }

  .hb-community-sheet__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 0.75rem 1rem 1rem;
    display: grid;
    gap: 0.75rem;
  }

  .hb-community-sheet__body .hb-community-box {
    box-shadow: none;
  }

  .hb-community-sheet__foot {
    margin: 0;
    padding: 0.65rem 1rem 0.9rem;
    border-top: 1px solid var(--border-soft, var(--border-color));
  }

  .hb-community-sheet__foot .hb-button {
    width: 100%;
    text-align: center;
  }

  /* Install-banner boven tabbar */
  body.hb-community-body .hb-pwa-install {
    bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }

  body.hb-community-chat-layout > .hb-page {
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  }

  /*
   * Contactenlijst: page-scroll i.p.v. locked chat-viewport.
   * (Chat-pagina behoudt overflow:hidden via .hb-community-chat-layout zonder contacts-page.)
   */
  html:has(body.hb-community-contacts-page),
  body.hb-community-contacts-page {
    height: auto !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  body.hb-community-contacts-page {
    display: block !important;
  }

  body.hb-community-contacts-page > .hb-page {
    flex: none !important;
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
    display: block !important;
  }

  body.hb-community-contacts-page .hb-community-shell,
  body.hb-community-contacts-page .hb-community-grid {
    flex: none !important;
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
    display: block !important;
  }

  body.hb-community-contacts-page .hb-community-grid {
    grid-template-columns: 1fr !important;
  }

  body.hb-community-contacts-page .hb-community-contacts-stage {
    display: none !important;
  }

  body.hb-community-contacts-page .hb-community-col {
    overflow: visible !important;
    min-height: 0;
    height: auto !important;
  }

  body.hb-community-contacts-page .hb-community-box--contacts {
    max-height: none;
  }

  body.hb-community-contacts-page #contactList {
    max-height: none;
    overflow: visible;
  }

  .hb-community-box--compact {
    padding: 0.55rem 0.7rem;
  }

  .hb-community-box--compact .hb-community-box__head {
    margin-bottom: 0;
  }

  .hb-community-box--compact .hb-community-box__head h2 {
    font-size: 0.82rem;
  }

  .hb-community-fellow-search.is-collapsed .hb-community-search,
  .hb-community-fellow-search.is-collapsed #searchResults {
    display: none !important;
  }

  .hb-community-fellow-search.is-collapsed {
    padding: 0.35rem 0.55rem;
  }

  .hb-community-tool-toggle {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 2.35rem;
    height: 2.35rem;
    border: 1px solid var(--border-color);
    border-radius: calc(var(--radius) - 2px);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
  }

  .hb-community-tool-toggle:hover,
  .hb-community-tool-toggle[aria-expanded="true"] {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft, rgba(196, 163, 90, 0.12));
  }

  .hb-community-fellow-search:not(.is-collapsed) .hb-community-tool-toggle {
    width: auto;
    padding: 0 0.65rem;
    margin-bottom: 0.45rem;
  }

  .hb-community-fellow-search.is-collapsed .hb-community-tool-toggle__label {
    display: none !important;
  }

  .hb-community-col {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
  }

  /* Contacten: verzoeken → zoeken → mijn contacten (DOM-volgorde + expliciet) */
  body.hb-community-contacts-page .hb-community-requests {
    order: 0;
  }

  body.hb-community-contacts-page .hb-community-box--search,
  body.hb-community-contacts-page #peopleSearchBox {
    order: 1;
  }

  body.hb-community-contacts-page .hb-community-box--contacts {
    order: 2;
  }

  .hb-community-search-hint {
    margin: 0 0 0.5rem;
    font-size: 0.78rem;
  }

  .hb-community-people-hit {
    align-items: center;
  }

  .hb-community-box--search #peopleSearchResults:empty {
    display: none;
  }

  .hb-community-box--search #peopleSearchResults {
    margin-top: 0.35rem;
    border-top: 1px solid var(--border-soft, var(--border-color));
    padding-top: 0.35rem;
  }

  .hb-community-requests.is-collapsed #requestList {
    display: none !important;
  }

  .hb-community-requests .hb-community-box__head {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
  }

  .hb-community-requests .hb-community-box__head h2 {
    display: inline-flex;
    align-items: center;
    flex: 1 1 auto;
    margin: 0;
  }

  .hb-community-requests__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.2rem;
    height: 1.2rem;
    padding: 0 0.35rem;
    margin-left: 0.35rem;
    border-radius: 999px;
    background: var(--accent-soft, rgba(196, 163, 90, 0.18));
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
  }

  .hb-community-requests__count.is-alert {
    background: var(--error, #c45c5c);
    color: #fff;
  }

  .hb-community-requests__chev {
    margin-left: auto;
    color: var(--text-muted);
    transition: transform 0.18s ease;
  }

  .hb-community-requests:not(.is-collapsed) .hb-community-requests__chev {
    transform: rotate(180deg);
  }
}

@media (min-width: 901px) {
  .hb-community-actionbar,
  .hb-community-tabbar,
  .hb-community-sheet {
    display: none !important;
  }
}

/* Desktop: composer altijd normaal zichtbaar */
@media (min-width: 901px) {
  body.hb-community-home .hb-community-composer {
    display: block;
    max-height: none;
    opacity: 1;
    overflow: visible;
  }
}
