/* Let's Chat · WhatsApp-style shell · navy-gold ship theme */
.lc-body {
  margin: 0;
  background: #070b14;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  color: #e9edef;
}

.lc-site-nav {
  flex-shrink: 0;
}

.lc-app {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - env(safe-area-inset-top, 0px));
  max-height: 100dvh;
  overflow: hidden;
}

.lc-gate {
  max-width: 24rem;
  margin: auto;
  padding: 1.5rem 1rem;
  text-align: center;
}
.lc-gate h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #fef3c7;
  margin: 0 0 0.5rem;
}
.lc-gate__lead { color: #8696a0; margin: 0 0 1.25rem; }
.lc-gate__form { display: flex; flex-direction: column; gap: 0.5rem; text-align: left; }
.lc-gate__form label { font-size: 0.75rem; font-weight: 600; color: #d4af37; }
.lc-gate__form input {
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: none;
  background: #1f2c34;
  color: #e9edef;
  font: inherit;
}
.lc-gate__hint { font-size: 0.82rem; color: #8696a0; margin-top: 1rem; }
.lc-gate__hint a { color: #d4af37; }
.lc-gate__err { color: #ea4335; font-size: 0.85rem; margin-top: 0.75rem; }

.lc-room {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.lc-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  background: #0b141a;
  border: 1px solid rgba(212, 175, 55, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  position: relative;
}

/* —— Chat list (left / mobile home) —— */
.lc-list-pane {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  background: #111b21;
  border-right: 1px solid rgba(212, 175, 55, 0.12);
  min-height: 0;
}

.lc-list-head {
  padding: 0.65rem 0.85rem 0.5rem;
  padding-top: max(0.65rem, env(safe-area-inset-top, 0px));
  background: #1a2530;
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
  flex-shrink: 0;
}
.lc-list-head__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.lc-list-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: #fef3c7;
}
.lc-list-head__tools { display: flex; align-items: center; gap: 0.35rem; }
.lc-add-btn {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  border: none;
  background: #d4af37;
  color: #0a0f1a;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lc-add-btn[aria-expanded="true"] {
  background: #fef3c7;
}
.lc-invite-panel {
  margin: 0 0 0.45rem;
}
.lc-invite-panel[hidden] { display: none !important; }
.lc-invite__hint {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  color: #8696a0;
}
.lc-msg__approve {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0a0f1a;
  background: #d4af37;
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}
.lc-msg__approved {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: #d4af37;
}

.lc-invite {
  display: flex;
  gap: 0.35rem;
  margin: 0 0 0.35rem;
}
.lc-invite input {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(134, 150, 160, 0.35);
  background: #111b21;
  color: #e9edef;
}
.lc-btn--invite {
  flex-shrink: 0;
  font-size: 0.72rem;
  padding: 0.4rem 0.7rem;
}
.lc-invite__msg {
  font-size: 0.78rem;
  color: #d4af37;
  margin: 0 0 0.45rem;
}
.lc-invite__msg--err { color: #ea4335; }
.lc-pending {
  list-style: none;
  margin: 0 0 0.55rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.lc-pending__row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: #d6cfc4;
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
}
.lc-pending__row span { flex: 1; min-width: 0; }
.lc-pending__accept,
.lc-pending__decline {
  font-size: 0.68rem;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  padding: 0.28rem 0.45rem;
  cursor: pointer;
}
.lc-pending__accept { background: #d4af37; color: #0a0f1a; }
.lc-pending__decline { background: transparent; color: #8696a0; border: 1px solid rgba(134, 150, 160, 0.4); }

.lc-list-head__you {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: #8696a0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-list-head__dnd {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: #f87171;
}
.lc-list-head__dnd[hidden] { display: none !important; }

.lc-dnd-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  margin: 0;
  padding: 0.28rem 0.55rem 0.28rem 0.4rem;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 999px;
  background: rgba(42, 57, 66, 0.85);
  color: #e9edef;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.lc-dnd-toggle__icon {
  font-size: 0.95rem;
  line-height: 1;
}
.lc-dnd-toggle__text {
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.lc-dnd-toggle:hover {
  background: rgba(212, 175, 55, 0.14);
}
.lc-dnd-toggle[aria-pressed='true'] {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(234, 67, 53, 0.22);
  color: #fecaca;
}
.lc-dnd-toggle--compact {
  padding: 0.28rem 0.45rem;
}
.lc-dnd-toggle--compact .lc-dnd-toggle__text {
  font-size: 0.68rem;
}

.lc-chat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}
.lc-chat-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: none;
  border-bottom: 1px solid rgba(134, 150, 160, 0.12);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.lc-chat-row:hover,
.lc-chat-row[aria-current='true'] {
  background: rgba(212, 175, 55, 0.08);
}
.lc-chat-row__body { flex: 1; min-width: 0; }
.lc-chat-row__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.lc-chat-row__name {
  font-weight: 600;
  font-size: 1rem;
  color: #e9edef;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-chat-row__time {
  font-size: 0.68rem;
  color: #8696a0;
  flex-shrink: 0;
}
.lc-chat-row__preview {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: #8696a0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-chat-row__preview--dnd::before { content: '🔕 '; }

.lc-list-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: #8696a0;
  font-size: 0.9rem;
}

/* —— Thread pane (right / mobile slide-in) —— */
.lc-thread-pane {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #0b141a;
  position: relative;
}

.lc-thread-idle {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  color: #8696a0;
  background:
    radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.04), transparent 45%),
    #0b141a;
}
.lc-thread-idle__sub { font-size: 0.82rem; margin-top: 0.35rem; color: #667781; }

.lc-thread-active {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.lc-thread-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: #1a2530;
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
  flex-shrink: 0;
}
.lc-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #d4af37;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.lc-thread-head__info { flex: 1; min-width: 0; }
.lc-thread-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #fef3c7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-thread__status {
  margin: 0.1rem 0 0;
  font-size: 0.72rem;
  color: #8696a0;
}
.lc-thread-head__actions {
  display: flex;
  gap: 0.15rem;
  flex-shrink: 0;
}

.lc-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4af37, #8b6914);
  color: #0b141a;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lc-avatar--sm {
  width: 3rem;
  height: 3rem;
  font-size: 1.05rem;
}

.lc-icon-btn {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
}
.lc-icon-btn:hover { background: rgba(212, 175, 55, 0.12); }
.lc-icon-btn[aria-pressed='true'] { background: rgba(234, 67, 53, 0.2); }
.lc-icon-btn--danger { color: #ea4335; }
.lc-icon-btn[hidden] { display: none !important; }

/* Message area · WhatsApp wallpaper feel */
.lc-messages {
  flex: 1;
  overflow-y: auto;
  margin: 0;
  padding: 0.65rem 0.75rem 0.85rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background-color: #0b141a;
  background-image:
    radial-gradient(rgba(212, 175, 55, 0.035) 1px, transparent 1px);
  background-size: 18px 18px;
}

.lc-msg {
  max-width: min(85%, 22rem);
  padding: 0.35rem 0.55rem 0.28rem 0.65rem;
  border-radius: 8px;
  font-size: 0.92rem;
  line-height: 1.4;
  word-break: break-word;
  position: relative;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}
.lc-msg--mine {
  align-self: flex-end;
  background: #005c4b;
  color: #e9edef;
  border-radius: 8px 8px 2px 8px;
}
.lc-msg--theirs {
  align-self: flex-start;
  background: #1f2c34;
  color: #e9edef;
  border-radius: 8px 8px 8px 2px;
}
.lc-msg__text { display: block; padding-right: 3rem; }
.lc-msg__time {
  float: right;
  margin-left: 0.5rem;
  font-size: 0.62rem;
  color: rgba(233, 237, 239, 0.55);
  line-height: 1.6;
  vertical-align: bottom;
}
.lc-msg__img {
  display: block;
  max-width: 100%;
  border-radius: 6px;
  margin-bottom: 0.2rem;
}
.lc-msg__file {
  display: inline-flex;
  color: #d4af37;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
}

/* Bottom compose bar */
.lc-compose {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.55rem;
  padding-bottom: max(0.45rem, env(safe-area-inset-bottom, 0px));
  background: #1a2530;
  border-top: 1px solid rgba(212, 175, 55, 0.15);
  flex-shrink: 0;
}
.lc-compose__attach { cursor: pointer; flex-shrink: 0; }
.lc-compose input[type='text'] {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.85rem;
  border: none;
  border-radius: 999px;
  background: #2a3942;
  color: #e9edef;
  font: inherit;
  font-size: 0.95rem;
}
.lc-compose input::placeholder { color: #8696a0; }
.lc-send-btn {
  all: unset;
  cursor: pointer;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: #d4af37;
  color: #0b141a;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lc-send-btn:active { transform: scale(0.96); }

.lc-call-panel {
  position: relative;
  flex-shrink: 0;
  background: #000;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
}
.lc-call-panel[hidden] { display: none !important; }
.lc-call-panel__remote {
  width: 100%;
  max-height: 10rem;
  object-fit: cover;
  display: block;
}
.lc-call-panel__local {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  width: 4.5rem;
  height: 3.25rem;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid #d4af37;
}
.lc-call-panel__local[hidden] { display: none !important; }
.lc-call-panel__label {
  margin: 0;
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
  color: #8696a0;
  background: rgba(11, 20, 26, 0.9);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Mobile: list OR thread full width */
@media (max-width: 767px) {
  .lc-shell { border: none; max-width: none; }
  .lc-list-pane { width: 100%; }
  .lc-thread-pane {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 2;
  }
  .lc-shell.lc-shell--in-thread .lc-list-pane { display: none; }
  .lc-shell.lc-shell--in-thread .lc-thread-pane { display: flex; }
  .lc-thread-idle { display: none; }
  .lc-back-btn { display: flex; }
}

/* Desktop: split pane like WhatsApp Web */
@media (min-width: 768px) {
  .lc-list-pane {
    width: 36%;
    max-width: 22rem;
    flex-shrink: 0;
  }
  .lc-back-btn { display: none; }
  .lc-thread-pane { display: flex !important; flex: 1; }
  .lc-shell.lc-shell--in-thread .lc-thread-idle { display: none; }
  .lc-shell:not(.lc-shell--in-thread) .lc-thread-active { display: none; }
  .lc-shell:not(.lc-shell--in-thread) .lc-thread-idle { display: flex; }
}

/* Per-peer unread badge in the chat list */
.lc-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25em;
  height: 1.25em;
  padding: 0 0.3em;
  border-radius: 999px;
  background: #d4af37;
  color: #1a1209;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  margin-left: auto;
  flex-shrink: 0;
  animation: lc-badge-pop 0.2s ease;
}

@keyframes lc-badge-pop {
  from { transform: scale(0.6); opacity: 0.5; }
  to   { transform: scale(1);   opacity: 1; }
}
