/* LinkedIn/FB-style crew messenger — bottom right */

.crew-messenger {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

/* Analysis windows live in a lower stacking context than the dock.
   Hovering Short/Long/Events yields the collapsed messenger so it cannot cover them. */
body.analysis-mode.ad-messenger-yield .crew-messenger:not(.is-open),
body.analysis-mode.ad-messenger-yield .pete-chat-messenger:not(.is-open) {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.crew-messenger.is-hidden,
.crew-messenger[hidden],
body:has(#launchOverlay:not([hidden]):not([aria-hidden="true"])) .crew-messenger,
body.launch-active #launchOverlay:not([hidden]) ~ .crew-messenger,
.pete-chat-messenger[hidden] {
  display: none !important;
}

body:not(:has(#launchOverlay:not([hidden]))) .crew-messenger.is-auth-ready {
  display: flex !important;
  visibility: visible !important;
}

.crew-msg-fab,
.crew-msg-panel {
  pointer-events: auto;
}

.crew-msg-fab {
  min-height: 48px;
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  border: 1px solid rgba(201, 162, 39, 0.45);
  background: linear-gradient(180deg, #1a2436 0%, #0d141f 100%);
  color: #f0e6c8;
  font-family: Cinzel, "Times New Roman", serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.crew-msg-fab-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(12, 18, 28, 0.9);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.crew-msg-fab-icon img,
.crew-msg-fab-svg {
  width: 36px;
  height: 36px;
  display: block;
  object-fit: cover;
}

.crew-msg-fab-icon img.crew-msg-avatar-portrait {
  object-fit: contain;
  background: transparent;
}

.crew-msg-avatar.crew-msg-avatar-portrait {
  object-fit: contain;
  background: transparent;
  border-radius: 10px;
}

.crew-msg-fab-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
}

.crew-msg-fab-label {
  white-space: nowrap;
}

.crew-msg-fab-who {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  color: rgba(240, 230, 200, 0.72);
}

.crew-msg-panel {
  position: relative;
  width: min(400px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 100px));
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: rgba(8, 12, 20, 0.98);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.crew-msg-panel[hidden] {
  display: none !important;
}

.crew-msg-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
  background: rgba(201, 162, 39, 0.08);
}

.crew-msg-head > :first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.crew-msg-title {
  margin: 0;
  font-family: Cinzel, "Times New Roman", serif;
  color: #f0e6c8;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crew-msg-sub {
  margin: 4px 0 0;
  font-size: 0.68rem;
}

.pete-watch-status {
  margin-top: 6px;
}

.pete-watch-status-bar {
  margin: 0;
  padding: 6px 12px 0;
  border-bottom: 1px solid rgba(201, 162, 39, 0.12);
}

.pete-watch-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin: 0;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-align: left;
}

.pete-watch-copy {
  font-size: 0.64rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pete-watch-tone-live { color: #7dcea0; }
.pete-watch-tone-closed { color: #c5c9d3; }
.pete-watch-tone-paused { color: #e8c36a; }
.pete-watch-tone-budget { color: #e39a56; }
.pete-watch-tone-offline { color: #e06b6b; }

.pete-watch-details {
  margin: 6px 0 8px;
  padding: 8px 0 2px;
}

.pete-watch-details-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 10px;
  margin: 0;
  font-size: 0.62rem;
  letter-spacing: 0.03em;
}

.pete-watch-details-grid dt {
  margin: 0;
  color: #8b93a3;
}

.pete-watch-details-grid dd {
  margin: 0;
  color: #f0e6c8;
}

.pete-watch-distinct {
  margin: 8px 0 0;
  font-size: 0.6rem;
}

.crew-msg-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.crew-msg-tab {
  border: 0;
  background: transparent;
  color: #9aa3b2;
  padding: 10px 6px;
  cursor: pointer;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.crew-msg-tab.active {
  color: #f0e6c8;
  box-shadow: inset 0 -2px 0 #c5a059;
}

.crew-msg-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.crew-msg-empty {
  margin: 16px 4px;
  font-size: 0.85rem;
}

.crew-msg-search-wrap input {
  width: 100%;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0a1018;
  color: #e8edf5;
  padding: 8px 10px;
  font: inherit;
}

.crew-msg-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.crew-msg-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 10px;
  min-height: 68px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.crew-msg-pop-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  font-size: 0.85rem;
  line-height: 1;
}

.crew-msg-more-btn {
  min-width: 28px;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  line-height: 1;
  font-size: 1rem;
  letter-spacing: 0;
  flex-shrink: 0;
}

.crew-msg-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(201, 162, 39, 0.28);
}

.crew-msg-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #1a2436;
  flex-shrink: 0;
}

.crew-msg-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #f0e6c8;
  border: 1px solid rgba(201, 162, 39, 0.35);
}

.crew-msg-name-btn {
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.crew-msg-name-btn strong {
  font-size: 0.92rem;
  color: #e8edf5;
}

.crew-msg-name-btn span {
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crew-msg-friends {
  font-size: 0.65rem;
  white-space: nowrap;
}

.crew-msg-profile-menu {
  position: absolute;
  z-index: 5;
  min-width: 180px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: #0f1624;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.crew-msg-menu-title {
  margin: 0 0 4px;
  font-size: 0.8rem;
  color: #f0e6c8;
}

.crew-msg-thread-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.crew-msg-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.crew-msg-bubble {
  max-width: 88%;
  width: fit-content;
  height: auto;
  min-height: 0;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.86rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.crew-msg-bubble.me {
  align-self: flex-end;
  background: rgba(40, 70, 120, 0.4);
}

.crew-msg-bubble.them {
  align-self: flex-start;
  background: rgba(201, 162, 39, 0.12);
}

.crew-msg-meta {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa3b2;
  margin-bottom: 3px;
}

.crew-msg-day {
  align-self: center;
  margin: 10px 0 4px;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: rgba(196, 210, 224, 0.55);
}

.crew-msg-bubble {
  position: relative;
}

.crew-msg-del {
  position: absolute;
  top: 6px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(180, 70, 70, 0.78);
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
  opacity: 0.35;
  cursor: pointer;
}
.crew-msg-bubble.me .crew-msg-del { left: 6px; }
.crew-msg-bubble.them .crew-msg-del { right: 6px; }
.crew-msg-bubble.me:has(.crew-msg-del) { padding-left: 36px; }
.crew-msg-bubble.them:has(.crew-msg-del) { padding-right: 36px; }
.crew-msg-bubble:hover .crew-msg-del,
.crew-msg-bubble:focus-within .crew-msg-del { opacity: 1; }

.crew-msg-compose {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(201, 162, 39, 0.2);
  overflow: visible;
  position: relative;
  z-index: 3;
}

.crew-msg-compose-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: end;
}

.crew-msg-input-wrap {
  position: relative;
  min-width: 0;
}

.crew-msg-upload-progress {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #c9b56a;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.crew-msg-compose.is-uploading .crew-msg-attach-chip-list,
.crew-msg-compose.is-uploading .crew-msg-attach-clear,
.crew-msg-compose.is-uploading .crew-msg-plus,
.crew-msg-compose.is-uploading .crew-msg-doc {
  display: none !important;
}

.crew-msg-compose.is-uploading textarea {
  color: transparent;
  caret-color: transparent;
}

.crew-msg-compose textarea {
  width: 100%;
  resize: none;
  min-height: 52px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0a1018;
  color: #e8edf5;
  padding: 8px 10px;
  font: inherit;
}

.crew-msg-plus-wrap {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: visible;
}

.crew-msg-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  opacity: 0.01;
}

.crew-msg-doc {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(201, 162, 39, 0.5);
  background: #151d2c;
  color: #f0e6c8;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.crew-msg-plus,
.crew-msg-plus-wrap,
.crew-msg-doc {
  cursor: pointer !important;
}

.crew-msg-plus {
  position: relative;
  z-index: 8;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(201, 162, 39, 0.5);
  background: #151d2c;
  color: #f0e6c8;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer !important;
  pointer-events: auto;
  touch-action: manipulation;
  display: grid;
  place-items: center;
  padding: 0 0 2px;
}

.crew-msg-plus:hover,
.crew-msg-plus[aria-expanded="true"] {
  background: rgba(201, 162, 39, 0.18);
}

.crew-msg-attach-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  min-width: 168px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: #121a28;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  z-index: 6;
  display: grid;
  gap: 4px;
}

.crew-msg-attach-menu[hidden] {
  display: none;
}

.crew-msg-attach-menu button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #e8edf5;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}

.crew-msg-attach-menu button:hover {
  background: rgba(201, 162, 39, 0.16);
}

.crew-msg-attach-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 6px;
}

.crew-msg-attach-chip-list[hidden] {
  display: none;
}

.crew-msg-attach-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  color: #cfd6e2;
}

.crew-msg-attach-chip[hidden] {
  display: none;
}

.crew-msg-attach-thumb {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #0a1018;
  flex: 0 0 auto;
}

.crew-msg-attach-thumb img {
  width: 28px;
  height: 28px;
  object-fit: cover;
}

.crew-msg-attach-clear {
  margin-left: auto;
  appearance: none;
  border: 0;
  background: transparent;
  color: #9aa3b2;
  cursor: pointer;
  font-size: 1.1rem;
}

.crew-msg-text {
  margin: 6px 0 0;
  white-space: pre-wrap;
}

.crew-msg-attach-meta {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.crew-msg-attach-status {
  font-size: 0.7rem;
  color: #9aa7bc;
}

.crew-msg-att-image {
  display: block;
  margin-top: 6px;
}

.crew-msg-att-image img,
.crew-msg-att-video {
  display: block;
  width: min(240px, 100%);
  max-width: min(240px, 100%);
  max-height: 180px;
  min-height: 96px;
  object-fit: contain;
  background: #071018;
  border-radius: 10px;
}

.crew-msg-att-image img.is-broken {
  display: none;
}

.crew-msg-att-video-card {
  display: grid;
  gap: 4px;
  margin-top: 4px;
}

.crew-msg-att-file {
  display: inline-block;
  margin-top: 4px;
  color: #f0e6c8;
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 162, 39, 0.45);
}

.crew-msg-att-file-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(201, 162, 39, 0.28);
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(201, 162, 39, 0.28);
  max-width: min(280px, 100%);
}

.crew-msg-att-file-icon {
  font-size: 1.1rem;
}

.crew-msg-att-file-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.crew-msg-att-file-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crew-msg-att-status {
  display: block;
  font-size: 0.72rem;
  color: #c9b56a;
}

@media (max-width: 720px) {
  .crew-messenger {
    right: 0;
    bottom: 0;
    left: 0;
    align-items: stretch;
  }

  .crew-msg-fab {
    margin: 0 10px 10px auto;
    padding: 6px;
    border-radius: 14px;
  }

  .crew-msg-fab-label,
  .crew-msg-fab-who {
    display: none;
  }

  .crew-msg-fab-icon {
    width: 44px;
    height: 44px;
  }

  .crew-messenger.is-open .crew-msg-panel {
    width: 100vw;
    height: calc(100vh - 56px);
    max-height: none;
    border-radius: 14px 14px 0 0;
  }

  .crew-msg-panel {
    width: 100vw;
    height: calc(100vh - 56px);
  }
}

@media (min-width: 721px) and (max-width: 1100px) {
  .crew-msg-panel {
    width: min(420px, 46vw);
    height: min(640px, calc(100vh - 80px));
  }
}

.crew-msg-head-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.crew-msg-head-actions .btn-sm {
  min-height: 28px;
  height: 28px;
  padding: 0 10px;
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
}

.crew-msg-pop-chrome {
  flex: 0 0 auto;
}

.crew-msg-win-btn {
  width: 28px;
  min-width: 28px;
  padding: 0;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.crew-msg-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e23d3d;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(8, 12, 20, 0.85);
}

.crew-msg-unread[hidden],
.crew-msg-tab-badge[hidden] {
  display: none !important;
}

.crew-msg-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e23d3d;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
}

.crew-msg-unread-pill {
  font-size: 0.65rem;
  background: rgba(226, 61, 61, 0.25);
  color: #ffb4b4;
  border-radius: 999px;
  padding: 2px 7px;
}

.crew-msg-pro-gate {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 12px;
  text-align: left;
}

.crew-msg-pro-gate strong {
  color: #f0e6c8;
  font-family: Cinzel, "Times New Roman", serif;
}

.crew-msg-row.is-unread {
  background: rgba(197, 160, 89, 0.08);
}

.pete-founder-dock-head {
  flex-wrap: wrap;
}

.pete-founder-float {
  position: fixed;
  z-index: 11000;
  display: flex;
  flex-direction: column;
  min-width: 280px;
  min-height: 240px;
  background: linear-gradient(180deg, #121a28 0%, #0b111a 100%);
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  color: #e8edf5;
  overflow: hidden;
}

.pete-founder-float.is-on-top {
  z-index: 12000;
}

.pete-founder-float[hidden] {
  display: none !important;
}

.pete-founder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  cursor: move;
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
  background: #101826;
}

.pete-founder-id {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: Cinzel, "Times New Roman", serif;
}

.pete-founder-presence {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: #c9a227;
}

.pete-founder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pete-founder-voice-line {
  margin: 0;
  padding: 4px 12px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: #9aa3b2;
}

.pete-founder-search {
  padding: 6px 10px;
}

.pete-founder-search input {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0a1018;
  color: #e8edf5;
  padding: 6px 8px;
}

.pete-founder-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 10px;
}

.pete-founder-thread {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.pete-founder-compose {
  flex: 0 0 auto;
}

.pete-founder-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(201, 162, 39, 0.7) 50%);
}

.pete-founder-bubble {
  position: fixed;
  right: 22px;
  bottom: 88px;
  z-index: 11020;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(201, 162, 39, 0.55);
  background: #151d2c;
  color: #f0e6c8;
  font-family: Cinzel, "Times New Roman", serif;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.pete-founder-bubble[hidden] {
  display: none !important;
}

.pete-founder-bubble.is-analyzing {
  animation: pete-founder-pulse 1.6s ease-in-out infinite;
}

.pete-founder-bubble.is-unread #peteFounderBubbleDot,
.pete-founder-bubble.is-alert #peteFounderBubbleDot {
  display: block;
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e23d3d;
}

.pete-founder-bubble.is-alert {
  box-shadow: 0 0 0 3px rgba(226, 61, 61, 0.35);
}

@keyframes pete-founder-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.crew-msg-float {
  position: fixed;
  z-index: 11040;
  display: flex;
  flex-direction: column;
  min-width: 300px;
  min-height: 260px;
  background: linear-gradient(180deg, #121a28 0%, #0b111a 100%);
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  color: #e8edf5;
  overflow: hidden;
}

.crew-msg-float[hidden] {
  display: none !important;
}

.crew-msg-float.is-minimized {
  height: auto !important;
  min-height: 0;
}

.crew-msg-float.is-minimized .crew-msg-float-thread,
.crew-msg-float.is-minimized .crew-msg-float-compose,
.crew-msg-float.is-minimized .crew-msg-float-resize {
  display: none !important;
}

.crew-msg-float-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  cursor: move;
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
  background: #101826;
}

.crew-msg-float-head strong {
  font-family: Cinzel, "Times New Roman", serif;
  font-size: 0.92rem;
}

.crew-msg-float-status {
  margin: 2px 0 0;
  font-size: 0.62rem;
}

.crew-msg-float-actions {
  display: flex;
  gap: 4px;
}

.crew-msg-float-thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.crew-msg-float-compose {
  flex: 0 0 auto;
}

.crew-msg-float-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(201, 162, 39, 0.7) 50%);
}

