/* People Pane Version B: online rows, All members, and the chat dock on For You only.
   Sits above the bottom bar. Dark uses the Matrix green dock; light uses the site panel tokens. */

.people-online__title {
  margin: 0.15rem 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--lime, #39ff14);
}

.people-online .online-avatar img + .avatar-fallback,
.people-all .online-avatar img + .avatar-fallback {
  display: none;
}

.people-msg {
  flex: 0 0 auto;
  min-height: 36px;
  margin: 0;
  padding: 0 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--lime, #39ff14);
  background: transparent;
  color: var(--lime, #39ff14);
  font: 700 0.78rem/1 var(--font-body, "Inter", sans-serif);
  cursor: pointer;
}

.people-msg.is-open,
.people-msg[aria-pressed="true"] {
  background: rgba(57, 255, 20, 0.16);
}

.people-all {
  margin-top: 0.75rem;
  border-top: 1px solid rgba(57, 255, 20, 0.28);
  padding-top: 0.15rem;
}

.people-all__summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.35rem 0.15rem;
  cursor: pointer;
  font-weight: 700;
  color: var(--headings, #d8ffd0);
  list-style: none;
}

.people-all__summary::-webkit-details-marker {
  display: none;
}

.people-all__summary::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  flex: 0 0 auto;
}

.people-all[open] .people-all__summary::before {
  transform: rotate(45deg);
  margin-top: -0.15rem;
}

.people-all__empty {
  margin: 0 0 0.5rem;
}

.people-all__list {
  margin-top: 0.15rem;
}

.people-dock__empty {
  margin: 0;
  color: #7a9a78;
  font-size: 12px;
}

