/* chat.css v136 = v135 + waveform real + cancelacion animada + touch-action micro.
No se toca tokens.css. Unidad --u en bloques nuevos. */
[hidden] { display: none !important; }

.chat {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  box-sizing: border-box;
  padding-bottom: calc(64 * var(--u) + env(safe-area-inset-bottom, 0px));
  background: var(--night-900, #081120);
}
.chat.has-keyboard { padding-bottom: env(safe-area-inset-bottom, 0px); }

.chat-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10 * var(--u)) calc(14 * var(--u));
  border-bottom: 1px solid var(--hairline);
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent);
}
.chat-top-av {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--peach-300), var(--peach-500));
  color: #2A160C;
}
.chat-top-av:focus-visible { outline: 2px solid var(--peach-100); outline-offset: 2px; }
.chat-top-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-top-av svg { width: 60%; height: 60%; fill: currentColor; }
.chat-top > span { flex: 1 1 auto; min-width: 0; }
.chat-top-name { font-size: calc(14 * var(--u)); font-weight: 700; color: var(--text); }
.chat-top-sub { font-size: calc(10.5 * var(--u)); color: var(--text-dim); }
.chat-top-sub.is-typing,
.chat-top-sub.is-recording {
  color: var(--peach-300);
  animation: typing-pulse 1.2s ease-in-out infinite;
}
@keyframes typing-pulse { 0%,100%{opacity:1} 50%{opacity:.55} }
@media (prefers-reduced-motion: reduce) {
  .chat-top-sub.is-typing,
  .chat-top-sub.is-recording { animation: none; }
}

.chat-clear {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  margin-left: auto;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  opacity: .75;
}
.chat-clear svg { width: 17px; height: 17px; fill: currentColor; }
.chat-clear:active { opacity: 1; color: #FFB4A8; }
.chat-clear:disabled { opacity: .3; cursor: default; }
.chat-clear:focus-visible { outline: 2px solid var(--peach-100); outline-offset: 2px; }

.chat-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: calc(14 * var(--u)) 8px;
  display: flex;
  flex-direction: column;
  gap: calc(8 * var(--u));
}

.bub {
  max-width: min(92%, 460px);
  padding: calc(10 * var(--u)) calc(13 * var(--u));
  border-radius: calc(14 * var(--u));
  font-size: calc(15 * var(--u));
  font-weight: 520;
  letter-spacing: -0.004em;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
  touch-action: pan-y;
}
.bub.is-swiping { will-change: transform; }
.bub.is-swiping-return { transition: transform .18s cubic-bezier(.2,.8,.3,1); }

.bub--mine {
  align-self: flex-end;
  background: linear-gradient(180deg, var(--peach-300), var(--peach-500));
  color: #21100A;
  font-weight: 560;
  border-bottom-right-radius: calc(4 * var(--u));
}
.bub--peer {
  align-self: flex-start;
  background: var(--surface-2, rgba(255,255,255,.07));
  color: var(--text);
  font-weight: 500;
  border: 1px solid var(--hairline);
  border-bottom-left-radius: calc(4 * var(--u));
}
.bub--broken {
  align-self: stretch;
  background: transparent;
  border: 1px dashed rgba(255,120,110,.5);
  color: #FFB4A8;
  font-size: calc(12.5 * var(--u));
  font-weight: 500;
  text-align: center;
}
.bub--expired {
  align-self: stretch;
  background: transparent;
  border: 1px dashed rgba(255,255,255,.18);
  color: var(--text-faint);
  font-size: calc(12 * var(--u));
  font-weight: 500;
  text-align: center;
  font-style: italic;
}
.bub-time {
  display: block;
  margin-top: calc(3 * var(--u));
  font-size: calc(9.5 * var(--u));
  opacity: .65;
  text-align: right;
}
.bub-text { display: block; }
.bub.is-selected {
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 calc(2.5 * var(--u)) var(--peach-300), 0 8px 22px rgba(0,0,0,.4);
  transform: scale(1.02);
  transition: transform .12s ease, box-shadow .12s ease;
}
.bub--emojionly {
  background: none;
  border: none;
  padding: calc(2 * var(--u)) calc(4 * var(--u));
  max-width: 88%;
}
.bub--emojionly .bub-time { color: var(--text-faint); opacity: .85; }
.bub--emo-1 { font-size: calc(56 * var(--u)); line-height: 1.15; }
.bub--emo-2 { font-size: calc(44 * var(--u)); line-height: 1.2; }
.bub--emo-3 { font-size: calc(34 * var(--u)); line-height: 1.25; }
.bub--emo-4 { font-size: calc(28 * var(--u)); line-height: 1.3; }
.bub--emo-5 { font-size: calc(24 * var(--u)); line-height: 1.35; }
.bub--mine.bub--emo-2,
.bub--mine.bub--emo-3,
.bub--mine.bub--emo-4,
.bub--mine.bub--emo-5 {
  text-shadow: 0 0 calc(4 * var(--u)) rgba(42,22,12,.38), 0 calc(1.5 * var(--u)) calc(3 * var(--u)) rgba(42,22,12,.26);
}
@keyframes bub-in {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.bub--in { animation: bub-in .22s cubic-bezier(.2,.8,.3,1); }
@media (prefers-reduced-motion: reduce) {
  .bub--in { animation: none; }
  .bub.is-selected { transition: none; }
  .bub.is-swiping-return { transition: none; }
}

.nv-swipe-affordance {
  position: fixed;
  z-index: 5;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,200,154,.16);
  border: 1px solid rgba(255,200,154,.32);
  color: var(--peach-300);
  opacity: 0;
  transform: scale(.7);
  transition: opacity .12s ease, transform .12s ease, background .12s ease, color .12s ease;
}
.nv-swipe-affordance__ic { display: flex; align-items: center; justify-content: center; }
.nv-swipe-affordance__ic svg { width: 20px; height: 20px; fill: currentColor; }
.nv-swipe-affordance.is-armed {
  background: linear-gradient(180deg, var(--peach-300), var(--peach-500));
  border-color: transparent;
  color: #2A160C;
}
.nv-swipe-affordance.is-out { opacity: 0 !important; transform: scale(.7) !important; }
@media (prefers-reduced-motion: reduce) {
  .nv-swipe-affordance { transition: opacity .1s ease; }
}