body.social-mode .crew-msg-fab {
  border-color: rgba(30, 155, 255, 0.45);
  color: #d7ecff;
}

body.social-mode .crew-msg-tab.active {
  color: #7ad4ff;
}

body.social-mode .crew-msg-panel {
  border-color: rgba(30, 155, 255, 0.28);
}

@media (max-width: 720px) {
  body.social-mode .crew-messenger,
  body.social-mode .crew-msg-panel {
    right: 0;
    left: 0;
    bottom: 0;
  }
  body.social-mode .crew-msg-panel {
    width: 100vw;
    height: calc(100dvh - 52px);
    max-height: none;
    border-radius: 0;
  }
  .pete-founder-float,
  .pete-founder-float.is-phone,
  .crew-msg-float {
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0;
    z-index: 12050;
  }

  .pete-founder-resize {
    display: none;
  }

  .pete-founder-head {
    cursor: default;
  }

  .pete-founder-bubble {
    right: 12px;
    bottom: 72px;
  }
}

/* Social workspace: dock Messages near the Social frame; float mode is movable */
body.social-mode .crew-messenger:not(.is-dock-float) {
  right: max(var(--msg-dock-inset, 16px), calc((100vw - var(--ws-workspace-w, 1560px)) / 2 + 14px));
  bottom: max(var(--msg-dock-inset, 16px), 20px);
}

