/* People Pane: online rows, All members, and the chat dock.
   Docked pills are the default. Heads mode is the round-chat view.
   Sits above the bottom bar. For You uses site tokens. Me uses page-look 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,
.people-dock__heads,
.people-dock__mode,
.people-dock__menu {
  pointer-events: auto;
}

.people-dock__pills[hidden],
.people-dock__heads[hidden],
.people-dock__menu[hidden],
.people-dock__mode[hidden] {
  display: none !important;
}

.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;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  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 {
  align-items: flex-end;
}

.people-dock__log .dm-photo-grid {
  width: min(100%, 168px);
  margin: 0;
}

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

.people-dock__form {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
}

.people-dock__compose {
  display: flex;
  gap: 4px;
  align-items: center;
  min-width: 0;
}

.people-dock__photo {
  padding: 0.35rem 0.45rem;
  font-size: 12px;
  line-height: 1;
}

.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__photo: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__photo:focus-visible,
html[data-theme="light"] .people-dock__input:focus-visible {
  outline-color: #0f5c12;
}

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

/* Heads: round chats. The right inset leaves the Live Help "?" its own spot. */
.people-dock__mode {
  align-self: flex-end;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--lime, #39ff14);
  background: var(--panel, #0d1f0e);
  color: var(--lime, #39ff14);
  font: 700 12px/1 var(--font-body, "Inter", sans-serif);
  cursor: pointer;
}

.people-dock__heads:not([hidden]) {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.people-dock__avatar {
  position: relative;
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--lime, #39ff14);
  background: var(--panel, #0d1f0e);
  color: var(--lime, #39ff14);
  font: 700 13px/1 var(--font-body, "Inter", sans-serif);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.35);
}

.people-dock__avatar-letters {
  grid-area: 1 / 1;
  pointer-events: none;
}

.people-dock__avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
  grid-area: 1 / 1;
}

.people-dock__avatar .people-dock__dot {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--panel, #0d1f0e);
}

.people-dock__avatar .people-dock__badge {
  position: absolute;
  top: -4px;
  right: -4px;
}

.people-dock__avatar.is-open,
.people-dock__avatar[aria-pressed="true"] {
  box-shadow: 0 0 0 3px var(--lime, #39ff14);
}

.people-dock__avatar--more {
  border-style: dashed;
  font-size: 22px;
  box-shadow: none;
}

.people-dock__suspended {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 1px 6px;
  background: #6b5344;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.people-dock__suspended-mark {
  position: absolute;
  left: -2px;
  bottom: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #6b5344;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

.people-dock__pill .people-dock__suspended-mark {
  position: static;
  flex: 0 0 auto;
}

.people-dock__avatar.is-suspended,
.people-dock__pill.is-suspended {
  border-style: dashed;
  border-color: #c4a574;
  color: #f3e6d0;
}

.people-dock__menu:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 148px;
  max-width: 220px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--lime, #39ff14);
  background: var(--panel, #0d1f0e);
}

.people-dock__menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: 600 13px/1.3 var(--font-body, "Inter", sans-serif);
  text-decoration: none;
  cursor: pointer;
}

.people-dock__menu-item.is-suspended {
  color: #f3e6d0;
}

.people-dock__form.is-partner-suspended .people-dock__input:disabled,
.people-dock__form.is-partner-suspended .people-dock__send:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.people-dock[data-people-mode="heads"] {
  right: calc(1rem + 2.75rem + 12px + env(safe-area-inset-right, 0px));
  bottom: calc(var(--bottom-nav-height, 56px) + 8px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: auto auto;
  justify-content: end;
  align-items: end;
  column-gap: 10px;
}

.people-dock[data-people-mode="heads"] .people-dock__win {
  grid-column: 1;
  grid-row: 1;
  border-bottom: 1px solid var(--lime, #39ff14);
  border-radius: 14px;
}

.people-dock[data-people-mode="heads"] .people-dock__heads {
  grid-column: 2;
  grid-row: 1;
}

.people-dock[data-people-mode="heads"] .people-dock__mode {
  grid-column: 2;
  justify-self: center;
}

.people-dock__avatar:focus-visible,
.people-dock__mode:focus-visible,
.people-dock__menu-item:focus-visible {
  outline: 2px solid #39ff14;
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .people-dock[data-people-mode="heads"] {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    left: 0;
    right: 0;
    padding-right: calc(8px + 2.75rem + 1rem + env(safe-area-inset-right, 0px));
  }

  .people-dock[data-people-mode="heads"] .people-dock__win {
    width: 100%;
    flex-basis: auto;
    order: 1;
  }

  .people-dock[data-people-mode="heads"] .people-dock__heads {
    order: 2;
    align-self: flex-end;
    flex: 0 0 auto;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    width: auto;
  }

  .people-dock[data-people-mode="heads"] .people-dock__menu:not([hidden]) {
    flex: 1 0 100%;
    order: -1;
  }

  .people-dock[data-people-mode="heads"] .people-dock__mode {
    order: 3;
    align-self: flex-end;
  }

  .people-dock[data-people-mode="heads"] .people-dock__log {
    height: min(160px, 22vh);
  }
}

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

html[data-theme="light"] .people-dock__avatar.is-suspended,
html[data-theme="light"] .people-dock__pill.is-suspended {
  color: #6b3e12;
  border-color: #8a5a2b;
}

html[data-theme="light"] .people-dock__avatar:focus-visible,
html[data-theme="light"] .people-dock__mode:focus-visible,
html[data-theme="light"] .people-dock__menu-item:focus-visible {
  outline-color: #0f5c12;
}

/* Me page look. Site pages keep the rules above. */
body[data-profile-page] .people-dock__win,
body[data-profile-page] .people-dock__pill,
body[data-profile-page] .people-dock__avatar,
body[data-profile-page] .people-dock__mode,
body[data-profile-page] .people-dock__menu {
  background: var(--pl-panel-bg, var(--panel, #0d1f0e));
  border-color: var(--pl-accent, var(--lime, #39ff14));
  color: var(--pl-fg, var(--headings, #d8ffd0));
  box-shadow: 0 0 8px var(--pl-accent, transparent);
}

body[data-profile-page] .people-dock__head,
body[data-profile-page] .people-dock__title,
body[data-profile-page] .people-dock__tool {
  color: var(--pl-fg, var(--headings, #d8ffd0));
  border-color: var(--pl-accent, var(--lime, #39ff14));
}

body[data-profile-page] .people-dock__bubble {
  background: var(--pl-bg, #041004);
  color: var(--pl-fg, #d8ffd0);
}

body[data-profile-page] .people-dock__msg--me .people-dock__bubble,
body[data-profile-page] .people-dock__send {
  background: var(--pl-accent, #39ff14);
  color: var(--pl-on-accent, #041004);
  border-color: var(--pl-accent, #39ff14);
}

body[data-profile-page] .people-dock__input {
  background: var(--pl-bg, #041004);
  color: var(--pl-fg, #d8ffd0);
  border-color: var(--pl-accent, #1b5e20);
}

body[data-profile-page] .people-dock__avatar.is-open,
body[data-profile-page] .people-dock__avatar[aria-pressed="true"] {
  box-shadow: 0 0 0 3px var(--pl-accent, #39ff14);
}

body[data-profile-page] .people-dock__avatar .people-dock__dot {
  border-color: var(--pl-bg, #041004);
}

body[data-profile-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);
}

body[data-profile-page] .people-dock__avatar:focus-visible,
body[data-profile-page] .people-dock__mode:focus-visible,
body[data-profile-page] .people-dock__menu-item:focus-visible,
body[data-profile-page] .people-dock__pill:focus-visible,
body[data-profile-page] .people-dock__tool:focus-visible,
body[data-profile-page] .people-dock__send:focus-visible,
body[data-profile-page] .people-dock__input:focus-visible {
  outline-color: var(--pl-accent, #39ff14);
}

/* Tester preview: size the dock chat to the visible viewport. */
html[data-tester-preview="1"] .people-dock__win {
  max-height: var(--people-win-max, 420px);
  overflow: hidden;
}

html[data-tester-preview="1"] .people-dock__head,
html[data-tester-preview="1"] .people-dock__form,
html[data-tester-preview="1"] .people-dock__status {
  flex: 0 0 auto;
}

html[data-tester-preview="1"] .people-dock__log {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

html[data-tester-preview="1"] body.kb-open .people-dock__log {
  height: auto;
  flex: 1 1 auto;
  min-height: 0;
}

@media (max-width: 640px) {
  html[data-tester-preview="1"] body.kb-open .people-dock__pills,
  html[data-tester-preview="1"] body.kb-open .people-dock__heads,
  html[data-tester-preview="1"] body.kb-open .people-dock__mode {
    display: none !important;
  }
}

html[data-tester-preview="1"] .people-dock__mode {
  width: 52px;
  height: 52px;
  min-width: 44px;
  min-height: 44px;
  padding: 4px;
  border-radius: 50%;
  font: 700 9px/1.05 var(--font-body, "Inter", sans-serif);
  letter-spacing: 0;
  text-align: center;
  white-space: normal;
}

/* Chat photos stay small so the title and composer stay on a phone. */
html[data-tester-preview="1"] .people-dock__log .dm-photo-grid,
html[data-tester-preview="1"] .people-dock__log .dm-photo-grid[data-count="1"] {
  width: 110px;
  max-width: 110px;
}

html[data-tester-preview="1"] .people-dock__log .dm-photo-cell,
html[data-tester-preview="1"] .people-dock__log .dm-photo-thumb,
html[data-tester-preview="1"] .people-dock__log .dm-photo-thumb img {
  max-width: 110px;
  max-height: 110px;
}

html[data-tester-preview="1"] .people-dock__form .dm-photo-pending {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  height: 44px;
  max-height: 44px;
  overflow: hidden;
  gap: 6px;
}

html[data-tester-preview="1"] .people-dock__form .dm-photo-pending-item,
html[data-tester-preview="1"] .people-dock__form .dm-photo-pending-item img {
  width: 44px;
  height: 44px;
}
