/* ── Yap DM page styles ──────────────────────────────────────────────────── */

/* Strip shell padding so yap page can fill the viewport exactly */
.shell-layout:has(.yap-page) { padding-left: 0; padding-right: 0; }
.shell-main:has(.yap-page)   { padding: 0; overflow: hidden; max-width: none; margin: 0; }

/* Page layout: two-panel flex row filling the shell-main area */
.yap-page {
  display: flex;
  flex-direction: row;
  /* Mobile: topbar is 3.5rem tall */
  height: calc(100dvh - 3.5rem);
  overflow: hidden;
  position: relative;
}
/* Desktop (≥1024px): topbar is hidden, page fills full height */
@media (min-width: 1024px) {
  .yap-page { height: 100dvh; }
}

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.yap-sidebar {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid oklch(0.92 0.04 15 / 0.1);
  background: oklch(0.2 0.08 18 / 0.6);
  backdrop-filter: blur(8px);
  /* no overflow: hidden — it would clip the search dropdown */
}

/* Search */
.yap-search-wrap {
  position: relative;
  padding: 0.875rem 0.875rem 0.5rem;
  flex-shrink: 0;
  z-index: 100;
}
.yap-search-icon {
  position: absolute;
  left: 1.375rem;
  top: 50%;
  transform: translateY(-20%);
  width: 1rem;
  height: 1rem;
  color: oklch(0.92 0.04 15 / 0.4);
  pointer-events: none;
}
.yap-search-input {
  width: 100%;
  padding: 0.625rem 0.875rem 0.625rem 2.25rem;
  background: oklch(0.92 0.04 15 / 0.06);
  border: 1px solid oklch(0.92 0.04 15 / 0.12);
  border-radius: 0.75rem;
  color: var(--rose);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.yap-search-input::placeholder { color: oklch(0.92 0.04 15 / 0.35); }
.yap-search-input:focus {
  border-color: oklch(0.92 0.04 15 / 0.3);
  background: oklch(0.92 0.04 15 / 0.09);
}

/* Search results dropdown — positioned inside .yap-search-wrap */
.yap-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 0.5rem); /* just below the input, slight overlap */
  z-index: 200;
  background: oklch(0.19 0.08 18);
  border: 1px solid oklch(0.92 0.04 15 / 0.15);
  border-top: none;
  border-radius: 0 0 0.875rem 0.875rem;
  box-shadow: 0 8px 32px oklch(0 0 0 / 0.55);
  max-height: 18rem;
  overflow-y: auto;
}
.yap-search-results::-webkit-scrollbar { width: 4px; }
.yap-search-results::-webkit-scrollbar-track { background: transparent; }
.yap-search-results::-webkit-scrollbar-thumb { background: oklch(0.92 0.04 15 / 0.2); border-radius: 2px; }

.yap-search-result {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  cursor: pointer;
  transition: background 0.12s;
}
.yap-search-result:hover { background: oklch(0.92 0.04 15 / 0.07); }
.yap-search-result-info {
  flex: 1;
  min-width: 0;
}
.yap-search-result-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--rose);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.yap-search-result-handle {
  font-size: 0.75rem;
  color: oklch(0.92 0.04 15 / 0.45);
  font-family: var(--font-mono);
}
.yap-search-yap-btn {
  padding: 0.3rem 0.7rem;
  background: oklch(0.55 0.22 22 / 0.15);
  border: 1px solid oklch(0.55 0.22 22 / 0.3);
  border-radius: 0.5rem;
  color: var(--rose-hot);
  font-size: 0.75rem;
  font-family: var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.yap-search-yap-btn:hover {
  background: oklch(0.55 0.22 22 / 0.25);
  border-color: oklch(0.55 0.22 22 / 0.5);
}
.yap-search-empty {
  padding: 1rem 0.875rem;
  color: oklch(0.92 0.04 15 / 0.4);
  font-size: 0.8125rem;
  text-align: center;
  font-family: var(--font-mono);
}

/* Tabs */
.yap-tabs {
  display: flex;
  flex-direction: row;
  flex-shrink: 0;
  border-bottom: 1px solid oklch(0.92 0.04 15 / 0.1);
  margin-top: 0.25rem;
}
.yap-tab {
  flex: 1;
  padding: 0.625rem 0.5rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: oklch(0.92 0.04 15 / 0.45);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.yap-tab:hover { color: var(--rose); }
.yap-tab.active {
  color: var(--rose);
  border-bottom-color: var(--rose-hot);
}

/* Conversation list */
.yap-conv-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.yap-conv-list::-webkit-scrollbar { width: 4px; }
.yap-conv-list::-webkit-scrollbar-track { background: transparent; }
.yap-conv-list::-webkit-scrollbar-thumb { background: oklch(0.92 0.04 15 / 0.15); border-radius: 2px; }

.yap-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 2.5rem 1rem;
  color: oklch(0.92 0.04 15 / 0.35);
  font-size: 0.8125rem;
  font-family: var(--font-mono);
}
.yap-loading svg {
  width: 1.5rem;
  height: 1.5rem;
  opacity: 0.4;
  animation: spin 2s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.yap-conv-empty {
  padding: 2rem 1rem;
  color: oklch(0.92 0.04 15 / 0.35);
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  text-align: center;
  line-height: 1.6;
}

.yap-conv-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid oklch(0.92 0.04 15 / 0.05);
  position: relative;
  text-decoration: none;
  color: inherit;
}
.yap-conv-item:hover { background: oklch(0.92 0.04 15 / 0.06); }
.yap-conv-item.active { background: oklch(0.92 0.04 15 / 0.1); }

.yap-conv-av {
  position: relative;
  flex-shrink: 0;
}
.yap-conv-pending-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0.625rem;
  height: 0.625rem;
  background: oklch(0.75 0.18 65);
  border-radius: 9999px;
  border: 2px solid oklch(0.2 0.08 18);
}

.yap-conv-info {
  flex: 1;
  min-width: 0;
}
.yap-conv-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem;
  margin-bottom: 0.125rem;
}
.yap-conv-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--rose);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.yap-conv-time {
  font-size: 0.6875rem;
  color: oklch(0.92 0.04 15 / 0.4);
  flex-shrink: 0;
  font-family: var(--font-mono);
}
.yap-conv-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}
.yap-conv-preview {
  font-size: 0.75rem;
  color: oklch(0.92 0.04 15 / 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.yap-conv-typing {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--rose, oklch(0.65 0.22 22));
  font-style: italic;
}
.yap-conv-typing i {
  width: 0.65rem;
  height: 0.65rem;
  flex: 0 0 auto;
  background: var(--rose-hot, oklch(0.65 0.25 15));
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  filter: drop-shadow(0 0 0.3rem oklch(0.65 0.25 15 / 0.8));
  animation: yap-conv-star-pulse 1.25s ease-in-out infinite;
}
.yap-conv-unread .yap-conv-name {
  font-weight: 700;
}
.yap-conv-unread .yap-conv-preview {
  color: oklch(0.92 0.04 15 / 0.7);
  font-weight: 500;
}
.yap-conv-unread-count {
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  background: var(--rose-hot, oklch(0.65 0.25 15));
  border-radius: 9999px;
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

/* ── New Messages divider ───────────────────────────────────────────────── */
.yap-new-msgs-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  cursor: pointer;
  user-select: none;
}
.yap-new-msgs-divider::before,
.yap-new-msgs-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rose-hot, oklch(0.65 0.25 15));
  opacity: 0.45;
}
.yap-new-msgs-divider span {
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  color: var(--rose-hot, oklch(0.65 0.25 15));
  font-weight: 600;
  letter-spacing: 0.07em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Message row + action buttons ───────────────────────────────────────── */
/* .yap-msg is a column; .yap-msg-row is a flex row containing bubble + actions */
.yap-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 0.3rem;
}
.yap-msg-me    .yap-msg-row { flex-direction: row; }
.yap-msg-other .yap-msg-row { flex-direction: row; }

.yap-msg-avatar { flex-shrink: 0; }

/* Tightly wrap bubble so hover bar positions correctly */
.yap-bubble-outer { position: relative; display: inline-block; max-width: 100%; }

/* Hover reaction bar — floats above the bubble */
.yap-msg-hover-reactions {
  position: absolute;
  bottom: calc(100% + 5px);
  background: oklch(0.16 0.06 18);
  border: 1px solid oklch(0.92 0.04 15 / 0.15);
  border-radius: 9999px;
  padding: 0.2rem 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s;
  z-index: 20;
  white-space: nowrap;
  box-shadow: 0 4px 14px oklch(0.04 0.06 18 / 0.45);
}
.yap-msg-me    .yap-msg-hover-reactions { right: 0; }
.yap-msg-other .yap-msg-hover-reactions { left: 0; }

/* Show bar when hovering anywhere in .yap-msg-row */
.yap-msg-row:hover .yap-msg-hover-reactions { opacity: 1; pointer-events: auto; }

.yap-hr-emoji {
  background: none;
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.15rem 0.2rem;
  border-radius: 9999px;
  line-height: 1;
  transition: transform 0.12s;
}
.yap-hr-emoji:hover { transform: scale(1.4); }
.yap-hr-more {
  background: none;
  border: none;
  font-size: 0.8rem;
  color: oklch(0.92 0.04 15 / 0.5);
  cursor: pointer;
  padding: 0.15rem 0.3rem;
  border-radius: 9999px;
  line-height: 1;
  transition: color 0.12s;
}
.yap-hr-more:hover { color: oklch(0.92 0.04 15 / 0.85); }

/* ⋯ more button (only this remains as flex sibling) */
.yap-msg-actions-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s;
}
.yap-msg-row:hover .yap-msg-actions-wrap { opacity: 1; pointer-events: auto; }

.yap-msg-more-btn {
  background: oklch(0.2 0.05 18);
  border: 1px solid oklch(0.92 0.04 15 / 0.1);
  border-radius: 9999px;
  color: oklch(0.92 0.04 15 / 0.75);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.12s;
}
.yap-msg-more-btn:hover { background: oklch(0.27 0.06 18); }

/* ── Context menu ───────────────────────────────────────────────────────── */
.yap-ctx-menu {
  position: fixed;
  z-index: 9800;
  background: oklch(0.18 0.06 18);
  border: 1px solid oklch(0.92 0.04 15 / 0.12);
  border-radius: 0.75rem;
  padding: 0.375rem;
  min-width: 180px;
  box-shadow: 0 8px 32px oklch(0.05 0.06 18 / 0.5);
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.yap-ctx-menu[hidden] { display: none; }
.yap-ctx-item {
  background: none;
  border: none;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  color: oklch(0.92 0.04 15 / 0.85);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background 0.1s;
}
.yap-ctx-item:hover { background: oklch(0.92 0.04 15 / 0.08); }

/* ── Quick reaction picker ──────────────────────────────────────────────── */
.yap-react-picker {
  position: fixed;
  z-index: 9800;
  background: oklch(0.18 0.06 18);
  border: 1px solid oklch(0.92 0.04 15 / 0.12);
  border-radius: 9999px;
  padding: 0.375rem 0.625rem;
  display: flex;
  gap: 0.25rem;
  box-shadow: 0 6px 24px oklch(0.05 0.06 18 / 0.4);
}
.yap-react-picker[hidden] { display: none; }
.yap-rp-emoji,
.yap-rp-more {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: 9999px;
  padding: 0.2rem 0.3rem;
  transition: transform 0.1s, background 0.1s;
  line-height: 1;
}
.yap-rp-emoji:hover,
.yap-rp-more:hover { transform: scale(1.3); background: oklch(0.92 0.04 15 / 0.08); }
.yap-rp-more { font-size: 0.9rem; color: oklch(0.92 0.04 15 / 0.6); }

/* ── Reactions display ──────────────────────────────────────────────────── */
.yap-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}
.yap-reaction {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  background: oklch(0.92 0.04 15 / 0.08);
  border: 1px solid oklch(0.92 0.04 15 / 0.1);
  border-radius: 9999px;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background 0.12s;
  line-height: 1.3;
}
.yap-reaction span { font-size: 0.7rem; color: oklch(0.92 0.04 15 / 0.6); }
.yap-reaction.mine { background: oklch(0.65 0.25 15 / 0.18); border-color: oklch(0.65 0.25 15 / 0.35); }
.yap-reaction:hover { background: oklch(0.92 0.04 15 / 0.14); }