.bub-reply {
  display: flex;
  align-items: stretch;
  gap: calc(7 * var(--u));
  margin: calc(-2 * var(--u)) calc(-2 * var(--u)) calc(7 * var(--u));
  padding: calc(5 * var(--u)) calc(8 * var(--u));
  border-radius: calc(9 * var(--u));
  background: rgba(10,23,48,.18);
}
.bub--peer .bub-reply { background: rgba(255,255,255,.05); }
.bub-reply__tick { flex: 0 0 calc(3 * var(--u)); border-radius: 999px; background: var(--peach-300); }
.bub--peer .bub-reply__tick { background: var(--peach-300); }
.bub-reply__body { display: flex; flex-direction: column; min-width: 0; }
.bub-reply__who { font-size: calc(10.5 * var(--u)); font-weight: 700; color: var(--peach-100); }
.bub--mine .bub-reply__who { color: #5A2E14; }
.bub-reply__txt {
  font-size: calc(11.5 * var(--u));
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bub--mine .bub-reply__txt { color: rgba(42,22,12,.7); }

.bub-reacts { display: flex; flex-wrap: wrap; gap: calc(4 * var(--u)); margin-top: calc(5 * var(--u)); }
.bub-react {
  appearance: none;
  border: 1px solid var(--hairline-strong);
  cursor: default;
  background: var(--night-800, #0A1730);
  color: var(--text);
  border-radius: var(--r-pill);
  padding: calc(1 * var(--u)) calc(7 * var(--u)) calc(1 * var(--u)) calc(4 * var(--u));
  font-size: calc(12.5 * var(--u));
  line-height: 1.5;
  display: inline-flex;
  align-items: center;
  gap: calc(3 * var(--u));
}
.bub--mine .bub-react { background: rgba(42,22,12,.16); border-color: rgba(42,22,12,.25); }
.bub-react.is-mine { cursor: pointer; border-color: var(--peach-300); }
.bub-react__g { font-size: calc(13 * var(--u)); }
.bub-react__n { font-size: calc(10 * var(--u)); font-weight: 700; color: var(--text-dim); }

.nv-float-scrim { position: fixed; inset: 0; z-index: 70; background: transparent; }
.nv-float {
  position: fixed;
  z-index: 71;
  max-width: calc(100vw - 16px);
  background: var(--night-800, #0A1730);
  border: 1px solid var(--hairline-strong);
  border-radius: calc(18 * var(--u));
  box-shadow: 0 12px 34px rgba(0,0,0,.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: calc(8 * var(--u)) calc(10 * var(--u));
  opacity: 0;
  transform: scale(.92);
  transform-origin: bottom center;
  transition: opacity .14s ease, transform .14s ease;
}
.nv-float.is-open { opacity: 1; transform: scale(1); }
.nv-float.is-out { opacity: 0; transform: scale(.96); pointer-events: none; }
.nv-float__emojis {
  display: flex;
  align-items: center;
  gap: calc(2 * var(--u));
  margin-bottom: calc(6 * var(--u));
  padding-bottom: calc(6 * var(--u));
  border-bottom: 1px solid var(--hairline);
}
.nv-float__acts { display: flex; align-items: center; justify-content: center; gap: calc(10 * var(--u)); }
.nv-float-emo,
.nv-float-add,
.nv-float-act {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font-ui);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}
.nv-float-emo {
  min-width: calc(32 * var(--u));
  min-height: calc(32 * var(--u));
  padding: calc(2 * var(--u));
  border-radius: 50%;
  font-size: calc(24 * var(--u));
  line-height: 1;
}
.nv-float-emo:active { background: rgba(255,255,255,.1); }
.nv-float-add {
  min-width: calc(32 * var(--u));
  min-height: calc(32 * var(--u));
  padding: calc(2 * var(--u));
  border-radius: 50%;
  color: var(--peach-300);
}
.nv-float-add svg { width: calc(18 * var(--u)); height: calc(18 * var(--u)); }
.nv-float-add:active { background: rgba(255,200,154,.14); }
.nv-float-act { width: calc(40 * var(--u)); height: calc(40 * var(--u)); border-radius: 50%; }
.nv-float-act svg { width: calc(20 * var(--u)); height: calc(20 * var(--u)); fill: var(--peach-300); }
.nv-float-act:active { background: rgba(255,255,255,.08); }
.nv-float-act.is-disabled,
.nv-float-act:disabled { opacity: .32; cursor: default; }
.nv-float-act.is-disabled svg,
.nv-float-act:disabled svg { fill: var(--text-faint); }
.nv-float-act.is-disabled:active,
.nv-float-act:disabled:active { background: transparent; }
.nv-float-act--danger svg { fill: #FFB4A8; }
.nv-float-act--danger:active { background: rgba(255,120,110,.14); }
.nv-float-act--danger.is-disabled svg { fill: rgba(255,180,168,.5); }
@keyframes nv-float-pop {
  from { opacity: 0; transform: scale(.5) translateY(4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.nv-float.is-open .nv-float-emo,
.nv-float.is-open .nv-float-add {
  animation: nv-float-pop .26s cubic-bezier(.2,.9,.3,1.2) both;
  animation-delay: calc(var(--i, 0) * 38ms);
}
.nv-float.is-open .nv-float-act {
  animation: nv-float-pop .24s cubic-bezier(.2,.9,.3,1.2) .26s both;
}
@media (prefers-reduced-motion: reduce) {
  .nv-float { transition: none; }
  .nv-float.is-open .nv-float-emo,
  .nv-float.is-open .nv-float-add,
  .nv-float.is-open .nv-float-act { animation: none; opacity: 1; }
}

.nv-reply-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
  padding: calc(7 * var(--u)) calc(10 * var(--u));
  border-top: 1px solid var(--hairline);
  background: var(--night-800, #0A1730);
}
.nv-reply-bar__tick { flex: 0 0 calc(3 * var(--u)); align-self: stretch; border-radius: 999px; background: var(--peach-300); }
.nv-reply-bar__body { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.nv-reply-bar__body b { font-size: calc(11 * var(--u)); font-weight: 700; color: var(--peach-100); }
.nv-reply-bar__body small {
  font-size: calc(11.5 * var(--u));
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nv-reply-bar__x {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex: 0 0 auto;
  width: calc(28 * var(--u));
  height: calc(28 * var(--u));
  border-radius: 50%;
  color: var(--text-dim);
  font-size: calc(14 * var(--u));
  display: flex;
  align-items: center;
  justify-content: center;
}
.nv-reply-bar__x:active { background: rgba(255,255,255,.08); color: var(--text); }

.nv-react-picker {
  max-width: 360px;
  max-height: 62vh;
  display: flex;
  flex-direction: column;
  padding: calc(8 * var(--u)) calc(8 * var(--u)) calc(10 * var(--u));
}
.nv-react-picker .nv-emo-grid { flex: 1 1 auto; min-height: calc(140 * var(--u)); }

.bub--att { cursor: pointer; padding: calc(8 * var(--u)); }
.bub-media {
  display: block;
  position: relative;
  width: calc(200 * var(--u));
  height: calc(150 * var(--u));
  border-radius: calc(10 * var(--u));
  background: rgba(255,255,255,.08) center/cover no-repeat;
}
.bub-media.has-thumb { background-size: cover; }
.bub-media--stick { width: calc(120 * var(--u)); height: calc(120 * var(--u)); border-radius: calc(12 * var(--u)); }
.bub-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: calc(40 * var(--u));
  height: calc(40 * var(--u));
  border-radius: 50%;
  background: rgba(10,23,48,.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.bub-play svg { width: calc(20 * var(--u)); height: calc(20 * var(--u)); fill: currentColor; margin-left: 2px; }
.bub-att { display: flex; align-items: center; gap: calc(10 * var(--u)); }
.bub-att svg { width: calc(26 * var(--u)); height: calc(26 * var(--u)); fill: currentColor; flex: 0 0 auto; }
.bub-att-txt { display: flex; flex-direction: column; font-size: calc(13 * var(--u)); font-weight: 600; }
.bub-att-txt small { font-size: calc(10 * var(--u)); font-weight: 500; opacity: .7; }

.bub--sticker { background: none; border: none; padding: calc(4 * var(--u)); max-width: 46%; }
.bub--sticker--mine { align-self: flex-end; }
.bub--sticker--peer { align-self: flex-start; }
.sticker-img { display: block; width: calc(110 * var(--u)); height: calc(110 * var(--u)); object-fit: contain; }
.sticker-fb {
  display: inline-block;
  padding: calc(6 * var(--u)) calc(10 * var(--u));
  border: 1px dashed rgba(255,255,255,.25);
  border-radius: var(--r-pill);
  color: var(--text-faint);
  font-size: calc(10.5 * var(--u));
  font-style: italic;
}

.bub--pending { position: relative; }
.bub-prog {
  position: absolute;
  inset: 0;
  margin: auto;
  width: calc(34 * var(--u));
  height: calc(34 * var(--u));
  border-radius: 50%;
  background: rgba(10,23,48,.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .25s ease;
}
.bub-prog svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,.28); stroke-width: 2.4; }
.ring-fg { fill: none; stroke: var(--peach-300); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 62.83; transition: stroke-dashoffset .2s ease; }
.bub--pending.is-done .bub-prog { opacity: 0; }
.bub--pending.is-fail .bub-prog { background: rgba(120,30,25,.6); }
.bub-prog-x { font-size: calc(15 * var(--u)); color: #FFB4A8; line-height: 1; }

.nv-emo-panel {
  flex: 0 0 auto;
  max-height: 46%;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--hairline);
  background: var(--night-800, #0A1730);
  padding: calc(6 * var(--u)) calc(8 * var(--u)) calc(8 * var(--u));
}
.nv-emo-tabs { display: flex; gap: 6px; margin-bottom: calc(6 * var(--u)); flex: 0 0 auto; }
.nv-emo-tabs button {
  appearance: none;
  border: 1px solid var(--hairline-strong);
  cursor: pointer;
  background: transparent;
  color: var(--text-dim);
  border-radius: var(--r-pill);
  padding: calc(5 * var(--u)) calc(12 * var(--u));
  font-family: var(--font-ui);
  font-size: calc(11.5 * var(--u));
  font-weight: 700;
}
.nv-emo-tabs button.is-active { border-color: transparent; color: #2A160C; background: linear-gradient(180deg, var(--peach-300), var(--peach-500)); }
.nv-emo-tone { display: flex; gap: 4px; margin-bottom: calc(6 * var(--u)); flex: 0 0 auto; }
.nv-emo-tonebtn {
  appearance: none;
  border: 1px solid transparent;
  cursor: pointer;
  flex: 0 0 auto;
  background: rgba(255,255,255,.05);
  border-radius: var(--r-pill);
  font-size: calc(14 * var(--u));
  padding: calc(2 * var(--u)) calc(7 * var(--u));
}
.nv-emo-tonebtn.is-active { border-color: var(--peach-300); background: rgba(255,200,154,.14); }
.nv-emo-search { flex: 0 0 auto; }
.nv-emo-search input {
  width: 100%;
  box-sizing: border-box;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline-strong);
  background: rgba(255,255,255,.06);
  color: #fff;
  font-family: var(--font-ui);
  font-size: calc(12.5 * var(--u));
  padding: calc(6 * var(--u)) calc(12 * var(--u));
  margin-bottom: calc(6 * var(--u));
}
.nv-emo-search input:focus { outline: none; border-color: var(--peach-300); }
.nv-emo-cats { display: flex; gap: 4px; overflow-x: auto; padding-bottom: calc(4 * var(--u)); scrollbar-width: none; flex: 0 0 auto; }
.nv-emo-cats::-webkit-scrollbar { display: none; }
.nv-emo-cat {
  appearance: none;
  border: 1px solid var(--hairline-strong);
  cursor: pointer;
  background: transparent;
  color: var(--text-dim);
  white-space: nowrap;
  flex: 0 0 auto;
  border-radius: var(--r-pill);
  padding: calc(3 * var(--u)) calc(9 * var(--u));
  font-family: var(--font-ui);
  font-size: calc(10.5 * var(--u));
  font-weight: 600;
}
.nv-emo-cat.is-active { border-color: transparent; color: #2A160C; background: linear-gradient(180deg, var(--peach-300), var(--peach-500)); }
.nv-emo-recents {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: calc(4 * var(--u)) 0;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: calc(4 * var(--u));
  scrollbar-width: none;
  flex: 0 0 auto;
  align-items: center;
}
.nv-emo-recents::-webkit-scrollbar { display: none; }
.nv-emo-grid {
  flex: 1 1 auto;
  min-height: calc(120 * var(--u));
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  align-content: start;
}
.nv-emo-cell {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: calc(20 * var(--u));
  line-height: 1.3;
  padding: calc(2 * var(--u));
  border-radius: calc(8 * var(--u));
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}
.nv-emo-cell:active { background: rgba(255,255,255,.08); }
.nv-emo-cell--stick img { width: calc(34 * var(--u)); height: calc(34 * var(--u)); object-fit: contain; }
.nv-emo-cell--add { color: var(--peach-300); font-size: calc(22 * var(--u)); }
.nv-emo-stick {
  flex: 1 1 auto;
  min-height: calc(120 * var(--u));
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  align-content: start;
}
.nv-emo-stick .nv-emo-cell { border: 1px solid var(--hairline); background: rgba(255,255,255,.04); aspect-ratio: 1; }
.nv-emo-stick .nv-emo-cell img { width: 80%; height: 80%; object-fit: contain; }

.nv-sheet { max-width: 340px; }
.nv-sheet-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(8 * var(--u)); margin: calc(4 * var(--u)) 0 calc(12 * var(--u)); }
.nv-sheet-actions--4 { grid-template-columns: repeat(2, 1fr); }
.nv-sheet-btn {
  appearance: none;
  border: 1px solid var(--hairline-strong);
  cursor: pointer;
  background: rgba(255,255,255,.05);
  color: var(--text);
  border-radius: var(--r-lg);
  padding: calc(12 * var(--u)) calc(6 * var(--u));
  font-family: var(--font-ui);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(4 * var(--u));
  min-height: calc(84 * var(--u));
}
.nv-sheet-btn svg { width: calc(24 * var(--u)); height: calc(24 * var(--u)); fill: var(--peach-300); }
.nv-sheet-btn span { font-size: calc(12.5 * var(--u)); font-weight: 700; }
.nv-sheet-btn small { font-size: calc(9.5 * var(--u)); color: var(--text-faint); text-align: center; }
.nv-sheet-btn:active { transform: scale(.97); }
.nv-sheet-btn:focus-visible { outline: 2px solid var(--peach-100); outline-offset: 2px; }

.chat-empty {
  margin: auto;
  text-align: center;
  color: var(--text-faint);
  font-size: calc(12.5 * var(--u));
  line-height: 1.6;
  padding: 0 calc(20 * var(--u));
}

.chat-inputbar {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: calc(6 * var(--u));
  padding: calc(8 * var(--u)) calc(8 * var(--u)) calc(10 * var(--u));
  border-top: 1px solid var(--hairline);
  background: var(--night-800, #0A1730);
}
.composer {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  gap: calc(2 * var(--u));
  background: rgba(255,255,255,.06);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-pill);
  padding: calc(4 * var(--u)) calc(6 * var(--u));
  min-height: calc(46 * var(--u));
  transition: border-color .15s ease, background .15s ease;
}
.composer:focus-within { border-color: var(--peach-300); background: rgba(255,255,255,.08); }
.composer-ic {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--text-dim);
  width: calc(34 * var(--u));
  height: calc(34 * var(--u));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-bottom: calc(2 * var(--u));
}
.composer-ic svg { width: calc(20 * var(--u)); height: calc(20 * var(--u)); }
.composer-ic:active { opacity: .7; }
.composer-ic:disabled { opacity: .4; cursor: default; }
.composer-ic:focus-visible { outline: 2px solid var(--peach-100); outline-offset: 2px; }

.composer-field {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-family: var(--font-ui);
  font-size: calc(15 * var(--u));
  line-height: 1.35;
  padding: calc(7 * var(--u)) calc(4 * var(--u));
  resize: none;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 6em;
  min-height: calc(22 * var(--u));
  scrollbar-width: none;
}
.composer-field::-webkit-scrollbar { display: none; }
.composer-field:focus { outline: none; }
.composer-field::placeholder { color: var(--text-faint); }

.composer-send {
  appearance: none;
  border: 0;
  cursor: pointer;
  flex: 0 0 auto;
  width: calc(46 * var(--u));
  height: calc(46 * var(--u));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-faint);
  align-self: flex-end;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
  touch-action: none; /* v136: evita que el navegador robe el gesto de grabar */
}
.composer-send svg { width: calc(22 * var(--u)); height: calc(22 * var(--u)); fill: currentColor; }
.composer-send:disabled { cursor: default; }
.composer-send.is-active {
  background: linear-gradient(180deg, var(--peach-300), var(--peach-500));
  color: #2A160C;
  box-shadow: var(--glow-peach);
}
.composer-send.is-active svg { transform: rotate(45deg) translateX(1px); }

.nv-viewer { max-width: min(92vw, 420px); }
.nv-viewer-title { margin: 0 0 calc(10 * var(--u)); font-size: calc(14 * var(--u)); font-weight: 700; color: var(--text); text-align: center; word-break: break-all; }
.nv-viewer-body { display: flex; align-items: center; justify-content: center; min-height: calc(120 * var(--u)); max-height: 60vh; overflow: hidden; margin-bottom: calc(12 * var(--u)); }
.nv-viewer-img { max-width: 100%; max-height: 60vh; border-radius: calc(12 * var(--u)); display: block; transition: filter .28s ease, transform .28s ease; }
.nv-viewer-img.is-soft { filter: blur(8px) saturate(.92); transform: scale(1.03); }
.nv-viewer-poster { position: relative; width: 100%; aspect-ratio: 16/9; max-height: 60vh; background: rgba(255,255,255,.08) center/cover no-repeat; border-radius: calc(12 * var(--u)); display: flex; align-items: center; justify-content: center; }
.nv-viewer-play { width: calc(56 * var(--u)); height: calc(56 * var(--u)); border-radius: 50%; background: rgba(10,23,48,.66); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; color: #fff; box-sizing: border-box; }
.nv-viewer-play svg { width: calc(26 * var(--u)); height: calc(26 * var(--u)); fill: currentColor; margin-left: 3px; }
.nv-viewer-play.is-spin { background: transparent; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; animation: nv-rot .9s linear infinite; }
.nv-viewer-play.is-spin svg { display: none; }
@keyframes nv-rot { to { transform: rotate(360deg); } }
.nv-viewer-body video { max-width: 100%; max-height: 60vh; border-radius: calc(12 * var(--u)); display: block; }
.nv-viewer-body audio { width: 100%; }
.nv-viewer-skel { display: flex; flex-direction: column; align-items: center; gap: calc(10 * var(--u)); width: 100%; }
.nv-viewer-prog { width: 100%; height: 5px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; }
.nv-viewer-prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--peach-300), #E8B14C); transition: width .2s ease; }
.nv-viewer-status { margin: 0; font-size: calc(12 * var(--u)); color: var(--text-dim); text-align: center; }
.nv-viewer-file { margin: 0; font-size: calc(13 * var(--u)); color: var(--text); text-align: center; word-break: break-all; }

.chat-info-head { display: flex; flex-direction: column; align-items: center; gap: calc(8 * var(--u)); margin-bottom: calc(12 * var(--u)); }
.chat-info-avatar { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; background: linear-gradient(180deg, var(--peach-300), var(--peach-500)); color: #2A160C; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 28px rgba(255,155,87,.22); }
.chat-info-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-info-avatar svg { width: 55%; height: 55%; fill: currentColor; }
.chat-info-name { margin: 0; font-size: calc(18 * var(--u)); font-weight: 700; color: var(--text); text-align: center; }
.chat-info-role { margin: 0; font-size: calc(11 * var(--u)); color: var(--peach-100); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.chat-info-together { margin: 0; font-size: calc(11.5 * var(--u)); color: var(--text-dim); }
.chat-info-section { margin: calc(6 * var(--u)) 0; padding: calc(10 * var(--u)) calc(12 * var(--u)); background: rgba(255,255,255,.04); border: 1px solid var(--hairline); border-radius: var(--r-lg); }
.chat-info-section-title { margin: 0 0 calc(6 * var(--u)); font-size: calc(10.5 * var(--u)); text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); font-weight: 700; }
.chat-info-fp { margin: 0 0 calc(8 * var(--u)); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: calc(16 * var(--u)); font-weight: 700; letter-spacing: .1em; color: #fff; text-align: center; word-break: break-all; }
.chat-info-fp-status { margin: 0 0 calc(8 * var(--u)); font-size: calc(11.5 * var(--u)); text-align: center; min-height: 1.4em; line-height: 1.45; }

.bub-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: calc(5 * var(--u));
  margin-top: calc(3 * var(--u));
}
.bub-meta .bub-time { display: inline-flex; align-items: center; line-height: 1; margin-top: 0; }
.bub-receipt {
  --receipt-idle: #5F7592;
  --receipt-read: #2F6BE0;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  color: var(--receipt-idle);
}
.bub-receipt svg {
  width: calc(13 * var(--u));
  height: calc(13 * var(--u));
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
  overflow: visible;
  shape-rendering: geometricPrecision;
}
.bub-receipt__pair { display: inline-flex; align-items: center; }
.bub-receipt__pair svg + svg { margin-left: calc(-3 * var(--u)); }
.bub-receipt[data-state="sent"] { color: var(--receipt-idle); }
.bub-receipt[data-state="delivered"] { color: var(--receipt-idle); }
.bub-receipt[data-state="read"] { color: var(--receipt-read); }
@media (prefers-reduced-motion: reduce) {
  .bub-receipt { transition: none; }
}

/* v136 · panel de grabacion */
.nv-voice {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(74 * var(--u) + env(safe-area-inset-bottom, 0px));
  z-index: 9999;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(8 * var(--u)) calc(10 * var(--u));
  padding: calc(11 * var(--u)) calc(16 * var(--u));
  border-radius: calc(22 * var(--u));
  background: rgba(10,14,28,.95);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 calc(10 * var(--u)) calc(30 * var(--u)) rgba(0,0,0,.5);
  color: #fff;
  font: inherit;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: 86vw;
  transition: background .18s ease, border-color .18s ease;
  touch-action: none;
}
.nv-voice-dot {
  width: calc(11 * var(--u));
  height: calc(11 * var(--u));
  border-radius: 50%;
  background: #ff5a5a;
  flex: 0 0 auto;
  animation: nvVoicePulse 1s infinite;
  transition: background .18s ease;
}
.nv-voice-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: calc(14 * var(--u));
  min-width: calc(46 * var(--u));
  text-align: center;
}
.nv-voice-spacer { flex: 1 1 auto; }
.nv-voice-ic { position: relative; width: calc(26 * var(--u)); height: calc(26 * var(--u)); flex: 0 0 auto; }
.nv-voice-mic,
.nv-voice-trash {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .16s ease, transform .16s ease;
}
.nv-voice-mic svg,
.nv-voice-trash svg { width: calc(24 * var(--u)); height: calc(24 * var(--u)); fill: currentColor; }
.nv-voice-trash { opacity: 0; transform: scale(.5) rotate(-12deg); color: #ff8a8a; }
.nv-voice-hint {
  flex: 1 0 100%;
  text-align: center;
  font-size: calc(11.5 * var(--u));
  color: var(--text-dim);
  transition: color .18s ease;
}
.nv-voice.is-armed {
  background: rgba(40,12,18,.96);
  border-color: rgba(255,90,90,.4);
}
.nv-voice.is-armed .nv-voice-dot { background: #7a8194; animation: none; }
.nv-voice.is-armed .nv-voice-mic { opacity: 0; transform: scale(.5) rotate(12deg); }
.nv-voice.is-armed .nv-voice-trash { opacity: 1; transform: scale(1) rotate(0deg); }
.nv-voice.is-armed .nv-voice-hint { color: #ff8a8a; }

.nv-voice.is-cancelled {
  background: rgba(28,32,46,.97);
  border-color: rgba(255,255,255,.2);
  animation: nvVoiceCancelPop .22s ease;
}
.nv-voice.is-cancelled .nv-voice-dot { background: #7a8194; animation: none; }
.nv-voice.is-cancelled .nv-voice-mic { opacity: 0; transform: scale(.5); }
.nv-voice.is-cancelled .nv-voice-trash { opacity: 1; transform: scale(1); color: #fff; }
.nv-voice.is-cancelled .nv-voice-hint { color: #fff; font-weight: 700; }
@keyframes nvVoicePulse { 0%,100%{opacity:1} 50%{opacity:.3} }
@keyframes nvVoiceCancelPop {
  0% { transform: translateX(-50%) scale(.96); }
  60% { transform: translateX(-50%) scale(1.03); }
  100% { transform: translateX(-50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .nv-voice { transition: none; }
  .nv-voice-dot { animation: none; }
  .nv-voice-mic, .nv-voice-trash { transition: none; }
  .nv-voice.is-cancelled { animation: none; }
}

/* v136 · reproductor inline con waveform real */
.nv-aplayer {
  display: flex;
  align-items: center;
  gap: calc(10 * var(--u));
  min-width: calc(190 * var(--u));
  max-width: 100%;
}
.nv-apbtn {
  appearance: none;
  -webkit-appearance: none;
  width: calc(38 * var(--u));
  height: calc(38 * var(--u));
  border-radius: 50%;
  background: linear-gradient(180deg, var(--peach-300), var(--peach-500));
  color: #21100A;
  border: 0;
  flex: 0 0 auto;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nv-apbtn svg { width: calc(20 * var(--u)); height: calc(20 * var(--u)); fill: currentColor; }
.nv-apbtn.is-loading svg { opacity: 0; }
.nv-apbtn.is-loading::after {
  content: "";
  position: absolute;
  width: calc(18 * var(--u));
  height: calc(18 * var(--u));
  border-radius: 50%;
  border: 2px solid rgba(33,16,10,.25);
  border-top-color: #21100A;
  animation: nv-rot .7s linear infinite;
}
.nv-apmid { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: calc(5 * var(--u)); }
.nv-wave {
  position: relative;
  display: flex;
  align-items: center;
  gap: calc(1.5 * var(--u));
  width: 100%;
  height: calc(30 * var(--u));
  touch-action: none;
  cursor: pointer;
  outline: none;
}
.nv-wave:focus-visible { box-shadow: 0 0 0 calc(2 * var(--u)) var(--peach-300); border-radius: calc(8 * var(--u)); }
.nv-wave-load {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: calc(3 * var(--u));
  width: 0;
  border-radius: 999px;
  background: rgba(255,183,120,.35);
  pointer-events: none;
  transition: width .12s linear;
  z-index: 2;
}
.nv-wave-bar {
  flex: 1 1 auto;
  min-width: calc(2 * var(--u));
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  height: calc(var(--h, .35) * 100%);
  transition: background .12s ease;
}
.nv-wave-bar.is-filled { background: var(--peach-300); }
.bub--mine .nv-wave-bar { background: rgba(42,22,12,.22); }
.bub--mine .nv-wave-bar.is-filled { background: #5A2E14; }
.bub--mine .nv-wave-load { background: rgba(42,22,12,.22); }
.nv-wave.is-loading .nv-wave-bar { animation: nvWaveShimmer 1s ease-in-out infinite; }
@keyframes nvWaveShimmer { 0%,100%{opacity:.35} 50%{opacity:.85} }
.nv-atimes {
  display: flex;
  justify-content: space-between;
  font-size: calc(10.5 * var(--u));
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.bub--mine .nv-atimes { color: rgba(42,22,12,.62); }
@media (prefers-reduced-motion: reduce) {
  .nv-wave-load { transition: none; }
  .nv-wave.is-loading .nv-wave-bar { animation: none; }
  .nv-apbtn.is-loading::after { animation-duration: 1.4s; }
}

/* v135/v136 · seleccion multiple */
.nv-selbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: calc(10 * var(--u));
  padding: 0 calc(10 * var(--u));
  padding-top: env(safe-area-inset-top, 0px);
  height: calc(56 * var(--u) + env(safe-area-inset-top, 0px));
  background: var(--night-800, #0A1730);
  border-bottom: 1px solid var(--hairline);
  color: #fff;
  box-shadow: 0 calc(2 * var(--u)) calc(10 * var(--u)) rgba(0,0,0,.4);
}
.nv-selbar button {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  color: #fff;
  width: calc(42 * var(--u));
  height: calc(42 * var(--u));
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  flex: 0 0 auto;
}
.nv-selbar button svg { width: calc(22 * var(--u)); height: calc(22 * var(--u)); fill: currentColor; }
.nv-selbar button:active { background: rgba(255,255,255,.08); }
.nv-selbar button:disabled { opacity: .35; cursor: default; }
.nv-selbar__count { flex: 1 1 auto; font-weight: 700; font-size: calc(15 * var(--u)); }
.bub.is-picked { box-shadow: 0 0 0 calc(2.5 * var(--u)) var(--peach-300); }
.chat.is-selecting .chat-inputbar { display: none !important; }
.chat.is-selecting .chat-top { visibility: hidden; }
/* ============================================================
v137 · F-VOZ-01 · puntito "audio no escuchado" + pending waveform
============================================================ */
.bub--audio {
  position: relative;
}

.nv-audio-unread {
  position: absolute;
  width: calc(9 * var(--u));
  height: calc(9 * var(--u));
  border-radius: 50%;
  background: var(--peach-300);
  box-shadow: 0 0 0 calc(2 * var(--u)) rgba(10, 14, 28, .45);
  pointer-events: none;
  animation: nvAudioUnreadPulse 1.6s ease-in-out infinite;
  z-index: 2;
}

.bub--peer.bub--audio .nv-audio-unread {
  top: calc(8 * var(--u));
  left: calc(8 * var(--u));
}

.bub--mine.bub--audio .nv-audio-unread {
  top: calc(8 * var(--u));
  right: calc(8 * var(--u));
  background: #21100A;
  box-shadow: 0 0 0 calc(2 * var(--u)) rgba(255, 255, 255, .28);
}

@keyframes nvAudioUnreadPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(.92); }
}

@media (prefers-reduced-motion: reduce) {
  .nv-audio-unread { animation: none; }
}

.nv-aplayer.is-pending .nv-apbtn {
  opacity: .55;
  cursor: default;
}