.people-dock {
  position: fixed;
  z-index: 50;
  right: 14px;
  bottom: calc(var(--bottom-nav-height, 56px) + env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: calc(100vw - 28px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  pointer-events: none;
}

.people-dock__pills,
.people-dock__win {
  pointer-events: auto;
}

.people-dock__pills {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.people-dock__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 160px;
  background: var(--panel, #0d1f0e);
  border: 1px solid var(--lime, #39ff14);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  padding: 7px 12px;
  color: var(--lime, #39ff14);
  font: 600 14px/1.2 var(--font-body, "Inter", sans-serif);
  text-decoration: none;
  cursor: pointer;
}

.people-dock__pill.is-open,
.people-dock__pill[aria-pressed="true"] {
  background: #102814;
}

.people-dock__pill-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.people-dock__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6b736b;
  flex: 0 0 auto;
}

.people-dock__dot.is-online {
  background: #39ff14;
  box-shadow: 0 0 6px #39ff14;
}

.people-dock__badge {
  background: #9b1c1c;
  color: #fff;
  border-radius: 9px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  flex: 0 0 auto;
}

.people-dock__win {
  width: 300px;
  max-width: 100%;
  background: var(--panel, #0d1f0e);
  border: 1px solid var(--lime, #39ff14);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 0 16px rgba(57, 255, 20, 0.27);
  color: var(--headings, #d8ffd0);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.people-dock__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--panel-border, #1b5e20);
  color: var(--lime, #39ff14);
}

.people-dock__title {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
  color: inherit;
}

.people-dock__title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.people-dock__tools {
  display: flex;
  gap: 2px;
  flex: 0 0 auto;
}

.people-dock__tool {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: 700 16px/1 var(--font-body, sans-serif);
  cursor: pointer;
}

.people-dock__log {
  height: 260px;
  overflow: auto;
  padding: 8px;
}

.people-dock__msg {
  display: flex;
  margin: 5px 0;
}

.people-dock__bubble {
  max-width: 80%;
  margin: 0;
  padding: 6px 9px;
  border-radius: 8px;
  background: #041004;
  color: #d8ffd0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.45;
}

.people-dock__msg--me {
  justify-content: flex-end;
}

.people-dock__msg--me .people-dock__bubble {
  background: #0f5c12;
  color: #fff;
}

.people-dock__form {
  display: flex;
  gap: 4px;
  padding: 6px;
  align-items: center;
}

.people-dock__input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  background: var(--input-bg, #041004);
  border: 1px solid var(--input-border, #1b5e20);
  color: var(--headings, #d8ffd0);
  padding: 6px;
  border-radius: 4px;
  font: 14px/1.3 var(--font-body, "Inter", sans-serif);
}

.people-dock__send {
  flex: 0 0 auto;
  min-width: 36px;
  min-height: 36px;
  border: 1px solid #39ff14;
  border-radius: 5px;
  background: #39ff14;
  color: #041004;
  font-weight: 800;
  cursor: pointer;
}

.people-dock__send:disabled {
  opacity: 0.6;
  cursor: wait;
}

.people-dock__status {
  margin: 0;
  padding: 0 8px 6px;
  color: #ffb4b4;
  font-size: 12px;
}

.people-dock__status:empty {
  display: none;
}

.people-msg:focus-visible,
.people-all__summary:focus-visible,
.people-online .online-link:focus-visible,
.people-all .online-link:focus-visible,
.people-online .online-follow-btn:focus-visible,
.people-all .online-follow-btn:focus-visible,
.people-dock__pill:focus-visible,
.people-dock__tool:focus-visible,
.people-dock__send:focus-visible,
.people-dock__input:focus-visible {
  outline: 2px solid #39ff14;
  outline-offset: 2px;
}

body[data-home-page].has-people-dock .ax-backtop {
  bottom: calc(var(--bottom-nav-height, 56px) + env(safe-area-inset-bottom, 0px) + var(--people-dock-h, 48px) + 0.65rem);
}

body.kb-open .people-dock {
  bottom: 0;
}

body.kb-open .people-dock__log {
  height: 120px;
}

@media (max-width: 640px) {
  .people-dock {
    left: 0;
    right: 0;
    max-width: none;
    gap: 6px;
    padding: 0 8px;
    flex-wrap: wrap;
  }

  .people-dock__pills {
    flex: 1 1 auto;
    justify-content: flex-start;
  }

  .people-dock__win {
    width: 100%;
    flex-basis: 100%;
  }

  .people-dock__pill {
    padding: 5px 8px;
    font-size: 12px;
  }

  .people-online .online-row,
  .people-all .online-row {
    flex-wrap: wrap;
  }

  .people-msg,
  .people-online .online-follow-btn,
  .people-all .online-follow-btn {
    min-height: 44px;
  }

  .people-online .online-follow-btn,
  .people-all .online-follow-btn {
    min-width: 44px;
  }

  body[data-home-page].has-people-dock .app-main {
    padding-bottom: calc(var(--bottom-nav-height, 56px) + env(safe-area-inset-bottom, 0px) + var(--people-dock-h, 48px) + 1rem);
  }
}

html[data-theme="light"] .people-online__title,
html[data-theme="light"] .people-all__summary {
  color: #0d1f0e;
}

html[data-theme="light"] .people-msg {
  color: #0f5c12;
  border-color: #1b5e20;
  background: #ffffff;
}

html[data-theme="light"] .people-msg.is-open,
html[data-theme="light"] .people-msg[aria-pressed="true"] {
  background: #e5f6e6;
}

html[data-theme="light"] .people-dock__pill,
html[data-theme="light"] .people-dock__win {
  background: var(--panel, #ffffff);
  color: #0f5c12;
  border-color: #1b5e20;
  box-shadow: none;
}

html[data-theme="light"] .people-dock__pill.is-open,
html[data-theme="light"] .people-dock__pill[aria-pressed="true"] {
  background: #e5f6e6;
}

html[data-theme="light"] .people-dock__head {
  border-bottom-color: #c5d9c8;
  color: #0f5c12;
}

html[data-theme="light"] .people-dock__bubble {
  background: #e7f6e4;
  color: #14241a;
}

html[data-theme="light"] .people-dock__msg--me .people-dock__bubble {
  background: #0f5c12;
  color: #ffffff;
}

html[data-theme="light"] .people-dock__input {
  background: #ffffff;
  color: #14241a;
  border-color: #5f7a64;
}

html[data-theme="light"] .people-msg:focus-visible,
html[data-theme="light"] .people-all__summary:focus-visible,
html[data-theme="light"] .people-online .online-link:focus-visible,
html[data-theme="light"] .people-all .online-link:focus-visible,
html[data-theme="light"] .people-online .online-follow-btn:focus-visible,
html[data-theme="light"] .people-all .online-follow-btn:focus-visible,
html[data-theme="light"] .people-dock__pill:focus-visible,
html[data-theme="light"] .people-dock__tool:focus-visible,
html[data-theme="light"] .people-dock__send:focus-visible,
html[data-theme="light"] .people-dock__input:focus-visible {
  outline-color: #0f5c12;
}

@media (prefers-reduced-motion: reduce) {
  .people-dock__win {
    box-shadow: none;
  }
}