/* ── Reply quote (sibling above the bubble, inside .yap-bubble-outer) ────── */
.yap-quote {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.3rem 0.625rem;
  border-left: 3px solid var(--rose-hot, oklch(0.65 0.25 15));
  background: oklch(0.92 0.04 15 / 0.07);
  border-radius: 0.5rem;
  margin-bottom: 0.2rem;
  cursor: pointer;
  max-width: 100%;
}
.yap-quote-author { font-size: 0.6875rem; font-weight: 700; color: var(--rose-hot, oklch(0.65 0.25 15)); font-family: var(--font-mono); }
.yap-quote-text   { font-size: 0.75rem; color: oklch(0.92 0.04 15 / 0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.yap-quote:hover { background: oklch(0.92 0.04 15 / 0.11); }

/* ── Reply/edit bar ─────────────────────────────────────────────────────── */
.yap-reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.75rem;
  background: oklch(0.16 0.06 18);
  border-top: 1px solid oklch(0.92 0.04 15 / 0.07);
  border-left: 3px solid var(--rose-hot, oklch(0.65 0.25 15));
  gap: 0.5rem;
}
.yap-reply-bar[hidden] { display: none; }
.yap-reply-bar-inner { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.yap-reply-bar-label { font-size: 0.6875rem; font-weight: 700; color: var(--rose-hot, oklch(0.65 0.25 15)); font-family: var(--font-mono); }
.yap-reply-bar-text  { font-size: 0.75rem; color: oklch(0.92 0.04 15 / 0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yap-reply-bar-close { background: none; border: none; color: oklch(0.92 0.04 15 / 0.4); cursor: pointer; padding: 0.25rem; flex-shrink: 0; }
.yap-reply-bar-close svg { width: 1rem; height: 1rem; }
.yap-reply-bar-close:hover { color: oklch(0.92 0.04 15 / 0.8); }

/* ── Message meta row (time + receipt) ─────────────────────────────────── */
.yap-msg-meta {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.1rem;
}
.yap-msg-me    .yap-msg-meta { justify-content: flex-end; }
.yap-msg-other .yap-msg-meta { justify-content: flex-start; }

/* ── Read receipts ──────────────────────────────────────────────────────── */
.yap-receipt {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  display: inline-block;
}

/* Sending: clock, dim */
.yap-receipt-sending {
  color: oklch(0.92 0.04 15 / 0.3);
}

/* Delivered: left-half circle, dim */
.yap-receipt-delivered {
  color: oklch(0.92 0.04 15 / 0.4);
}

/* Received: full circle, medium brightness (device got it) */
.yap-receipt-received {
  color: oklch(0.92 0.04 15 / 0.65);
}

/* Seen: full circle, glowing red */
.yap-receipt-seen {
  filter: drop-shadow(0 0 3px oklch(0.65 0.25 15 / 0.7));
  animation: receiptGlow 2.5s ease-in-out infinite;
}
@keyframes receiptGlow {
  0%, 100% { filter: drop-shadow(0 0 3px oklch(0.65 0.25 15 / 0.6)); }
  50%       { filter: drop-shadow(0 0 6px oklch(0.65 0.25 15 / 0.95)); }
}

/* ── Deleted message ────────────────────────────────────────────────────── */
.yap-bubble-deleted {
  opacity: 0.45;
  font-style: italic;
  font-size: 0.8125rem;
}
/* ── Edited label ───────────────────────────────────────────────────────── */
.yap-edited { font-size: 0.625rem; opacity: 0.45; margin-left: 0.25rem; font-style: italic; }

/* ── Highlight flash on scroll-to-reply ─────────────────────────────────── */
@keyframes msgHighlight {
  0%, 100% { background: transparent; }
  40%       { background: oklch(0.65 0.25 15 / 0.15); }
}
.yap-msg-highlight { animation: msgHighlight 1.4s ease; border-radius: 0.5rem; }

/* ── Media wrap (for lightbox trigger) ──────────────────────────────────── */
.yap-media-wrap { position: relative; cursor: pointer; display: inline-block; }
.yap-play-btn {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  pointer-events: none;
}
.yap-lb-trigger { cursor: pointer; }

/* ── Lightbox ───────────────────────────────────────────────────────────── */
.yap-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: oklch(0.04 0.04 18 / 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
}
.yap-lightbox[hidden] { display: none; }
.yap-lightbox-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: oklch(0.92 0.04 15 / 0.12);
  border: none;
  color: white;
  border-radius: 9999px;
  width: 2.5rem; height: 2.5rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.yap-lightbox-close svg { width: 1.25rem; height: 1.25rem; }
.yap-lightbox-close:hover { background: oklch(0.92 0.04 15 / 0.22); }
.yap-lightbox-img {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 0.5rem;
}
.yap-lightbox-vid {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: 0.5rem;
  outline: none;
}

/* ── Mic button active state ────────────────────────────────────────────── */
.yap-toolbar-btn.recording {
  color: #ef4444;
  background: oklch(0.55 0.22 22 / 0.15);
}

/* ── Voice recording bar ────────────────────────────────────────────────── */
.yap-recording-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  min-height: 2.75rem;
}
.yap-recording-bar[hidden] { display: none; }
.yap-rec-cancel {
  background: none;
  border: none;
  color: oklch(0.92 0.04 15 / 0.45);
  cursor: pointer;
  padding: 0.2rem;
  flex-shrink: 0;
}
.yap-rec-cancel svg { width: 1rem; height: 1rem; }
.yap-rec-cancel:hover { color: oklch(0.92 0.04 15 / 0.8); }
.yap-rec-pulse {
  width: 10px; height: 10px; flex-shrink: 0;
  border-radius: 9999px;
  background: #ef4444;
  animation: recPulse 1s ease-in-out infinite;
}
@keyframes recPulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%       { transform: scale(1.6); opacity: 0.45; }
}
.yap-rec-timer {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: oklch(0.92 0.04 15 / 0.85);
  min-width: 2.5rem;
}
.yap-rec-label {
  font-size: 0.8125rem;
  color: oklch(0.92 0.04 15 / 0.4);
  flex: 1;
}
.yap-rec-send {
  background: oklch(0.55 0.22 22 / 0.9);
  border: none;
  border-radius: 9999px;
  color: white;
  width: 2.25rem; height: 2.25rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s;
}
.yap-rec-send:hover { background: oklch(0.6 0.24 22); }
.yap-rec-send svg { width: 0.875rem; height: 0.875rem; }

/* ── Audio message ──────────────────────────────────────────────────────── */
.yap-audio-msg { padding: 0.5rem 0.625rem !important; }
.yap-audio-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 180px;
  max-width: 260px;
}
.yap-audio-icon {
  width: 1.1rem; height: 1.1rem;
  flex-shrink: 0;
  opacity: 0.6;
}
.yap-audio-play-btn {
  background: oklch(0.92 0.04 15 / 0.12);
  border: none;
  border-radius: 9999px;
  width: 2rem; height: 2rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: inherit;
  transition: background 0.12s;
}
.yap-audio-play-btn:hover { background: oklch(0.92 0.04 15 / 0.22); }
.yap-audio-play-btn svg { width: 0.75rem; height: 0.75rem; }
.yap-audio-track {
  flex: 1;
  height: 3px;
  background: oklch(0.92 0.04 15 / 0.18);
  border-radius: 9999px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.yap-audio-progress {
  height: 100%;
  width: 0%;
  background: currentColor;
  opacity: 0.6;
  border-radius: 9999px;
  transition: width 0.1s linear;
}
.yap-audio-dur {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  opacity: 0.55;
  flex-shrink: 0;
  min-width: 2.25rem;
  text-align: right;
}

/* ── Avatar chip ────────────────────────────────────────────────────────── */
.yap-avatar {
  position: relative;
  border-radius: 9999px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-family: var(--font-serif);
  background: oklch(0.35 0.12 18);
  color: var(--rose);
  flex-shrink: 0;
}
.yap-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.yap-avatar.sz-28 { width: 1.75rem; height: 1.75rem; font-size: 0.75rem; }
.yap-avatar.sz-36 { width: 2.25rem; height: 2.25rem; font-size: 0.875rem; }
.yap-avatar.sz-40 { width: 2.5rem; height: 2.5rem; font-size: 1rem; }
.yap-avatar.sz-48 { width: 3rem; height: 3rem; font-size: 1.2rem; }
.yap-avatar.sz-64 { width: 4rem; height: 4rem; font-size: 1.5rem; }
.yap-avatar.sz-80 { width: 5rem; height: 5rem; font-size: 1.75rem; }
.yap-avatar.sz-96 { width: 6rem; height: 6rem; font-size: 2.1rem; }

/* ── Main panel ─────────────────────────────────────────────────────────── */
.yap-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Empty state */
.yap-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  color: oklch(0.92 0.04 15 / 0.35);
}
.yap-empty-badge {
  position: relative;
  width: 5.5rem;
  height: 5.5rem;
  display: grid;
  place-items: center;
  border-radius: 9999px;
  background: linear-gradient(145deg, rgb(255 45 104 / 0.22), rgb(150 16 59 / 0.12));
  border: 1px solid rgb(255 83 125 / 0.28);
  color: var(--yap-hot, var(--rose-hot));
  box-shadow: 0 0 44px rgb(255 45 104 / 0.2);
  margin-bottom: 0.25rem;
}
.yap-empty-badge svg {
  position: relative;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
}
.yap-empty-badge-ring {
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  border: 1px solid rgb(255 83 125 / 0.3);
  animation: yap-empty-pulse 2.6s ease-out infinite;
}
.yap-empty-badge-ring-2 { animation-delay: 1.3s; }
@keyframes yap-empty-pulse {
  0%   { transform: scale(0.88); opacity: 0.65; }
  100% { transform: scale(1.4); opacity: 0; }
}
.yap-empty-text {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  text-align: center;
}
.yap-empty-sub {
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  color: oklch(0.92 0.04 15 / 0.4);
  text-align: center;
}
.yap-empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.65rem 1.3rem;
  border-radius: 9999px;
  border: 1px solid rgb(255 83 125 / 0.35);
  background: linear-gradient(145deg, rgb(255 45 104 / 0.92), rgb(150 16 59 / 0.96));
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.yap-empty-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgb(255 45 104 / 0.32); }
.yap-empty-cta:active { transform: translateY(0); }
.yap-empty-cta svg { width: 1rem; height: 1rem; }

/* ── Chat view ──────────────────────────────────────────────────────────── */
.yap-chat {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  height: 100%;
}

.yap-chat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid oklch(0.92 0.04 15 / 0.1);
  background: oklch(0.2 0.08 18 / 0.7);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}
.yap-back-btn {
  display: none; /* shown on mobile */
}
.yap-chat-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.yap-chat-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--rose);
  font-family: var(--font-serif);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.yap-chat-handle {
  font-size: 0.75rem;
  color: oklch(0.92 0.04 15 / 0.45);
  font-family: var(--font-mono);
}

/* Messages area */
.yap-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.yap-messages::-webkit-scrollbar { width: 4px; }
.yap-messages::-webkit-scrollbar-track { background: transparent; }
.yap-messages::-webkit-scrollbar-thumb { background: oklch(0.92 0.04 15 / 0.15); border-radius: 2px; }

.yap-msg {
  display: flex;
  flex-direction: column;
  max-width: 75%;
  gap: 0.2rem;
}
.yap-msg-me    { align-self: flex-end;   align-items: flex-end; }
.yap-msg-other { align-self: flex-start; align-items: flex-start; }

.yap-bubble {
  padding: 0.5rem 0.875rem;
  border-radius: 1.125rem;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
  max-width: 100%;
}
.yap-bubble-me {
  background: oklch(0.55 0.22 22 / 0.55);
  border: 1px solid oklch(0.55 0.22 22 / 0.65);
  color: #fff4f2;
  border-bottom-right-radius: 0.25rem;
}
.yap-bubble-other {
  background: oklch(0.3 0.1 18 / 0.9);
  border: 1px solid oklch(0.92 0.04 15 / 0.12);
  color: oklch(0.92 0.04 15 / 0.92);
  border-bottom-left-radius: 0.25rem;
}
.yap-msg-time {
  font-size: 0.6875rem;
  color: oklch(0.92 0.04 15 / 0.3);
  font-family: var(--font-mono);
  padding: 0 0.125rem;
  white-space: nowrap;
}

.yap-typing-star {
  display: grid;
  place-items: center;
  min-width: 3.5rem;
  min-height: 2.55rem;
  padding: 0.35rem 0.75rem;
  overflow: visible;
}
.yap-typing-star-stage {
  position: relative;
  display: block;
  width: 2rem;
  height: 1.75rem;
}
.yap-typing-star-stage i {
  position: absolute;
  display: block;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}