@media (max-width: 1180px) {
  body.social-mode .crew-messenger:not(.is-dock-float) {
    right: var(--msg-dock-inset, 14px);
    bottom: var(--msg-dock-inset, 14px);
  }
}

/* Laptop messenger — compact fab/panel, no type inflation on >=1920 */
html.ui-tier-laptop .crew-msg-fab {
  min-height: 42px;
  padding: 6px 12px 6px 6px;
  font-size: 0.74rem;
}

html.ui-tier-laptop .crew-msg-panel {
  font-size: 0.92em;
}

html.ui-tier-tablet .crew-msg-fab {
  min-height: 46px;
}

.crew-messenger.is-dock-float {
  right: auto;
  bottom: auto;
  align-items: stretch;
  pointer-events: none;
}

.crew-messenger.is-dock-float .crew-msg-fab {
  display: none;
}

#waypointRecFabRow,
.wp-rec-fab-row {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.wp-rec-fab {
  pointer-events: auto;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(201, 162, 39, 0.45);
  background: linear-gradient(180deg, #1a2436 0%, #0d141f 100%);
  color: #f0e6c8;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
}

.crew-messenger.is-founder-pete #waypointRecFab,
body.waypoint-founder-login #waypointRecFab,
body.waypoint-admin-login #waypointRecFab {
  display: none !important;
}

.wp-rec-fab-row .crew-msg-fab,
.wp-rec-fab-row .wp-rec-fab {
  pointer-events: auto;
}

.crew-messenger.is-dock-float .wp-rec-fab-row {
  display: none;
}

.crew-messenger.is-dock-float .crew-msg-panel {
  pointer-events: auto;
  position: relative;
  max-width: none;
  max-height: none;
  border-color: rgba(30, 155, 255, 0.45);
  box-shadow:
    0 0 0 1px rgba(201, 162, 39, 0.22),
    0 18px 48px rgba(0, 0, 0, 0.55);
}

.crew-messenger.is-dock-float .crew-msg-head {
  cursor: move;
}

.crew-msg-dock-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(30, 155, 255, 0.45) 50%);
  display: none;
}

.crew-messenger.is-dock-float .crew-msg-dock-resize {
  display: block;
}

.crew-msg-voice-btn {
  min-width: 40px;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(201, 162, 39, 0.4);
  background: #141c28;
  color: #f0e6c8;
  cursor: pointer;
}
.crew-msg-voice-btn.is-live {
  box-shadow: 0 0 0 2px rgba(122, 212, 255, 0.45);
}