.yap-typing-star-core {
  left: 50%;
  top: 50%;
  width: 1.2rem;
  height: 1.2rem;
  background: linear-gradient(145deg, #ff7899 0%, var(--rose-hot, #e60046) 52%, #a80032 100%);
  filter: drop-shadow(0 0 0.25rem rgb(255 25 84 / 0.9)) drop-shadow(0 0 0.65rem rgb(255 25 84 / 0.45));
  animation: yap-typing-star-breathe 1.25s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.yap-typing-star-spark {
  width: 0.38rem;
  height: 0.38rem;
  background: #ffb5c8;
  filter: drop-shadow(0 0 0.28rem #ff2d67);
  opacity: 0;
}
.yap-typing-star-spark-one {
  left: 0.05rem;
  top: 0.15rem;
  animation: yap-typing-star-spark-one 1.25s ease-out infinite;
}
.yap-typing-star-spark-two {
  right: 0;
  bottom: 0.05rem;
  animation: yap-typing-star-spark-two 1.25s 0.24s ease-out infinite;
}
@keyframes yap-typing-star-breathe {
  0%, 100% { transform: translate(-50%, -50%) rotate(-12deg) scale(0.72); opacity: 0.55; }
  38% { transform: translate(-50%, -50%) rotate(8deg) scale(1.16); opacity: 1; }
  62% { transform: translate(-50%, -50%) rotate(0deg) scale(0.94); opacity: 0.88; }
}
@keyframes yap-typing-star-spark-one {
  0%, 24%, 100% { transform: translate(0.35rem, 0.35rem) scale(0.2) rotate(0deg); opacity: 0; }
  48% { transform: translate(0, 0) scale(1) rotate(30deg); opacity: 0.95; }
  72% { transform: translate(-0.15rem, -0.12rem) scale(0.35) rotate(55deg); opacity: 0; }
}
@keyframes yap-typing-star-spark-two {
  0%, 24%, 100% { transform: translate(-0.35rem, -0.3rem) scale(0.2) rotate(0deg); opacity: 0; }
  48% { transform: translate(0, 0) scale(0.9) rotate(-28deg); opacity: 0.85; }
  72% { transform: translate(0.12rem, 0.12rem) scale(0.3) rotate(-52deg); opacity: 0; }
}
@keyframes yap-conv-star-pulse {
  0%, 100% { transform: rotate(-10deg) scale(0.75); opacity: 0.55; }
  45% { transform: rotate(8deg) scale(1.15); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .yap-conv-typing i,
  .yap-typing-star-stage i { animation: none; }
  .yap-typing-star-core { transform: translate(-50%, -50%); opacity: 1; }
  .yap-typing-star-spark { display: none; }
}

/* --------------------------------------------------------------------------
   Yap: responsive inbox and conversation workspace
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  body.shell-page-yap .shell-layout:has(.yap-page) {
    min-height: 0;
    height: calc(100dvh - 3.75rem - env(safe-area-inset-top));
  }
  body.shell-page-yap .shell-main:has(.yap-page) { width: 100%; height: 100%; }
  .yap-page { height: 100%; border-top: 1px solid rgb(255 83 125 / 0.1); }
  .yap-sidebar { width: min(22rem, 40vw) !important; }
  .yap-search-input { min-height: 2.75rem !important; font-size: 1rem !important; }
  .yap-conv-item { min-height: 4.5rem !important; }
  .yap-tab { min-height: 2.9rem !important; }
  .yap-header-icon { width: 2.75rem !important; height: 2.75rem !important; }
  .yap-toolbar-btn { width: 2.75rem !important; height: 2.75rem !important; }
  .yap-send-btn { width: 3rem !important; height: 3rem !important; }
}

@media (max-width: 760px) {
  body.shell-page-yap .shell-layout:has(.yap-page) { width: 100%; padding: 0; }
  .yap-page { isolation: isolate; }
  .yap-sidebar {
    position: absolute;
    inset: 0;
    z-index: 12;
    width: 100% !important;
    border-right: 0;
    background:
      radial-gradient(circle at 80% 0, rgb(255 45 104 / 0.12), transparent 18rem),
      rgb(27 0 9 / 0.96);
    transition: transform 0.28s cubic-bezier(0.22, 0.8, 0.25, 1);
  }
  .yap-sidebar.hidden-mobile { transform: translateX(-100%); }
  .yap-search-wrap { padding: 0.85rem 0.75rem 0.6rem !important; }
  .yap-search-input { height: 3rem !important; padding-left: 2.7rem !important; border-radius: 0.9rem !important; }
  .yap-search-icon { left: 1.65rem !important; top: 2.33rem !important; }
  .yap-tabs { min-height: 3.35rem !important; padding-inline: 0.55rem; }
  .yap-tab { min-height: 3.15rem !important; font-size: 0.88rem !important; }
  .yap-conv-list { padding: 0.5rem 0.55rem max(1rem, env(safe-area-inset-bottom)) !important; }
  .yap-conv-item { min-height: 4.65rem !important; padding: 0.7rem !important; border-radius: 0.9rem !important; }
  .yap-conv-av .yap-avatar.sz-40 { width: 2.8rem !important; height: 2.8rem !important; }
  .yap-conv-name { font-size: 0.96rem !important; }
  .yap-conv-preview,
  .yap-conv-preview-text { font-size: 0.8rem !important; }

  .yap-main { width: 100%; }
  .yap-empty { padding: 1.25rem; }
  .yap-empty-cta { min-height: 3rem; }
  .yap-chat-header {
    min-height: 4.4rem !important;
    padding: 0.65rem 0.7rem !important;
    gap: 0.45rem !important;
    background: rgb(37 0 13 / 0.88) !important;
    backdrop-filter: blur(18px) !important;
  }
  .yap-back-btn { display: grid; width: 2.75rem; height: 2.75rem; flex: 0 0 auto; }
  .yap-chat-avatar .yap-avatar.sz-40 { width: 2.45rem !important; height: 2.45rem !important; }
  .yap-chat-meta { max-width: min(36vw, 11rem); }
  .yap-header-actions { margin-left: auto; gap: 0.3rem !important; }
  .yap-header-icon { width: 2.5rem !important; height: 2.5rem !important; }

  .yap-messages { padding: 0.85rem 0.65rem 0.6rem !important; scroll-padding-bottom: 1rem; }
  .yap-msg,
  .yap-msg-me { max-width: 88% !important; }
  .yap-bubble { font-size: 0.94rem !important; line-height: 1.42 !important; }
  .yap-msg-avatar .yap-avatar,
  .yap-msg-avatar .yap-avatar.sz-36 { width: 1.8rem !important; height: 1.8rem !important; }

  .yap-input-area,
  .yap-waiting,
  .yap-request-card {
    margin: 0 0.5rem max(0.5rem, env(safe-area-inset-bottom)) !important;
    border-radius: 1rem !important;
  }
  .yap-input-main { min-height: 6.8rem !important; padding: 0.7rem !important; }
  .yap-input-row { padding-right: 3.5rem !important; }
  .yap-textarea { min-height: 2.8rem; max-height: 7rem; font-size: 1rem !important; }
  .yap-input-toolbar { gap: 0.4rem !important; }
  .yap-toolbar-btn { width: 2.5rem !important; height: 2.5rem !important; }
  .yap-send-btn { right: 0.7rem !important; bottom: 0.7rem !important; width: 3rem !important; height: 3rem !important; }
  .yap-emoji-picker { left: 0.5rem; right: 0.5rem; width: auto; max-height: 16rem; }

  .yap-info-panel {
    position: absolute;
    inset: 0;
    width: 100% !important;
    z-index: 60;
    border: 0 !important;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .yap-info-header { position: sticky; top: 0; z-index: 2; min-height: 4rem; background: rgb(39 0 14 / 0.9); backdrop-filter: blur(18px); }
  .yap-info-close-btn { width: 2.75rem; height: 2.75rem; }
}

@media (max-width: 430px) {
  .yap-chat-meta { max-width: 30vw; }
  .yap-chat-handle { display: none; }
  .yap-header-icon { width: 2.4rem !important; height: 2.4rem !important; }
  .yap-msg,
  .yap-msg-me { max-width: 92% !important; }
  .yap-toolbar-btn { width: 2.35rem !important; height: 2.35rem !important; }
}

/* Mobile Yap is two explicit screens, not a sliding split view:
   1) conversations, 2) the selected chat. */
@media (max-width: 760px) {
  .yap-sidebar {
    position: relative !important;
    inset: auto !important;
    display: flex;
    width: 100% !important;
    transform: none !important;
    transition: none !important;
  }
  .yap-sidebar.hidden-mobile {
    display: none !important;
    transform: none !important;
  }
  .yap-main { display: none; width: 100%; }
  .yap-sidebar.hidden-mobile + .yap-main { display: flex; }
  .yap-conv-item,
  .yap-conv-item:hover,
  .yap-conv-item:active {
    transform: none !important;
    transition: background 0.12s ease, border-color 0.12s ease !important;
  }
}

/* Input area */
.yap-input-area {
  display: flex;
  align-items: stretch;
  border-top: 1px solid oklch(0.92 0.04 15 / 0.1);
  background: oklch(0.2 0.08 18 / 0.5);
  flex-shrink: 0;
  position: relative;
}
.yap-textarea {
  flex: 1;
  background: oklch(0.92 0.04 15 / 0.06);
  border: 1px solid oklch(0.92 0.04 15 / 0.12);
  border-radius: 0.875rem;
  color: var(--rose);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 0.625rem 0.875rem;
  outline: none;
  resize: none;
  line-height: 1.5;
  max-height: 8rem;
  overflow-y: auto;
  transition: border-color 0.15s;
}
.yap-textarea::placeholder { color: oklch(0.92 0.04 15 / 0.3); }
.yap-textarea:focus { border-color: oklch(0.92 0.04 15 / 0.25); }

.yap-send-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: var(--rose-hot);
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: white;
  transition: background 0.15s, transform 0.1s;
}
.yap-send-btn:hover { background: oklch(0.5 0.22 22); transform: scale(1.05); }
.yap-send-btn:active { transform: scale(0.96); }
.yap-send-btn svg { width: 1rem; height: 1rem; }
.yap-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Waiting state */
.yap-waiting {
  padding: 0.875rem 1rem;
  border-top: 1px solid oklch(0.92 0.04 15 / 0.1);
  background: oklch(0.2 0.08 18 / 0.5);
  flex-shrink: 0;
}
.yap-waiting span {
  display: block;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: oklch(0.92 0.04 15 / 0.45);
  padding: 0.25rem 0;
}

/* Request card */
.yap-request-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid oklch(0.92 0.04 15 / 0.1);
  background: oklch(0.2 0.08 18 / 0.5);
  flex-shrink: 0;
}
.yap-request-question {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  color: var(--rose);
  text-align: center;
  line-height: 1.4;
}
.yap-request-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}
.yap-accept-btn, .yap-reject-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.1s, opacity 0.15s;
}
.yap-accept-btn:active, .yap-reject-btn:active { transform: scale(0.96); }
.yap-accept-btn {
  background: oklch(0.55 0.17 145 / 0.2);
  border: 1px solid oklch(0.6 0.18 145 / 0.5);
  color: oklch(0.82 0.18 145);
}
.yap-accept-btn:hover { background: oklch(0.55 0.17 145 / 0.3); }
.yap-reject-btn {
  background: oklch(0.55 0.22 22 / 0.12);
  border: 1px solid oklch(0.55 0.22 22 / 0.4);
  color: oklch(0.65 0.22 22);
}
.yap-reject-btn:hover { background: oklch(0.55 0.22 22 / 0.22); }


/* ── Instagram-style chat intro (top of messages for new/first-load) ──────── */
.yap-chat-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2.5rem 1rem 2rem;
  text-align: center;
}
.yap-chat-intro-avatar {
  margin-bottom: 0.5rem;
}
.yap-chat-intro-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--rose);
}
.yap-chat-intro-handle {
  font-size: 0.8125rem;
  color: oklch(0.92 0.04 15 / 0.45);
  font-family: var(--font-mono);
  margin-bottom: 0.75rem;
}
.yap-chat-intro-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.5rem;
  color: var(--rose-hot);
}
.yap-chat-intro-divider svg { width: 0.85rem; height: 0.85rem; flex-shrink: 0; }
.yap-chat-intro-divider::before,
.yap-chat-intro-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: oklch(0.92 0.04 15 / 0.1);
}
.yap-chat-intro-caption {
  color: oklch(0.92 0.04 15 / 0.3);
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.375rem;
}

/* ── Header action buttons ──────────────────────────────────────────────── */
.yap-header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}
.yap-header-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.625rem;
  display: grid;
  place-items: center;
  color: oklch(0.92 0.04 15 / 0.55);
  transition: color 0.15s, background 0.12s;
}
.yap-header-icon:hover {
  color: var(--rose);
  background: oklch(0.92 0.04 15 / 0.07);
}
.yap-header-icon svg { width: 1.125rem; height: 1.125rem; }

/* ── Input area redesign ────────────────────────────────────────────────── */
.yap-input-area {
  flex-direction: column;
  gap: 0;
  padding: 0;
  position: relative;
}
.yap-input-main {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
}
.yap-input-toolbar {
  display: flex;
  flex-direction: row;
  gap: 0.125rem;
  flex-shrink: 0;
  align-items: center;
}
.yap-toolbar-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: oklch(0.92 0.04 15 / 0.45);
  transition: color 0.15s, background 0.12s;
}
.yap-toolbar-btn:hover {
  color: var(--rose);
  background: oklch(0.92 0.04 15 / 0.07);
}
.yap-toolbar-btn svg { width: 1.1rem; height: 1.1rem; }
.yap-input-row {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

/* ── Emoji picker ───────────────────────────────────────────────────────── */
.yap-emoji-picker {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: oklch(0.18 0.08 18);
  border: 1px solid oklch(0.92 0.04 15 / 0.15);
  border-radius: 0.75rem;
  box-shadow: 0 -8px 32px oklch(0 0 0 / 0.5);
  padding: 0.625rem;
  z-index: 50;
  max-height: 14rem;
  overflow-y: auto;
}
.yap-emoji-picker::-webkit-scrollbar { width: 4px; }
.yap-emoji-picker::-webkit-scrollbar-thumb { background: oklch(0.92 0.04 15 / 0.2); border-radius: 2px; }
.yap-emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.25rem, 1fr));
  gap: 0.125rem;
}
.yap-emoji-cell {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.375rem;
  padding: 0.25rem;
  border-radius: 0.375rem;
  line-height: 1;
  transition: background 0.1s;
}
.yap-emoji-cell:hover { background: oklch(0.92 0.04 15 / 0.1); }

/* ── Camera modal ───────────────────────────────────────────────────────── */
.yap-camera-modal {
  position: absolute;
  inset: 0;
  background: oklch(0 0 0 / 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}
.yap-camera-inner {
  position: relative;
  background: oklch(0.17 0.08 18);
  border: 1px solid oklch(0.92 0.04 15 / 0.15);
  border-radius: 1rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  max-width: 90%;
  width: 22rem;
}
.yap-camera-close {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  color: oklch(0.92 0.04 15 / 0.6);
}
.yap-camera-close:hover { color: var(--rose); }
.yap-camera-close svg { width: 1rem; height: 1rem; }
.yap-camera-preview {
  width: 100%;
  border-radius: 0.625rem;
  background: oklch(0.12 0.05 18);
  aspect-ratio: 4/3;
  object-fit: cover;
}
.yap-camera-snap {
  padding: 0.5rem 1.5rem;
  background: var(--rose-hot);
  border: none;
  border-radius: 9999px;
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.yap-camera-snap:hover { background: oklch(0.5 0.22 22); }
.yap-camera-snap:active { transform: scale(0.97); }

/* ── Media messages ─────────────────────────────────────────────────────── */
.yap-media-link { display: block; }
.yap-media-img {
  display: block;
  max-width: 16rem;
  max-height: 16rem;
  border-radius: 0.875rem;
  object-fit: cover;
  border: 1px solid oklch(0.92 0.04 15 / 0.15);
  cursor: pointer;
  transition: opacity 0.15s;
}
.yap-media-img:hover { opacity: 0.9; }
.yap-media-video {
  display: block;
  max-width: 16rem;
  border-radius: 0.875rem;
  border: 1px solid oklch(0.92 0.04 15 / 0.15);
}

/* ── Call card ──────────────────────────────────────────────────────────── */
.yap-call-card {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  border-radius: 1rem;
  border: 1px solid oklch(0.92 0.04 15 / 0.15);
  background: oklch(0.92 0.04 15 / 0.07);
  min-width: 10rem;
}
.yap-call-card-me { border-color: oklch(0.55 0.22 22 / 0.35); background: oklch(0.55 0.22 22 / 0.15); }
.yap-call-icon { font-size: 1.25rem; flex-shrink: 0; }
.yap-call-label { flex: 1; font-size: 0.875rem; color: var(--rose); font-weight: 500; }
.yap-call-join {
  padding: 0.3rem 0.75rem;
  background: oklch(0.6 0.2 145 / 0.2);
  border: 1px solid oklch(0.6 0.2 145 / 0.45);
  border-radius: 9999px;
  color: oklch(0.82 0.18 145);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}
.yap-call-join:hover { background: oklch(0.6 0.2 145 / 0.35); }

/* Shared vibe card — just the thumbnail + creator handle overlaid on it,
   no border/background/title/link text (bare thumbnail, Reels-style). */
.yap-vibe-card {
  display: block;
  position: relative;
  width: min(11rem, 60vw);
  aspect-ratio: 9 / 14;
  border-radius: 1rem;
  overflow: hidden;
  background-color: oklch(0.92 0.04 15 / 0.08);
  text-decoration: none;
}

.yap-vibe-card .yap-reel-thumb {
  position: absolute;
  inset: 0;
  border-radius: 0;
  background-size: cover;
  background-position: center;
}

.yap-vibe-creator {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  max-width: calc(100% - 1.2rem);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: oklch(0 0 0 / 0.45);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
}

.yap-vibe-creator .yap-card-creator-handle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yap-vibe-creator .gold-tick svg {
  width: 0.8rem;
  height: 0.8rem;
}

/* Shared thread card — title + creator handle only, no url/kicker. */
.yap-thread-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: min(18rem, 72vw);
  padding: 0.8rem 0.9rem;
  border: 1px solid oklch(0.92 0.04 15 / 0.16);
  border-radius: 1rem;
  background:
    linear-gradient(135deg, oklch(0.24 0.12 18 / 0.96), oklch(0.11 0.04 190 / 0.96));
  color: #fff;
  text-decoration: none;
  box-shadow: 0 16px 38px oklch(0.04 0.04 18 / 0.32);
}

.yap-reel-card-me {
  border-color: oklch(0.72 0.18 82 / 0.28);
  background:
    linear-gradient(135deg, oklch(0.32 0.16 22 / 0.98), oklch(0.16 0.08 150 / 0.98));
}

.yap-thread-card:hover {
  border-color: oklch(0.72 0.18 82 / 0.42);
}

.yap-thread-card strong {
  font-size: 0.95rem;
  line-height: 1.25;
}

.yap-thread-creator {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: oklch(0.92 0.04 15 / 0.6);
  font-size: 0.78rem;
}

.yap-thread-creator .gold-tick svg {
  width: 0.8rem;
  height: 0.8rem;
}

.yap-call-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(0.07 0.04 18 / 0.88);
  backdrop-filter: blur(14px);
}
.yap-call-modal[hidden] { display: none; }
.yap-incoming-type,
.yap-call-type,
.yap-call-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.45rem;
  padding: 0 0.55rem;
  border: 1px solid oklch(0.92 0.04 15 / 0.14);
  border-radius: 9999px;
  background: oklch(0.92 0.04 15 / 0.08);
  color: oklch(0.92 0.04 15 / 0.72);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Incoming screen */
.yap-incoming-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2.5rem 2.5rem 2rem;
  background: oklch(0.16 0.06 18);
  border: 1px solid oklch(0.92 0.04 15 / 0.1);
  border-radius: 1.75rem;
  min-width: 280px;
  box-shadow: 0 32px 80px oklch(0.04 0.06 18 / 0.7);
  animation: callPop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}
.yap-incoming-screen::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 28%, oklch(0.55 0.22 22 / 0.28), transparent 42%);
  pointer-events: none;
}
.yap-incoming-screen[hidden] { display: none; }
.yap-incoming-screen > * {
  position: relative;
  z-index: 1;
}
.yap-incoming-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: oklch(0.95 0.03 15);
  margin-top: 0.25rem;
}
.yap-incoming-label {
  font-size: 0.75rem;
  color: oklch(0.92 0.04 15 / 0.45);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.yap-incoming-btns {
  display: flex;
  gap: 2.5rem;
  margin-top: 0.75rem;
}
.yap-btn-answer,
.yap-btn-decline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 4rem; height: 4rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  font-weight: 600;
  transition: transform 0.15s, opacity 0.15s;
}
.yap-btn-answer { background: oklch(0.52 0.18 145); color: #fff; }
.yap-btn-decline { background: oklch(0.5 0.22 15); color: #fff; }
.yap-btn-answer svg,
.yap-btn-decline svg { width: 1.4rem; height: 1.4rem; }
.yap-btn-answer:hover,
.yap-btn-decline:hover { opacity: 0.85; transform: scale(1.08); }

/* Active call (full-screen) */
.yap-active-screen {
  position: fixed;
  inset: 0;
  background: oklch(0.1 0.04 18);
  display: flex;
  flex-direction: column;
}
.yap-active-screen[hidden] { display: none; }
.yap-call-video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background:
    linear-gradient(135deg, oklch(0.14 0.055 18), oklch(0.11 0.045 220)),
    radial-gradient(circle at 50% 45%, oklch(0.55 0.22 22 / 0.24), transparent 40%);
  color: oklch(0.92 0.04 15 / 0.62);
  z-index: 0;
}
.yap-call-placeholder-av .yap-avatar {
  box-shadow: 0 0 0 1px oklch(0.92 0.04 15 / 0.14), 0 18px 50px oklch(0 0 0 / 0.35);
}
.yap-call-video-placeholder span {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.yap-remote-video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
}
.yap-local-video {
  position: absolute;
  bottom: 7rem; right: 1rem;
  width: min(9.25rem, 28vw); height: min(13rem, 36vw);
  object-fit: cover;
  border-radius: 0.875rem;
  border: 2px solid oklch(0.92 0.04 15 / 0.25);
  background: oklch(0.15 0.04 18);
  z-index: 4;
  box-shadow: 0 18px 50px oklch(0 0 0 / 0.35);
}
.yap-local-placeholder {
  position: absolute;
  bottom: 7rem; right: 1rem;
  width: min(9.25rem, 28vw); height: min(13rem, 36vw);
  display: grid;
  place-items: center;
  border-radius: 0.875rem;
  border: 2px solid oklch(0.92 0.04 15 / 0.2);
  background: oklch(0.13 0.05 18 / 0.9);
  color: oklch(0.92 0.04 15 / 0.55);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  z-index: 4;
}
.yap-call-audio-av {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.yap-call-audio-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  padding: 1.35rem;
  border: 1px solid oklch(0.92 0.04 15 / 0.12);
  border-radius: 1.25rem;
  background: oklch(0.92 0.04 15 / 0.07);
}
.yap-call-audio-name {
  color: white;
  font-size: 1rem;
  font-weight: 700;
}
.yap-call-audio-bars {
  display: flex;
  align-items: end;
  gap: 0.22rem;
  height: 1rem;
}
.yap-call-audio-bars span {
  width: 0.25rem;
  min-height: 0.35rem;
  border-radius: 999px;
  background: oklch(0.72 0.16 145);
  animation: callBars 1s ease-in-out infinite;
}
.yap-call-audio-bars span:nth-child(2) { animation-delay: 0.15s; }
.yap-call-audio-bars span:nth-child(3) { animation-delay: 0.3s; }
.yap-call-top-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 1.5rem 1.5rem 3rem;
  background: linear-gradient(to bottom, oklch(0.06 0.04 18 / 0.85), transparent);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  z-index: 5;
}
.yap-call-peer,
.yap-call-state {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.yap-call-state {
  align-items: flex-end;
}
.yap-call-peer-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: white;
}
.yap-call-status {
  font-size: 0.75rem;
  color: oklch(0.92 0.04 15 / 0.55);
  font-family: var(--font-mono);
}
.yap-call-status[data-state="connected"] { color: oklch(0.74 0.18 145); }
.yap-call-status[data-state="ringing"] { color: oklch(0.82 0.16 78); }
.yap-call-status[data-state="warning"] { color: oklch(0.82 0.16 65); }
.yap-call-status[data-state="ended"] { color: oklch(0.72 0.14 22); }
.yap-call-controls {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 2rem 1.5rem;
  background: linear-gradient(to top, oklch(0.06 0.04 18 / 0.85), transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  z-index: 5;
}
.yap-call-ctrl {
  min-width: 4.35rem; height: 4.15rem;
  padding: 0.55rem 0.7rem;
  border-radius: 9999px;
  border: none;
  background: oklch(0.92 0.04 15 / 0.15);
  color: white;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  gap: 0.25rem;
  transition: background 0.15s, transform 0.12s;
}
.yap-call-ctrl svg { width: 1.25rem; height: 1.25rem; }
.yap-call-ctrl span {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1;
}
.yap-call-ctrl:hover { background: oklch(0.92 0.04 15 / 0.28); transform: scale(1.05); }
.yap-call-ctrl.active { background: oklch(0.78 0.16 65 / 0.32); }
.yap-call-ctrl:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.yap-call-end {
  min-width: 4.75rem; height: 4.45rem;
  background: oklch(0.5 0.22 15);
}
.yap-call-end:hover { background: oklch(0.44 0.22 15); }

@keyframes callPop {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
@keyframes callBars {
  0%, 100% { height: 0.35rem; opacity: 0.45; }
  50% { height: 1rem; opacity: 1; }
}

/* ── Info panel ─────────────────────────────────────────────────────────── */
.yap-info-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(22rem, 100%);
  background: oklch(0.17 0.08 18 / 0.97);
  border-left: 1px solid oklch(0.92 0.04 15 / 0.12);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow-y: auto;
}
.yap-info-panel::-webkit-scrollbar { width: 4px; }
.yap-info-panel::-webkit-scrollbar-thumb { background: oklch(0.92 0.04 15 / 0.15); border-radius: 2px; }
.yap-info-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid oklch(0.92 0.04 15 / 0.1);
  flex-shrink: 0;
}
.yap-info-close-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: grid;
  place-items: center;
  color: oklch(0.92 0.04 15 / 0.5);
  transition: color 0.15s, background 0.12s;
}
.yap-info-close-btn:hover { color: var(--rose); background: oklch(0.92 0.04 15 / 0.07); }
.yap-info-close-btn svg { width: 1rem; height: 1rem; }
.yap-info-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--rose);
  font-family: var(--font-serif);
}
.yap-info-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1.25rem 2rem;
}
.yap-info-avatar-wrap { margin-bottom: 0.25rem; }
.yap-info-name {
  font-size: 1.125rem;
  font-weight: 600;
  font-family: var(--font-serif);
  color: var(--rose);
  text-align: center;
}
.yap-info-handle {
  font-size: 0.8125rem;
  color: oklch(0.92 0.04 15 / 0.45);
  font-family: var(--font-mono);
}
.yap-info-visit-btn {
  display: inline-block;
  padding: 0.375rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  background: oklch(0.92 0.04 15 / 0.08);
  border: 1px solid oklch(0.92 0.04 15 / 0.18);
  color: oklch(0.92 0.04 15 / 0.7);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  margin-top: 0.25rem;
}
.yap-info-visit-btn:hover { background: oklch(0.92 0.04 15 / 0.14); color: var(--rose); }
.yap-info-actions { margin-top: 0.25rem; }
.yap-block-btn {
  padding: 0.4rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  background: oklch(0.55 0.22 22 / 0.12);
  border: 1px solid oklch(0.55 0.22 22 / 0.4);
  color: oklch(0.65 0.22 22);
  cursor: pointer;
  transition: background 0.15s;
}
.yap-block-btn:hover { background: oklch(0.55 0.22 22 / 0.22); }
.yap-info-section {
  width: 100%;
  margin-top: 1rem;
}
.yap-info-section-label {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: oklch(0.92 0.04 15 / 0.4);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.yap-info-media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.25rem;
}
.yap-info-media-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 1.5rem 0;
  font-size: 0.8125rem;
  color: oklch(0.92 0.04 15 / 0.3);
  font-family: var(--font-mono);
}
.yap-info-media-thumb {
  display: block;
  aspect-ratio: 1;
  border-radius: 0.375rem;
  overflow: hidden;
  background: oklch(0.92 0.04 15 / 0.05);
  position: relative;
}
.yap-info-media-thumb img,
.yap-info-media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.yap-info-media-video-thumb .yap-info-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(0 0 0 / 0.35);
  color: white;
  font-size: 1rem;
}
.yap-info-delete-btn {
  width: 100%;
  padding: 0.5rem 1rem;
  background: oklch(0.55 0.22 22 / 0.08);
  border: 1px solid oklch(0.55 0.22 22 / 0.3);
  border-radius: 0.625rem;
  color: oklch(0.65 0.22 22);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.yap-info-delete-btn:hover { background: oklch(0.55 0.22 22 / 0.18); }

/* ── Mobile responsive ───────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .yap-sidebar {
    width: 100%;
    position: absolute;
    inset: 0;
    z-index: 10;
    transition: transform 0.25s ease;
  }
  .yap-sidebar.hidden-mobile {
    transform: translateX(-100%);
    pointer-events: none;
  }
  .yap-main {
    width: 100%;
  }
  .yap-back-btn {
    display: grid;
  }
  .yap-msg {
    max-width: 88%;
  }
  .yap-info-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid oklch(0.92 0.04 15 / 0.12);
  }
  .yap-camera-inner {
    width: calc(100% - 2rem);
  }
  .yap-media-img, .yap-media-video { max-width: 14rem; }
}

/* Yap reference refresh */
body.shell-page-yap {
  --yap-ink: #fff6f8;
  --yap-muted: rgb(255 222 230 / 0.58);
  --yap-line: rgb(255 83 125 / 0.18);
  --yap-hot: #ff2d68;
  background: #170006;
}

body.shell-page-yap .shell-blobs {
  display: none;
}

body.shell-page-yap .shell-layout:has(.yap-page) {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  gap: 0;
  background:
    radial-gradient(circle at 72% 44%, rgb(156 11 54 / 0.22), transparent 34rem),
    linear-gradient(135deg, #210009 0%, #390012 42%, #200008 100%);
}

@media (min-width: 1024px) {
  body.shell-page-yap .shell-sidebar {
    width: 7rem;
    padding: 2rem 1.35rem 1.5rem;
    border-right: 1px solid rgb(255 83 125 / 0.2);
    background: linear-gradient(180deg, rgb(69 2 22 / 0.36), rgb(28 0 9 / 0.76));
  }

  body.shell-page-yap .shell-sidebar .nav-link {
    width: 3.9rem;
    height: 3.9rem;
    border: 1px solid transparent;
    border-radius: 1rem;
    color: rgb(255 236 240 / 0.86);
    background: transparent;
  }

  body.shell-page-yap .shell-sidebar .nav-link.active {
    color: #fff;
    border-color: rgb(255 45 104 / 0.5);
    background: linear-gradient(145deg, rgb(255 45 104 / 0.34), rgb(144 9 52 / 0.28));
    box-shadow: 0 14px 32px rgb(255 45 104 / 0.16);
  }
}

.yap-page {
  color: var(--yap-ink);
  background:
    radial-gradient(circle at 63% 49%, rgb(178 11 52 / 0.16), transparent 31rem),
    linear-gradient(115deg, rgb(36 0 12 / 0.96), rgb(72 0 20 / 0.92) 48%, rgb(28 0 9 / 0.97));
}

.yap-sidebar {
  width: 25.75rem;
  border-right: 1px solid var(--yap-line);
  background: linear-gradient(180deg, rgb(64 1 21 / 0.42), rgb(22 0 8 / 0.62));
  backdrop-filter: blur(18px);
}

.yap-search-wrap {
  padding: 1.95rem 1.35rem 1.5rem;
}

.yap-search-icon {
  left: 2.35rem;
  top: 3.75rem;
  width: 1.25rem;
  height: 1.25rem;
  transform: translateY(-50%);
  color: rgb(255 225 232 / 0.76);
}

.yap-search-input {
  height: 3.65rem;
  padding: 0 1.25rem 0 3.65rem;
  border: 1px solid rgb(255 83 125 / 0.24);
  border-radius: 1.15rem;
  background: rgb(114 13 42 / 0.28);
  color: var(--yap-ink);
  font-size: 1rem;
}

.yap-tabs {
  min-height: 4.55rem;
  align-items: end;
  margin: 0;
  border-bottom: 1px solid rgb(255 83 125 / 0.16);
}

.yap-tab {
  min-height: 4.25rem;
  padding: 0.8rem 0.7rem 1.35rem;
  color: rgb(255 223 230 / 0.52);
  font-size: 1.02rem;
  font-weight: 600;
}

.yap-tab.active {
  color: #fff;
  border-bottom-color: var(--yap-hot);
}

.yap-tab-badge {
  min-width: 1.35rem;
  height: 1.35rem;
  margin-left: 0.35rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--yap-hot);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.yap-conv-list {
  padding: 0.85rem 0.75rem 1.25rem;
}

.yap-conv-item {
  min-height: 5.7rem;
  margin: 0 0 0.65rem;
  padding: 1.15rem 1rem;
  gap: 1rem;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 1rem;
}

.yap-conv-item:hover,
.yap-conv-item.active {
  border-color: rgb(255 83 125 / 0.15);
  background: rgb(117 9 41 / 0.34);
}

.yap-conv-av .yap-avatar.sz-40,
.yap-chat-avatar .yap-avatar.sz-40 {
  width: 3.6rem;
  height: 3.6rem;
  font-size: 1.4rem;
}

.yap-conv-name,
.yap-chat-name {
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 800;
}

.yap-conv-name { font-size: 1.02rem; }
.yap-conv-time,
.yap-conv-preview {
  color: rgb(255 225 232 / 0.62);
  font-family: var(--font-sans);
}

.yap-main {
  background: radial-gradient(circle at 50% 38%, rgb(178 11 52 / 0.18), transparent 27rem);
}

.yap-chat-header {
  min-height: 7rem;
  padding: 1.75rem 2.7rem 1.25rem;
  gap: 1rem;
  border-bottom: 1px solid var(--yap-line);
  background: linear-gradient(180deg, rgb(44 0 15 / 0.46), rgb(44 0 15 / 0.08));
}

.yap-chat-handle {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  color: rgb(255 223 230 / 0.55);
  font-family: var(--font-sans);
  font-size: 0.98rem;
}

.yap-online-dot {
  width: 0.68rem;
  height: 0.68rem;
  border-radius: 999px;
  display: inline-block;
  background: #20d43a;
}

.yap-header-actions {
  gap: 0.85rem;
}

.yap-header-icon {
  width: 3.55rem;
  height: 3.55rem;
  border: 1px solid rgb(255 83 125 / 0.35);
  border-radius: 1.05rem;
  background: rgb(64 0 20 / 0.2);
  color: rgb(255 227 232 / 0.9);
}

.yap-messages {
  padding: 2.05rem 2.65rem 1.45rem;
  gap: 1.25rem;
}

.yap-messages:has(.yap-chat-intro:only-child) {
  justify-content: center;
  padding-bottom: 8rem;
}

.yap-date-divider,
.yap-new-msgs-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.55rem 0 0.8rem;
}

.yap-date-divider::before,
.yap-date-divider::after,
.yap-new-msgs-divider::before,
.yap-new-msgs-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgb(255 83 125 / 0.22);
}

.yap-date-divider span,
.yap-new-msgs-divider span {
  min-height: 2.25rem;
  padding: 0 1.15rem;
  border: 1px solid rgb(255 83 125 / 0.22);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: rgb(82 8 31 / 0.45);
  color: rgb(255 236 240 / 0.82);
  font-family: var(--font-sans);
  font-size: 0.98rem;
  letter-spacing: 0;
  text-transform: none;
}

.yap-msg {
  max-width: min(34rem, 58%);
}

.yap-msg-me {
  max-width: min(31rem, 48%);
}

.yap-msg-row {
  gap: 0.85rem;
}

.yap-msg-avatar .yap-avatar {
  width: 2.65rem;
  height: 2.65rem;
  border: 1px solid rgb(255 83 125 / 0.22);
  background: linear-gradient(145deg, #a01542, #62001f);
  font-family: var(--font-sans);
  font-weight: 900;
}

.yap-bubble {
  padding: 0.86rem 1rem;
  border-radius: 1rem;
  color: #fff;
  font-size: 1rem;
  line-height: 1.48;
}

.yap-bubble-me {
  border-color: rgb(255 45 104 / 0.45);
  border-bottom-right-radius: 1rem;
  background: rgb(121 11 43 / 0.8);
}

.yap-bubble-other {
  border-color: rgb(255 255 255 / 0.08);
  border-bottom-left-radius: 1rem;
  background: rgb(82 7 31 / 0.7);
}

.yap-msg-time {
  color: rgb(255 225 232 / 0.66);
  font-family: var(--font-sans);
  font-size: 0.8rem;
}

.yap-msg-other .yap-msg-meta {
  margin-left: 3.5rem;
}

.yap-chat-intro {
  width: min(42rem, 100%);
  margin: 0 auto;
  padding: 0;
}

.yap-chat-intro-avatar .yap-avatar.sz-96,
.yap-chat-intro-avatar .yap-avatar.sz-64 {
  width: 5.85rem;
  height: 5.85rem;
  border: 1px solid rgb(255 83 125 / 0.32);
  background: linear-gradient(145deg, #ab1747, #690021);
  font-family: var(--font-sans);
  font-size: 2.55rem;
  font-weight: 900;
}

.yap-chat-intro-name {
  color: #fff;
  font-family: var(--font-sans);
  font-size: 1.55rem;
  font-weight: 900;
}

.yap-chat-intro-divider {
  width: min(36rem, 82%);
  margin: 2.25rem auto 0;
  padding: 0;
  color: var(--yap-hot);
}

.yap-chat-intro-divider svg {
  width: 1.55rem;
  height: 1.55rem;
  filter: drop-shadow(0 0 12px rgb(255 45 104 / 0.42));
}

.yap-chat-intro-caption {
  color: rgb(255 222 230 / 0.48);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  letter-spacing: 0;
  text-transform: none;
}

.yap-input-area,
.yap-waiting,
.yap-request-card {
  margin: 0 2.2rem 2rem;
  border: 1px solid rgb(255 83 125 / 0.18);
  border-radius: 1.25rem;
  background: rgb(45 0 16 / 0.58);
  overflow: visible;
}

.yap-input-main {
  position: relative;
  min-height: 7.6rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.1rem;
  grid-template-rows: auto auto;
  align-items: end;
  gap: 0.75rem 1rem;
  padding: 1.15rem 1.45rem;
}

.yap-input-row {
  grid-column: 1 / -1;
  grid-row: 1;
  padding-right: 5.3rem;
}

.yap-textarea {
  min-height: 2.2rem;
  padding: 0.1rem 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.02rem;
}

.yap-input-toolbar {
  grid-column: 1;
  grid-row: 2;
  gap: 0.62rem;
}

.yap-toolbar-btn {
  width: 2.85rem;
  height: 2.85rem;
  border: 1px solid rgb(255 83 125 / 0.22);
  border-radius: 0.75rem;
  background: rgb(64 0 21 / 0.34);
  color: rgb(255 237 241 / 0.86);
}

.yap-send-btn {
  position: absolute;
  right: 1.35rem;
  bottom: 1.15rem;
  width: 3.65rem;
  height: 3.65rem;
  border-radius: 1rem;
  background: linear-gradient(145deg, rgb(255 45 104 / 0.92), rgb(150 16 59 / 0.96));
}

@media (max-width: 1180px) {
  .yap-sidebar { width: 22.5rem; }
  .yap-chat-header,
  .yap-messages { padding-inline: 1.6rem; }
  .yap-input-area,
  .yap-waiting,
  .yap-request-card { margin-inline: 1.4rem; }
}

@media (max-width: 760px) {
  .yap-sidebar { width: 100%; }
  .yap-chat-header { min-height: 5.5rem; padding: 1rem; }
  .yap-header-icon { width: 2.85rem; height: 2.85rem; }
  .yap-messages { padding: 1.25rem 1rem 1rem; }
  .yap-msg,
  .yap-msg-me { max-width: 92%; }
  .yap-input-area,
  .yap-waiting,
  .yap-request-card { margin: 0 0.75rem 0.8rem; }
  .yap-input-main { min-height: 7.1rem; padding: 1rem; }
  .yap-input-row { padding-right: 4.2rem; }
  .yap-toolbar-btn { width: 2.55rem; height: 2.55rem; }
  .yap-send-btn { right: 1rem; bottom: 1rem; width: 3.2rem; height: 3.2rem; }
}

/* Final compact Yap layer: keep shared vibe/thread styles, scale the UI down. */
body.shell-page-yap {
  background: var(--wine) !important;
}

body.shell-page-yap .shell-blobs {
  display: block !important;
}

body.shell-page-yap .shell-layout:has(.yap-page) {
  background: transparent !important;
}

body.shell-page-yap .shell-main:has(.yap-page),
.yap-page {
  background: transparent !important;
}

body.shell-page-yap .shell-sidebar {
  width: 5.75rem !important;
  padding: 1.15rem 0.8rem 1rem !important;
}

body.shell-page-yap .shell-sidebar .nav-link {
  width: 3rem !important;
  height: 3rem !important;
  border-radius: 0.75rem !important;
}

body.shell-page-yap .shell-sidebar .nav-link svg {
  width: 1.3rem !important;
  height: 1.3rem !important;
}

.yap-online-dot {
  display: none !important;
}

.yap-sidebar {
  width: 21rem !important;
}

.yap-search-wrap {
  padding: 1rem 0.9rem 0.7rem !important;
}

.yap-search-input {
  height: 2.85rem !important;
  padding-left: 2.65rem !important;
  border-radius: 0.85rem !important;
  font-size: 0.9rem !important;
}

.yap-search-icon {
  left: 1.7rem !important;
  top: 2.37rem !important;
  width: 1rem !important;
  height: 1rem !important;
}

.yap-tabs {
  min-height: 3.4rem !important;
}

.yap-tab {
  min-height: 3.15rem !important;
  padding: 0.55rem 0.45rem 0.85rem !important;
  font-size: 0.9rem !important;
}

.yap-conv-list {
  padding: 0.5rem 0.55rem 0.9rem !important;
}

.yap-conv-item {
  min-height: 4.35rem !important;
  margin-bottom: 0.45rem !important;
  padding: 0.72rem 0.75rem !important;
  gap: 0.7rem !important;
  border-radius: 0.78rem !important;
}

.yap-conv-av .yap-avatar.sz-40,
.yap-chat-avatar .yap-avatar.sz-40 {
  width: 2.65rem !important;
  height: 2.65rem !important;
  font-size: 1.03rem !important;
}

.yap-conv-name,
.yap-chat-name {
  font-size: 0.96rem !important;
}

.yap-conv-preview {
  display: flex !important;
  min-width: 0;
  align-items: center;
  gap: 0.24rem;
  font-size: 0.82rem !important;
}

.yap-conv-you {
  color: #fff;
  font-weight: 800;
}

.yap-conv-receipt {
  display: inline-flex;
  flex: 0 0 auto;
}

.yap-conv-receipt .yap-receipt {
  width: 0.74rem;
  height: 0.74rem;
}

.yap-conv-preview-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yap-chat-header {
  min-height: 4.85rem !important;
  padding: 0.95rem 1.35rem 0.8rem !important;
}

.yap-chat-handle {
  font-size: 0.82rem !important;
}

.yap-header-icon {
  width: 2.62rem !important;
  height: 2.62rem !important;
  border-radius: 0.78rem !important;
}

.yap-header-icon svg {
  width: 1.12rem !important;
  height: 1.12rem !important;
}

.yap-messages {
  padding: 1.15rem 1.45rem 0.8rem !important;
  gap: 0.48rem !important;
}

.yap-msg {
  max-width: min(27rem, 54%) !important;
}

.yap-msg-me {
  max-width: min(25rem, 46%) !important;
}

.yap-msg-row {
  gap: 0.42rem !important;
}

.yap-msg-avatar .yap-avatar,
.yap-msg-avatar .yap-avatar.sz-36 {
  width: 2rem !important;
  height: 2rem !important;
  font-size: 0.8rem !important;
}

.yap-bubble {
  padding: 0.56rem 0.74rem !important;
  border-radius: 0.78rem !important;
  font-size: 0.92rem !important;
  line-height: 1.38 !important;
}

.yap-msg-time {
  display: none !important;
}

.yap-msg-meta {
  min-height: 0.4rem !important;
  font-size: 0 !important;
}

.yap-msg-other .yap-msg-meta,
.yap-msg-group-before .yap-msg-meta {
  display: none !important;
}

.yap-msg-group-follow {
  margin-top: -0.32rem !important;
}

.yap-msg-group-follow .yap-msg-avatar {
  visibility: hidden;
}

.yap-msg-group-before .yap-bubble-other { border-bottom-left-radius: 0.38rem !important; }
.yap-msg-group-follow .yap-bubble-other { border-top-left-radius: 0.38rem !important; }
.yap-msg-group-before .yap-bubble-me { border-bottom-right-radius: 0.38rem !important; }
.yap-msg-group-follow .yap-bubble-me { border-top-right-radius: 0.38rem !important; }

.yap-emoji-only {
  padding: 0.04rem 0.2rem;
  font-size: 2.65rem;
  line-height: 1;
}

.yap-msg:has(.yap-emoji-only) {
  max-width: max-content !important;
}

.yap-audio-msg {
  min-width: 13rem !important;
  max-width: 16rem !important;
  padding: 0.46rem 0.58rem !important;
}

.yap-audio-wrap {
  gap: 0.55rem !important;
}

.yap-audio-play-btn {
  width: 2.08rem !important;
  height: 2.08rem !important;
}

.yap-audio-track {
  position: relative !important;
  display: flex !important;
  min-width: 8.4rem !important;
  height: 1.55rem !important;
  align-items: center !important;
  gap: 0.12rem !important;
  overflow: hidden !important;
  background: transparent !important;
}

.yap-audio-track span {
  width: 2px;
  height: 0.62rem;
  border-radius: 99px;
  background: var(--yap-hot);
  opacity: 0.72;
}

.yap-audio-track span:nth-child(4n + 1) { height: 1.2rem; }
.yap-audio-track span:nth-child(4n + 2) { height: 0.82rem; }
.yap-audio-track span:nth-child(4n + 3) { height: 1.42rem; }
.yap-audio-track span:nth-child(4n + 4) { height: 0.5rem; }
.yap-audio-dur,
.yap-audio-icon { display: none !important; }

.yap-vibe-card {
  width: min(10rem, 58vw) !important;
  border-radius: 0.9rem !important;
}

.yap-vibe-creator {
  top: 0.55rem !important;
  left: 0.55rem !important;
  padding: 0.24rem 0.52rem !important;
  font-size: 0.7rem !important;
}

.yap-thread-card {
  max-width: min(17rem, 72vw) !important;
  gap: 0.32rem !important;
  padding: 0.7rem 0.82rem !important;
  border-radius: 0.85rem !important;
}

.yap-thread-card strong {
  font-size: 0.9rem !important;
}

.yap-thread-creator {
  font-size: 0.74rem !important;
}

.yap-shared-card {
  grid-template-columns: 4.15rem minmax(0, 1fr) !important;
  width: min(18.5rem, 100%) !important;
  min-height: 4.9rem !important;
  padding: 0.55rem !important;
  border-radius: 0.82rem !important;
}

.yap-input-area,
.yap-waiting,
.yap-request-card {
  margin: 0 1.35rem 1.1rem !important;
  border-radius: 1rem !important;
}

.yap-input-main {
  min-height: 5.45rem !important;
  padding: 0.82rem 1rem !important;
}

.yap-toolbar-btn {
  width: 2.22rem !important;
  height: 2.22rem !important;
  border-radius: 0.65rem !important;
}

.yap-send-btn {
  right: 0.95rem !important;
  bottom: 0.82rem !important;
  width: 2.72rem !important;
  height: 2.72rem !important;
}

.yap-ctx-time {
  padding: 0.48rem 0.72rem 0.38rem;
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
  color: rgb(255 225 232 / 0.68);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.yap-info-panel {
  width: min(21rem, 100%) !important;
}

.yap-info-body {
  gap: 0.75rem !important;
  padding: 1rem !important;
}

.yap-info-media-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.85rem !important;
}

.yap-info-bucket-title {
  margin: 0 0 0.48rem;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.yap-info-bucket-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.36rem;
}

.yap-info-link-list {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.yap-info-link-row {
  display: grid;
  gap: 0.12rem;
  padding: 0.55rem 0.62rem;
  border: 1px solid rgb(255 83 125 / 0.16);
  border-radius: 0.65rem;
  background: rgb(24 0 9 / 0.62);
  color: inherit;
  text-decoration: none;
}

.yap-info-link-type {
  color: var(--yap-hot);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
}

.yap-info-link-row strong,
.yap-info-link-row em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yap-info-link-row strong { color: #fff; font-size: 0.82rem; }
.yap-info-link-row em { color: rgb(255 225 232 / 0.62); font-size: 0.72rem; font-style: normal; }

.yap-call-top-bar { padding: 1.1rem 1.35rem 2.2rem !important; }
.yap-call-controls { gap: 0.8rem !important; padding: 1.2rem !important; }
.yap-call-ctrl { min-width: 3.25rem !important; height: 3.25rem !important; border-radius: 0.95rem !important; }

@media (max-width: 760px) {
  body.shell-page-yap .shell-sidebar {
    width: 100% !important;
  }
  .yap-sidebar { width: 100% !important; }
  .yap-chat-header { min-height: 4.6rem !important; padding: 0.8rem 0.9rem !important; }
  .yap-messages { padding: 0.9rem 0.75rem 0.7rem !important; }
  .yap-msg,
  .yap-msg-me { max-width: 82% !important; }
  .yap-input-area,
  .yap-waiting,
  .yap-request-card { margin: 0 0.75rem 0.75rem !important; }
}

/* ── Density pass 2: smaller UI, tighter grouping, richer shared cards,
   dedicated call window, info panel re-skin ─────────────────────────────── */

/* Background: let the shared shell blobs show through like every other
   page — .shell-layout must stay transparent (fixed above), this just
   keeps .yap-page/.yap-main from re-flattening it. */
.yap-page,
.yap-main {
  background: transparent !important;
}

/* -- further shrink -------------------------------------------------- */
.yap-sidebar { width: 18.5rem !important; }

.yap-search-wrap { padding: 0.85rem 0.75rem 0.55rem !important; }
.yap-search-input { height: 2.4rem !important; padding-left: 2.35rem !important; font-size: 0.84rem !important; }
.yap-search-icon { left: 1.5rem !important; top: 2rem !important; width: 0.9rem !important; height: 0.9rem !important; }

.yap-tabs { min-height: 2.7rem !important; }
.yap-tab { min-height: 2.5rem !important; padding: 0.4rem 0.4rem 0.6rem !important; font-size: 0.8rem !important; }

.yap-conv-list { padding: 0.4rem 0.45rem 0.7rem !important; }
.yap-conv-item { min-height: 3.6rem !important; margin-bottom: 0.3rem !important; padding: 0.55rem 0.6rem !important; gap: 0.6rem !important; border-radius: 0.65rem !important; }
.yap-conv-av .yap-avatar.sz-40,
.yap-chat-avatar .yap-avatar.sz-40 { width: 2.25rem !important; height: 2.25rem !important; font-size: 0.9rem !important; }
.yap-conv-name, .yap-chat-name { font-size: 0.85rem !important; }
.yap-conv-time, .yap-conv-preview, .yap-conv-preview-text { font-size: 0.74rem !important; }

.yap-chat-header { min-height: 3.6rem !important; padding: 0.65rem 1rem 0.6rem !important; gap: 0.6rem !important; }
.yap-chat-handle { font-size: 0.72rem !important; }
.yap-header-actions { gap: 0.4rem !important; }
.yap-header-icon { width: 2.1rem !important; height: 2.1rem !important; border-radius: 0.6rem !important; }
.yap-header-icon svg { width: 0.95rem !important; height: 0.95rem !important; }

.yap-messages { padding: 0.9rem 1.1rem 0.6rem !important; gap: 0.3rem !important; }

.yap-msg { max-width: min(22rem, 52%) !important; }
.yap-msg-me { max-width: min(20rem, 44%) !important; }
.yap-msg-row { gap: 0.32rem !important; }
.yap-msg-avatar .yap-avatar,
.yap-msg-avatar .yap-avatar.sz-36 { width: 1.65rem !important; height: 1.65rem !important; font-size: 0.66rem !important; }
.yap-bubble { padding: 0.44rem 0.62rem !important; border-radius: 0.7rem !important; font-size: 0.85rem !important; line-height: 1.34 !important; }

.yap-input-area, .yap-waiting, .yap-request-card { margin: 0 1.1rem 0.9rem !important; border-radius: 0.9rem !important; }
.yap-input-main { min-height: 4.4rem !important; padding: 0.62rem 0.8rem !important; }
.yap-toolbar-btn { width: 1.9rem !important; height: 1.9rem !important; border-radius: 0.55rem !important; }
.yap-toolbar-btn svg { width: 0.95rem !important; height: 0.95rem !important; }
.yap-textarea { font-size: 0.88rem !important; }
.yap-send-btn { right: 0.75rem !important; bottom: 0.65rem !important; width: 2.3rem !important; height: 2.3rem !important; }

.yap-chat-intro-avatar .yap-avatar.sz-96,
.yap-chat-intro-avatar .yap-avatar.sz-64 { width: 4.4rem !important; height: 4.4rem !important; font-size: 1.7rem !important; }
.yap-chat-intro-name { font-size: 1.15rem !important; }

/* -- tighter message grouping: consecutive same-sender msgs (<=2min)
   hug together (still separate elements) instead of eating vertical
   space with a full gap + own meta row each time -------------------- */
.yap-msg-group-follow { margin-top: -0.24rem !important; }

/* -- voice message: compact, no duration text, waveform only -------- */
.yap-audio-msg { min-width: 9.5rem !important; max-width: 12.5rem !important; padding: 0.36rem 0.48rem !important; }
.yap-audio-wrap { gap: 0.45rem !important; }
.yap-audio-play-btn { width: 1.7rem !important; height: 1.7rem !important; }
.yap-audio-play-btn svg { width: 0.62rem !important; height: 0.62rem !important; }
.yap-audio-track { min-width: 5.75rem !important; height: 1.2rem !important; }
.yap-audio-track span { width: 2px; }

/* -- shared post card: mini vibe-card (avatar+handle+time, thumb,
   title, caption) — same footprint as a shared vibe, no engagement
   row (no like/comment/share/save) ----------------------------------- */
.yap-post-card {
  display: flex;
  flex-direction: column;
  width: min(13rem, 68vw);
  border-radius: 0.85rem;
  overflow: hidden;
  background: oklch(0.19 0.07 18);
  border: 1px solid oklch(0.92 0.04 15 / 0.14);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}
.yap-post-card:hover { border-color: oklch(0.92 0.04 15 / 0.26); }
.yap-post-card-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.55rem;
}
.yap-post-card-avatar {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 9999px;
  background-color: oklch(0.35 0.12 18);
  background-size: cover;
  background-position: center;
  color: var(--rose);
  display: grid;
  place-items: center;
  font-size: 0.6rem;
  font-weight: 700;
  flex-shrink: 0;
  font-family: var(--font-serif);
}
.yap-post-card-avatar.has-image { color: transparent; }
.yap-post-card-meta { display: flex; flex-direction: column; min-width: 0; gap: 0.02rem; }
.yap-post-card-handle {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--rose);
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.yap-post-card-handle .gold-tick svg { width: 0.62rem; height: 0.62rem; }
.yap-post-card-time { font-size: 0.58rem; color: oklch(0.92 0.04 15 / 0.4); font-family: var(--font-mono); }
.yap-post-card-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: oklch(0.15 0.06 18);
  background-size: cover;
  background-position: center;
}
.yap-post-card-body { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.5rem 0.6rem 0.6rem; }
.yap-post-card-title { font-size: 0.76rem; color: #fff; font-weight: 600; line-height: 1.28; }
.yap-post-card-caption {
  font-size: 0.68rem;
  color: oklch(0.92 0.04 15 / 0.6);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.yap-post-card-caption[hidden] { display: none; }

/* -- dedicated call window: when the /yap.html?call= tab loads, hide
   the normal sidebar/chat chrome behind a plain loading screen instead
   of flashing the full inbox before the call UI takes over ----------- */
.yap-call-connecting {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: oklch(0.09 0.04 18);
  color: oklch(0.92 0.04 15 / 0.65);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
body.yap-call-window .yap-call-connecting:not([hidden]) { display: flex; }
.yap-call-connecting-spinner {
  width: 2.25rem; height: 2.25rem;
  border-radius: 9999px;
  border: 3px solid oklch(0.92 0.04 15 / 0.15);
  border-top-color: var(--yap-hot, var(--rose-hot));
  animation: spin 0.9s linear infinite;
}
body.yap-call-window .shell-sidebar,
body.yap-call-window .shell-blobs,
body.yap-call-window .yap-sidebar { display: none !important; }
body.yap-call-window .yap-main { visibility: hidden; }
body.yap-call-window .yap-page { background: oklch(0.09 0.04 18) !important; }

/* Call screens: slightly larger, calmer focal point now that they're
   the only thing on screen in the dedicated call tab. */
.yap-incoming-av .yap-avatar,
.yap-call-placeholder-av .yap-avatar { width: 6rem !important; height: 6rem !important; font-size: 2.2rem !important; }
.yap-incoming-screen { padding: 3rem 3rem 2.25rem; gap: 1.25rem; }
.yap-call-audio-card .yap-avatar { width: 6rem !important; height: 6rem !important; font-size: 2.2rem !important; }

/* -- info panel: re-skin to the page's red/wine palette instead of the
   older flat panel color -------------------------------------------- */
.yap-info-panel {
  background: linear-gradient(165deg, rgb(64 1 21 / 0.97), rgb(20 0 7 / 0.98)) !important;
  border-left: 1px solid rgb(255 83 125 / 0.18) !important;
}
.yap-info-header { border-bottom-color: rgb(255 83 125 / 0.16) !important; }
.yap-info-title,
.yap-info-name { color: #fff !important; }
.yap-info-handle { color: rgb(255 225 232 / 0.55) !important; }
.yap-info-visit-btn {
  background: rgb(255 45 104 / 0.14) !important;
  border-color: rgb(255 83 125 / 0.3) !important;
  color: rgb(255 236 240 / 0.85) !important;
}
.yap-info-visit-btn:hover { background: rgb(255 45 104 / 0.24) !important; color: #fff !important; }
.yap-block-btn {
  background: rgb(255 45 104 / 0.12) !important;
  border-color: rgb(255 45 104 / 0.4) !important;
  color: rgb(255 150 175) !important;
}
.yap-block-btn:hover { background: rgb(255 45 104 / 0.22) !important; }
.yap-info-delete-btn {
  background: rgb(255 45 104 / 0.08) !important;
  border-color: rgb(255 45 104 / 0.28) !important;
  color: rgb(255 150 175) !important;
}
.yap-info-delete-btn:hover { background: rgb(255 45 104 / 0.16) !important; }
.yap-info-section-label { color: rgb(255 225 232 / 0.4) !important; }

/* ── Density pass 3: thread card redesign, voice-note rebuild, reaction
   spacing fix ───────────────────────────────────────────────────────────── */

/* -- reactions must hug the bubble; receipt/time reads as a clearly
   separate line below the reaction pill, not the other way round ---- */
.yap-reactions { margin-top: 0.05rem !important; }
.yap-msg-meta { margin-top: 0.2rem !important; }

/* -- shared thread card: was still on the old teal/red gradient from
   before the page palette was unified — re-skin to match the post/vibe
   card family (dark wine card, --yap-hot accents) ------------------- */
.yap-thread-card {
  max-width: min(13rem, 68vw) !important;
  padding: 0 !important;
  gap: 0 !important;
  border: 1px solid oklch(0.92 0.04 15 / 0.14) !important;
  border-radius: 0.85rem !important;
  background: oklch(0.19 0.07 18) !important;
  box-shadow: none !important;
  overflow: hidden;
}
.yap-reel-card-me { border-color: oklch(0.92 0.04 15 / 0.14) !important; background: oklch(0.19 0.07 18) !important; }
.yap-thread-card:hover { border-color: oklch(0.92 0.04 15 / 0.28) !important; }
.yap-thread-kicker {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 0.65rem 0;
  color: var(--yap-hot, var(--rose-hot));
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.yap-thread-kicker svg { width: 0.8rem; height: 0.8rem; }
.yap-thread-card strong {
  display: block;
  padding: 0.35rem 0.65rem 0;
  font-size: 0.82rem !important;
  color: #fff;
}
.yap-thread-creator {
  padding: 0.3rem 0.65rem 0.6rem;
  font-size: 0.68rem !important;
}

/* -- voice note: rebuilt to match reference — bold round play button,
   bright waveform, duration inline, timestamp under the bubble ------ */
.yap-audio-msg { min-width: 13.5rem !important; max-width: 17rem !important; padding: 0.4rem 0.55rem !important; }
.yap-audio-wrap {
  min-width: 0 !important;
  max-width: none !important;
  width: 100%;
  gap: 0.5rem !important;
}
.yap-audio-play-btn {
  width: 2.3rem !important;
  height: 2.3rem !important;
  background: linear-gradient(145deg, rgb(255 45 104 / 0.95), rgb(150 16 59 / 0.98)) !important;
  color: #fff !important;
}
.yap-audio-play-btn:hover { filter: brightness(1.08); }
.yap-audio-play-btn svg { width: 0.7rem !important; height: 0.7rem !important; }
.yap-audio-track {
  min-width: 6.5rem !important;
  height: 1.6rem !important;
  overflow: visible !important;
  gap: 0.15rem !important;
}
.yap-audio-track span {
  width: 2px;
  height: 0.45rem;
  border-radius: 99px;
  background: var(--yap-hot, var(--rose-hot));
  opacity: 0.55;
}
.yap-audio-track span:nth-child(4n + 1) { height: 1.5rem; opacity: 0.95; }
.yap-audio-track span:nth-child(4n + 2) { height: 0.75rem; opacity: 0.7; }
.yap-audio-track span:nth-child(4n + 3) { height: 1.2rem; opacity: 0.85; }
.yap-audio-track span:nth-child(4n + 4) { height: 0.55rem; opacity: 0.6; }
/* .yap-audio-progress used to sit as a flex sibling of the waveform bars,
   forcing its own (growing) width into the row instead of overlaying
   the bars — pull it out of flow so it can act as a play-progress mask. */
.yap-audio-progress {
  position: absolute;
  inset: 0;
  width: 0%;
  background: rgb(255 255 255 / 0.28);
  mix-blend-mode: overlay;
  border-radius: 99px;
  pointer-events: none;
  transition: width 0.1s linear;
}
.yap-audio-dur {
  display: inline-block !important;
  font-size: 0.7rem !important;
  color: rgb(255 236 240 / 0.75);
  opacity: 1 !important;
  flex-shrink: 0;
  min-width: 2rem;
}
.yap-audio-icon { display: none !important; }
.yap-msg:has(.yap-audio-msg) .yap-msg-time { display: inline-block !important; }
.yap-msg-other:has(.yap-audio-msg) .yap-msg-meta,
.yap-msg-group-before:has(.yap-audio-msg) .yap-msg-meta { display: flex !important; }

/* ── Density pass 4: reaction badge attaches to the bubble corner ───────── */
/* the bubble/media/card content sits above the reaction badge so the
   badge tucks in behind it, with only its overhang peeking out */
.yap-bubble-outer > *:not(.yap-msg-hover-reactions):not(.yap-reactions) {
  position: relative;
  z-index: 2;
}
.yap-reactions {
  position: absolute;
  bottom: -0.95rem;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.15rem;
  margin-top: 0 !important;
  z-index: 3;
}
/* ease the bubble's corner nearest the badge so the reaction reads as
   part of the message's own shape instead of a separate floating chip */
.yap-msg-me .yap-bubble-outer > *:has(+ .yap-reactions) { border-bottom-right-radius: 0.3rem !important; }
.yap-msg-other .yap-bubble-outer > *:has(+ .yap-reactions) { border-bottom-left-radius: 0.3rem !important; }
.yap-msg-me .yap-reactions { right: -0.2rem; }
.yap-msg-other .yap-reactions { left: -0.2rem; }
.yap-reaction {
  padding: 0.1rem 0.4rem !important;
  background: rgb(80 8 30) !important;
  border: 1px solid rgb(255 255 255 / 0.14) !important;
  box-shadow: 0 4px 14px oklch(0 0 0 / 0.45);
  font-size: 0.72rem !important;
}
.yap-reaction.mine {
  background: rgb(150 16 59) !important;
  border-color: rgb(255 180 200 / 0.3) !important;
}
/* leave room below the bubble for the overlapping badge before the
   receipt/time row starts, so they don't visually collide */
.yap-msg:has(.yap-reactions) .yap-msg-meta { margin-top: 1.1rem !important; }
/* the badge is absolutely positioned so it doesn't add to this message's
   own layout height — without extra margin here, it overlaps the very
   next bubble instead of just sitting on this one's corner. This is the
   one that actually pushes the *next* message down. */
.yap-msg:has(.yap-reactions) { margin-bottom: 1rem !important; }

/* ── Density pass 5: info panel — browser-style tabs, sticky header ─────── */
.yap-info-header {
  position: sticky !important;
  top: 0;
  z-index: 5;
  background: rgb(30 0 10 / 0.98) !important;
}
.yap-info-tabs {
  display: flex;
  gap: 0.3rem;
  border-bottom: 1px solid rgb(255 83 125 / 0.16);
  padding-bottom: 0.5rem;
}
.yap-info-tab {
  flex: 1;
  padding: 0.45rem 0.4rem;
  background: none;
  border: none;
  border-radius: 0.5rem;
  color: rgb(255 225 232 / 0.5);
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, color 0.15s;
}
.yap-info-tab:hover { color: rgb(255 236 240 / 0.85); background: rgb(255 255 255 / 0.06); }
.yap-info-tab.active {
  color: #fff;
  background: linear-gradient(145deg, rgb(255 45 104 / 0.32), rgb(144 9 52 / 0.26));
}
.yap-info-tab-panel { display: none; }
.yap-info-tab-panel.active { display: block; }

/* -- when the info panel is open, shrink the chat instead of letting the
   panel cover the messages — derived straight off the panel's own
   [hidden] state, no JS toggle needed ------------------------------- */
@media (min-width: 641px) {
  .yap-chat {
    transition: margin-right 0.2s ease;
  }
  .yap-chat:has(~ .yap-info-panel:not([hidden])) {
    margin-right: 21rem;
  }
}

/* ── Vibe Link: cinematic call experience ─────────────────────────────── */
.yap-call-modal {
  background:
    radial-gradient(circle at 18% 16%, rgb(255 24 84 / 0.18), transparent 30rem),
    radial-gradient(circle at 84% 82%, rgb(154 0 52 / 0.2), transparent 34rem),
    rgb(5 0 3 / 0.94);
  backdrop-filter: blur(24px) saturate(1.2);
}
.yap-call-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.24;
  background-image:
    linear-gradient(rgb(255 255 255 / 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.025) 1px, transparent 1px);
  background-size: 4.5rem 4.5rem;
  mask-image: radial-gradient(circle at center, black, transparent 76%);
}

.yap-incoming-screen {
  width: min(31rem, calc(100vw - 2rem));
  min-width: 0;
  padding: 2rem 2.25rem 2.2rem;
  gap: 0.72rem;
  border: 1px solid rgb(255 105 143 / 0.26);
  border-radius: 2.25rem;
  background:
    linear-gradient(150deg, rgb(255 255 255 / 0.075), transparent 42%),
    radial-gradient(circle at 50% 28%, rgb(255 24 84 / 0.2), transparent 36%),
    linear-gradient(155deg, rgb(52 3 20 / 0.97), rgb(13 1 7 / 0.98));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.14),
    inset 0 -1px 0 rgb(255 32 91 / 0.08),
    0 2rem 7rem rgb(0 0 0 / 0.72),
    0 0 4rem rgb(255 13 72 / 0.12);
  isolation: isolate;
}
.yap-incoming-screen::before {
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background:
    linear-gradient(115deg, transparent 36%, rgb(255 255 255 / 0.08) 48%, transparent 60%);
  animation: yap-call-sheen 5s ease-in-out infinite;
}
.yap-call-brand,
.yap-call-brand-mini {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  color: rgb(255 218 228 / 0.72);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.yap-call-brand {
  align-self: flex-start;
  margin-bottom: 0.45rem;
}
.yap-call-brand i,
.yap-call-brand-mini i {
  display: block;
  width: 0.82rem;
  height: 0.82rem;
  background: linear-gradient(145deg, #ff89a6, #ff1652 60%, #a90034);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  filter: drop-shadow(0 0 0.36rem rgb(255 22 82 / 0.8));
}
.yap-incoming-avatar-wrap {
  position: relative;
  z-index: 2;
  margin: 1.15rem 0 0.55rem;
}
.yap-incoming-avatar-wrap .yap-avatar {
  width: 7.2rem !important;
  height: 7.2rem !important;
  border: 2px solid rgb(255 205 218 / 0.5);
  box-shadow:
    0 0 0 0.5rem rgb(255 34 92 / 0.08),
    0 0 2.5rem rgb(255 20 78 / 0.32),
    0 1.5rem 3rem rgb(0 0 0 / 0.45);
}
.yap-incoming-live-dot {
  position: absolute;
  right: 0.22rem;
  bottom: 0.45rem;
  width: 1.05rem;
  height: 1.05rem;
  border: 0.24rem solid rgb(35 2 14);
  border-radius: 50%;
  background: #32eb8c;
  box-shadow: 0 0 0.8rem rgb(50 235 140 / 0.8);
}
.yap-incoming-rings,
.yap-incoming-rings i {
  position: absolute;
  left: 50%;
  top: 8.4rem;
  translate: -50% -50%;
  border-radius: 50%;
  pointer-events: none;
}
.yap-incoming-rings { width: 1px; height: 1px; z-index: 0; }
.yap-incoming-rings i {
  top: 50%;
  width: 8rem;
  height: 8rem;
  border: 1px solid rgb(255 63 112 / 0.42);
  animation: yap-call-ring 2.7s ease-out infinite;
}
.yap-incoming-rings i:nth-child(2) { animation-delay: 0.85s; }
.yap-incoming-rings i:nth-child(3) { animation-delay: 1.7s; }
.yap-incoming-name {
  max-width: 100%;
  font-size: clamp(1.55rem, 5vw, 2.05rem);
  letter-spacing: -0.035em;
  text-align: center;
  text-shadow: 0 0 1.5rem rgb(255 52 105 / 0.18);
}
.yap-incoming-label {
  color: rgb(255 220 229 / 0.58);
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.yap-incoming-type {
  margin-top: 0.28rem;
  border-color: rgb(255 74 121 / 0.25);
  background: rgb(255 38 96 / 0.09);
  color: rgb(255 186 204 / 0.78);
}
.yap-incoming-btns {
  width: 100%;
  gap: 0.85rem;
  margin-top: 1.3rem;
}
.yap-btn-answer,
.yap-btn-decline {
  position: relative;
  flex: 1;
  width: auto;
  height: 6.4rem;
  padding: 0.75rem 0.85rem;
  gap: 0.16rem;
  border: 1px solid rgb(255 255 255 / 0.13);
  border-radius: 1.4rem;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s, filter 0.2s;
}
.yap-btn-answer {
  background: linear-gradient(145deg, rgb(41 207 127 / 0.95), rgb(10 126 75 / 0.98));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25), 0 0.8rem 2.2rem rgb(15 190 108 / 0.17);
}
.yap-btn-decline {
  background: linear-gradient(145deg, rgb(255 47 96 / 0.98), rgb(153 0 48 / 0.98));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.2), 0 0.8rem 2.2rem rgb(255 22 80 / 0.18);
}
.yap-btn-answer::before,
.yap-btn-decline::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -80% -30%;
  background: linear-gradient(105deg, transparent 38%, rgb(255 255 255 / 0.22) 50%, transparent 62%);
  transform: translateX(-60%);
  transition: transform 0.55s ease;
}
.yap-btn-answer:hover,
.yap-btn-decline:hover {
  opacity: 1;
  transform: translateY(-0.28rem) scale(1.015);
  border-color: rgb(255 255 255 / 0.3);
  filter: saturate(1.12);
}
.yap-btn-answer:hover::before,
.yap-btn-decline:hover::before { transform: translateX(62%); }
.yap-btn-answer:active,
.yap-btn-decline:active { transform: translateY(0) scale(0.98); }
.yap-btn-answer:disabled,
.yap-btn-decline:disabled { opacity: 0.45; cursor: wait; transform: none; }
.yap-call-action-orb {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  margin-bottom: 0.25rem;
  border: 1px solid rgb(255 255 255 / 0.24);
  border-radius: 50%;
  background: rgb(255 255 255 / 0.13);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.16);
}
.yap-call-action-orb svg { width: 1.18rem; height: 1.18rem; }
.yap-phone-down-icon { transform: rotate(135deg); }
.yap-btn-answer strong,
.yap-btn-decline strong { font-size: 0.77rem; letter-spacing: 0.02em; }
.yap-btn-answer small,
.yap-btn-decline small { font-size: 0.56rem; font-weight: 500; opacity: 0.68; }

.yap-active-screen {
  background:
    radial-gradient(circle at 16% 12%, rgb(255 24 84 / 0.17), transparent 28rem),
    radial-gradient(circle at 85% 85%, rgb(128 7 55 / 0.22), transparent 30rem),
    linear-gradient(145deg, #17050d, #080308 55%, #10030a);
  isolation: isolate;
}
.yap-active-screen::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 44%, rgb(255 255 255 / 0.025) 49%, transparent 54%),
    radial-gradient(circle at center, transparent 48%, rgb(0 0 0 / 0.32));
}
.yap-call-video-placeholder {
  background:
    radial-gradient(circle at 50% 43%, rgb(255 31 89 / 0.19), transparent 24rem),
    linear-gradient(145deg, #220713, #09040a 62%, #13040c);
}
.yap-call-video-placeholder::before {
  content: "";
  position: absolute;
  width: min(35rem, 76vw);
  aspect-ratio: 1;
  border: 1px solid rgb(255 60 110 / 0.12);
  border-radius: 50%;
  box-shadow:
    0 0 0 4rem rgb(255 40 95 / 0.025),
    0 0 0 8rem rgb(255 40 95 / 0.018);
  animation: yap-call-halo 4s ease-in-out infinite;
}
.yap-call-placeholder-av,
.yap-call-video-placeholder > span { position: relative; z-index: 1; }
.yap-call-placeholder-av .yap-avatar {
  width: 8rem !important;
  height: 8rem !important;
  border: 2px solid rgb(255 185 205 / 0.46);
  box-shadow: 0 0 0 0.65rem rgb(255 35 93 / 0.06), 0 0 3.5rem rgb(255 18 78 / 0.25);
}
.yap-call-top-bar {
  top: 1rem;
  left: 1rem;
  right: 1rem;
  padding: 0.85rem 1rem !important;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 1.2rem;
  background: linear-gradient(145deg, rgb(34 5 18 / 0.72), rgb(8 2 7 / 0.54));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.1), 0 1rem 2.8rem rgb(0 0 0 / 0.18);
  backdrop-filter: blur(22px) saturate(1.3);
}
.yap-call-brand-mini { margin-bottom: 0.08rem; font-size: 0.53rem; }
.yap-call-brand-mini i { width: 0.62rem; height: 0.62rem; }
.yap-call-peer { gap: 0.16rem; }
.yap-call-peer-name { font-size: 1.02rem; letter-spacing: -0.015em; }
.yap-call-type,
.yap-call-timer {
  border-color: rgb(255 95 137 / 0.2);
  background: rgb(255 47 104 / 0.08);
  color: rgb(255 213 225 / 0.68);
}
.yap-call-status {
  position: relative;
  padding-left: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.yap-call-status::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 0.45rem;
  height: 0.45rem;
  translate: 0 -50%;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0.65rem currentColor;
  animation: yap-call-status-pulse 1.4s ease-in-out infinite;
}
.yap-call-controls {
  left: 50%;
  right: auto;
  bottom: 1.1rem;
  width: min(34rem, calc(100vw - 2rem));
  padding: 0.72rem !important;
  gap: 0.62rem !important;
  transform: translateX(-50%);
  border: 1px solid rgb(255 255 255 / 0.11);
  border-radius: 1.35rem;
  background: linear-gradient(145deg, rgb(42 6 21 / 0.78), rgb(9 2 8 / 0.72));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.11), 0 1.5rem 4rem rgb(0 0 0 / 0.42);
  backdrop-filter: blur(24px) saturate(1.25);
}
.yap-call-ctrl {
  min-width: 0 !important;
  width: auto;
  height: 4.5rem !important;
  flex: 1;
  padding: 0.62rem 0.72rem;
  flex-direction: row;
  gap: 0.62rem;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 1rem !important;
  background: linear-gradient(145deg, rgb(255 255 255 / 0.12), rgb(255 255 255 / 0.055));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.09);
  transition: transform 0.18s ease, background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.yap-call-ctrl-icon {
  width: 2.65rem;
  height: 2.65rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 0.13);
  border-radius: 0.82rem;
  background: rgb(255 255 255 / 0.08);
  transition: transform 0.18s, background 0.18s;
}
.yap-call-ctrl-icon svg { width: 1.18rem; height: 1.18rem; }
.yap-call-ctrl-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  text-align: left;
}
.yap-call-ctrl-copy b {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  line-height: 1;
}
.yap-call-ctrl-copy small {
  color: rgb(255 228 235 / 0.45);
  font-family: var(--font-mono);
  font-size: 0.52rem;
  line-height: 1;
}
.yap-call-ctrl:hover {
  transform: translateY(-0.2rem);
  border-color: rgb(255 119 153 / 0.24);
  background: linear-gradient(145deg, rgb(255 255 255 / 0.17), rgb(255 59 111 / 0.08));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.14), 0 0.85rem 1.8rem rgb(0 0 0 / 0.2);
}
.yap-call-ctrl:hover .yap-call-ctrl-icon { transform: scale(1.06); background: rgb(255 255 255 / 0.13); }
.yap-call-ctrl.active {
  border-color: rgb(255 193 84 / 0.32);
  background: linear-gradient(145deg, rgb(255 178 59 / 0.2), rgb(151 76 0 / 0.12));
  color: #ffd68b;
}
.yap-call-end {
  background: linear-gradient(145deg, #ff315f, #ad0038) !important;
  border-color: rgb(255 117 151 / 0.42);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.2), 0 0.8rem 2rem rgb(255 15 72 / 0.16);
}
.yap-call-end .yap-call-ctrl-icon { background: rgb(72 0 25 / 0.25); }
.yap-call-end:hover {
  background: linear-gradient(145deg, #ff4973, #c40042) !important;
  border-color: rgb(255 184 201 / 0.55);
}
.yap-call-ctrl:disabled { opacity: 0.38; filter: grayscale(0.3); }
.yap-local-video,
.yap-local-placeholder {
  bottom: 7.4rem;
  right: 1.25rem;
  border: 1px solid rgb(255 198 215 / 0.34);
  border-radius: 1.2rem;
  box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 0.45), 0 0 0 0.3rem rgb(255 28 88 / 0.05);
}
.yap-call-audio-card {
  min-width: min(25rem, calc(100vw - 3rem));
  padding: 2.2rem 2rem;
  gap: 1rem;
  border-color: rgb(255 113 151 / 0.2);
  border-radius: 2rem;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 0.09), transparent 48%),
    rgb(45 5 21 / 0.5);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.11), 0 2rem 5rem rgb(0 0 0 / 0.3);
  backdrop-filter: blur(18px);
}
.yap-call-audio-card .yap-avatar {
  width: 8rem !important;
  height: 8rem !important;
  border: 2px solid rgb(255 189 207 / 0.45);
  box-shadow: 0 0 0 0.6rem rgb(255 37 95 / 0.06), 0 0 3rem rgb(255 18 76 / 0.24);
}
.yap-call-audio-name { font-size: 1.45rem; letter-spacing: -0.025em; }
.yap-call-audio-bars { height: 1.5rem; gap: 0.3rem; }
.yap-call-audio-bars span {
  width: 0.3rem;
  background: linear-gradient(#ff7398, #ff174f);
  box-shadow: 0 0 0.55rem rgb(255 23 79 / 0.5);
}
.yap-call-connecting {
  background:
    radial-gradient(circle at center, rgb(255 24 84 / 0.15), transparent 18rem),
    linear-gradient(145deg, #1c050f, #070307);
  color: rgb(255 220 229 / 0.68);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.yap-call-connecting-spinner {
  width: 3.2rem;
  height: 3.2rem;
  border: 0;
  border-radius: 0;
  background: linear-gradient(145deg, #ff91ac, #ff1551 58%, #9c0030);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  filter: drop-shadow(0 0 0.45rem rgb(255 25 83 / 0.9)) drop-shadow(0 0 1.4rem rgb(255 25 83 / 0.4));
  animation: yap-call-loader 1.25s ease-in-out infinite;
}

@keyframes yap-call-ring {
  0% { transform: scale(0.8); opacity: 0; }
  18% { opacity: 0.65; }
  100% { transform: scale(1.85); opacity: 0; }
}
@keyframes yap-call-halo {
  0%, 100% { transform: scale(0.96); opacity: 0.55; }
  50% { transform: scale(1.04); opacity: 0.9; }
}
@keyframes yap-call-status-pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.15); }
}
@keyframes yap-call-sheen {
  0%, 20% { transform: translateX(-70%); opacity: 0; }
  48% { opacity: 1; }
  75%, 100% { transform: translateX(70%); opacity: 0; }
}
@keyframes yap-call-loader {
  0%, 100% { transform: rotate(-12deg) scale(0.75); opacity: 0.58; }
  45% { transform: rotate(10deg) scale(1.12); opacity: 1; }
}

@media (max-width: 560px) {
  .yap-call-modal {
    align-items: stretch;
    background:
      radial-gradient(circle at 50% 22%, rgb(255 26 85 / 0.22), transparent 18rem),
      linear-gradient(165deg, #260812, #090307 58%, #16050e);
  }
  .yap-call-modal::before {
    opacity: 0.18;
    background-size: 3.2rem 3.2rem;
  }
  .yap-incoming-screen {
    width: 100vw;
    min-height: 100dvh;
    padding: max(1.35rem, env(safe-area-inset-top)) 1.15rem max(1.1rem, env(safe-area-inset-bottom));
    justify-content: center;
    gap: 0.65rem;
    border: 0;
    border-radius: 0;
    background:
      linear-gradient(145deg, rgb(255 255 255 / 0.04), transparent 42%),
      radial-gradient(circle at 50% 36%, rgb(255 29 89 / 0.19), transparent 17rem);
    box-shadow: none;
  }
  .yap-call-brand {
    position: absolute;
    top: max(1.25rem, env(safe-area-inset-top));
    left: 1.25rem;
    margin: 0;
  }
  .yap-incoming-avatar-wrap { margin: -1.4rem 0 1rem; }
  .yap-incoming-avatar-wrap .yap-avatar {
    width: 7.6rem !important;
    height: 7.6rem !important;
    font-size: 2.5rem !important;
  }
  .yap-incoming-rings { top: 42%; }
  .yap-incoming-name { font-size: clamp(1.8rem, 8vw, 2.35rem); }
  .yap-incoming-label { font-size: 0.68rem; }
  .yap-incoming-btns {
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: max(1rem, env(safe-area-inset-bottom));
    width: auto;
    gap: 0.7rem;
    margin: 0;
  }
  .yap-btn-answer,
  .yap-btn-decline { height: 5.7rem; border-radius: 1.3rem; }
  .yap-call-action-orb { width: 2.4rem; height: 2.4rem; }

  .yap-active-screen {
    min-height: 100dvh;
    background:
      radial-gradient(circle at 50% 28%, rgb(255 26 84 / 0.19), transparent 19rem),
      linear-gradient(165deg, #210710, #080307 62%, #13040c);
  }
  .yap-call-top-bar {
    top: max(0.65rem, env(safe-area-inset-top));
    left: 0.65rem;
    right: 0.65rem;
    min-height: 4.65rem;
    padding: 0.68rem 0.78rem !important;
    align-items: center;
    border-radius: 1.15rem;
  }
  .yap-call-brand-mini { font-size: 0.48rem; }
  .yap-call-peer-name { max-width: 48vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .yap-call-state { gap: 0.28rem; }
  .yap-call-status { font-size: 0.62rem; }
  .yap-call-timer { min-height: 1.3rem; font-size: 0.58rem; }

  .yap-call-video-placeholder { padding-bottom: 5.5rem; }
  .yap-call-video-placeholder::before { width: 78vw; }
  .yap-call-placeholder-av .yap-avatar,
  .yap-call-audio-card .yap-avatar {
    width: 7.2rem !important;
    height: 7.2rem !important;
  }
  .yap-call-audio-card {
    min-width: calc(100vw - 2.2rem);
    padding: 1.8rem 1.2rem;
    border-radius: 1.65rem;
  }
  .yap-call-audio-name { font-size: 1.3rem; }

  .yap-call-controls {
    bottom: max(0.7rem, env(safe-area-inset-bottom));
    width: calc(100vw - 1.2rem);
    gap: 0.4rem !important;
    padding: 0.5rem !important;
    border-radius: 1.45rem;
  }
  .yap-call-ctrl {
    height: 5.15rem !important;
    padding: 0.45rem 0.25rem;
    justify-content: center;
    flex-direction: column;
    gap: 0.35rem;
    border-radius: 1.08rem !important;
  }
  .yap-call-ctrl-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
  }
  .yap-call-ctrl-copy { align-items: center; text-align: center; }
  .yap-call-ctrl-copy small { display: none; }
  .yap-call-ctrl-copy b { font-size: 0.67rem; }
  .yap-call-end { transform: translateY(-0.35rem); }
  .yap-call-end:hover { transform: translateY(-0.5rem); }
  .yap-call-end .yap-call-ctrl-icon {
    width: 3rem;
    height: 3rem;
    box-shadow: 0 0 1.4rem rgb(255 24 82 / 0.34);
  }
  .yap-local-video,
  .yap-local-placeholder {
    top: calc(max(0.65rem, env(safe-area-inset-top)) + 5.3rem);
    right: 0.75rem;
    bottom: auto;
    width: 6.7rem;
    height: 9rem;
    border-radius: 1rem;
  }
  .yap-call-connecting { padding-bottom: env(safe-area-inset-bottom); }
}

@media (prefers-reduced-motion: reduce) {
  .yap-incoming-screen::before,
  .yap-incoming-rings i,
  .yap-call-video-placeholder::before,
  .yap-call-status::before,
  .yap-call-connecting-spinner { animation: none; }
}

/* Final mobile inbox geometry. Keep this at EOF: earlier density passes set
   an 18.5rem desktop sidebar with !important, which must not constrain phones. */
@media (max-width: 760px) {
  body.shell-page-yap .shell-layout:has(.yap-page),
  body.shell-page-yap .shell-main:has(.yap-page),
  .yap-page {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-inline: 0 !important;
    padding-inline: 0 !important;
  }

  .yap-sidebar {
    position: relative !important;
    inset: auto !important;
    display: flex;
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: none !important;
    border-right: 0 !important;
    transform: none !important;
    transition: none !important;
  }
  .yap-sidebar.hidden-mobile {
    display: none !important;
    transform: none !important;
  }
  .yap-main {
    display: none;
    flex: 1 1 100%;
    width: 100% !important;
    min-width: 0;
  }
  .yap-sidebar.hidden-mobile + .yap-main { display: flex; }
  .yap-search-wrap,
  .yap-tabs,
  .yap-conv-list { width: 100%; }
  .yap-conv-item { width: 100%; }

  body.shell-page-yap .shell-layout:has(.yap-page) {
    height: calc(100dvh - 3.75rem - env(safe-area-inset-top) - 5.45rem - env(safe-area-inset-bottom)) !important;
  }
  body.shell-page-yap .shell-main:has(.yap-page) { padding-bottom: 0 !important; }
}
