/* =====================================================================
   WA Chat Suite - shared chat components
   One stylesheet for the visitor chat page AND the admin inbox thread, so
   a message looks identical wherever it is shown. Colours come from the
   theme variables (--chat-bg, --bubble-in, --bubble-out, --primary ...).
   ===================================================================== */

/* -------------------------------------------------------- the thread */
.wa-thread{
  position:relative;overflow-y:auto;overflow-x:hidden;padding:14px 8% 10px;
  display:flex;flex-direction:column;gap:2px;background:var(--chat-bg);
  scroll-behavior:smooth;overscroll-behavior:contain;z-index:0;
}
.wa-thread::before{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:-1;
  background-color:rgb(var(--wallpaper-ink));opacity:var(--wallpaper-opacity);
  -webkit-mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260' viewBox='0 0 260 260' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M22 30h44a8 8 0 0 1 8 8v22a8 8 0 0 1-8 8H42l-14 10V68h-6a8 8 0 0 1-8-8V38a8 8 0 0 1 8-8z'/><path d='M150 44c-8-14-30-8-26 8 3 12 26 26 26 26s23-14 26-26c4-16-18-22-26-8z'/><path d='M222 20l6 13 14 2-10 10 2 14-12-7-12 7 2-14-10-10 14-2z'/><rect x='30' y='120' width='28' height='48' rx='6'/><path d='M40 160h8'/><path d='M120 130h40v22a12 12 0 0 1-12 12h-16a12 12 0 0 1-12-12z'/><path d='M160 136h6a6 6 0 0 1 0 12h-6'/><circle cx='222' cy='140' r='18'/><circle cx='215' cy='135' r='1.5' fill='%23000'/><circle cx='229' cy='135' r='1.5' fill='%23000'/><path d='M213 146a11 11 0 0 0 18 0'/><path d='M30 226l52-22-10 40-14-12-10 8z'/><path d='M72 204L58 232'/><path d='M140 236v-32l24-6v30'/><circle cx='134' cy='236' r='6'/><circle cx='158' cy='228' r='6'/><path d='M226 206v28M212 220h28'/><circle cx='100' cy='90' r='2' fill='%23000'/><circle cx='190' cy='96' r='2' fill='%23000'/><circle cx='90' cy='190' r='2' fill='%23000'/></svg>");
  mask-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260' viewBox='0 0 260 260' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M22 30h44a8 8 0 0 1 8 8v22a8 8 0 0 1-8 8H42l-14 10V68h-6a8 8 0 0 1-8-8V38a8 8 0 0 1 8-8z'/><path d='M150 44c-8-14-30-8-26 8 3 12 26 26 26 26s23-14 26-26c4-16-18-22-26-8z'/><path d='M222 20l6 13 14 2-10 10 2 14-12-7-12 7 2-14-10-10 14-2z'/><rect x='30' y='120' width='28' height='48' rx='6'/><path d='M40 160h8'/><path d='M120 130h40v22a12 12 0 0 1-12 12h-16a12 12 0 0 1-12-12z'/><path d='M160 136h6a6 6 0 0 1 0 12h-6'/><circle cx='222' cy='140' r='18'/><circle cx='215' cy='135' r='1.5' fill='%23000'/><circle cx='229' cy='135' r='1.5' fill='%23000'/><path d='M213 146a11 11 0 0 0 18 0'/><path d='M30 226l52-22-10 40-14-12-10 8z'/><path d='M72 204L58 232'/><path d='M140 236v-32l24-6v30'/><circle cx='134' cy='236' r='6'/><circle cx='158' cy='228' r='6'/><path d='M226 206v28M212 220h28'/><circle cx='100' cy='90' r='2' fill='%23000'/><circle cx='190' cy='96' r='2' fill='%23000'/><circle cx='90' cy='190' r='2' fill='%23000'/></svg>");
  -webkit-mask-size:260px 260px;mask-size:260px 260px;-webkit-mask-repeat:repeat;mask-repeat:repeat;
}
.wa-thread.custom-wall{background-image:var(--wallpaper-image);background-size:cover;background-position:center;background-attachment:fixed}
.wa-thread.custom-wall::before{display:none}
/* the admin inbox scrolls inside a panel, so the wallpaper must not be fixed */
.wa-thread.in-panel::before{position:absolute}
.wa-thread.in-panel.custom-wall{background-attachment:scroll}
.wa-thread > *{position:relative;z-index:1}

.wa-daysep{align-self:center;margin:10px 0 6px}
.wa-daysep span{
  display:inline-block;background:var(--bubble-in);color:var(--muted);font-size:12px;font-weight:500;
  padding:5px 12px;border-radius:8px;box-shadow:var(--shadow-xs);
}
.wa-notice{
  align-self:center;max-width:min(92%,520px);margin:4px 0 8px;text-align:center;
  background:rgba(var(--warning-rgb),.16);color:var(--text);font-size:12.5px;line-height:1.45;
  padding:7px 12px;border-radius:8px;box-shadow:var(--shadow-xs);
}
html[data-theme="light"] .wa-notice{background:#ffeecb}
.wa-notice .i{width:13px;height:13px;vertical-align:-2px;margin-right:4px;opacity:.7}

/* --------------------------------------------------------- one row */
.wa-row{display:flex;width:100%;margin-top:2px;padding:0 2px}
.wa-row.in{justify-content:flex-start}
.wa-row.out{justify-content:flex-end}
.wa-row.sys{justify-content:center;margin:8px 0 4px}
.wa-row.first{margin-top:10px}

.wa-bub{
  position:relative;max-width:min(72%,560px);min-width:60px;border-radius:var(--bubble-radius);
  padding:6px 8px 7px 9px;background:var(--bubble-in);color:var(--bubble-text);
  box-shadow:var(--shadow-xs);word-wrap:break-word;overflow-wrap:anywhere;
  animation:waPop .16s ease-out;
}
@keyframes waPop{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
.wa-row.out .wa-bub{background:var(--bubble-out);color:var(--bubble-out-text)}
.wa-row.first.in  .wa-bub{border-top-left-radius:0}
.wa-row.first.out .wa-bub{border-top-right-radius:0}
/* the little tail on the first bubble of a run */
.wa-row.first .wa-bub::before{content:"";position:absolute;top:0;width:8px;height:13px;background:var(--bubble-in)}
.wa-row.first.in  .wa-bub::before{left:-8px;clip-path:polygon(100% 0,0 0,100% 100%)}
.wa-row.first.out .wa-bub::before{right:-8px;background:var(--bubble-out);clip-path:polygon(0 0,100% 0,0 100%)}
.wa-thread.no-tails .wa-row .wa-bub::before{display:none}
.wa-thread.no-tails .wa-row.first .wa-bub{border-radius:var(--bubble-radius)}

.wa-who{font-size:12px;font-weight:700;color:var(--primary);margin:0 0 2px;display:flex;align-items:center;gap:5px}
.wa-who .i{width:13px;height:13px}
.wa-row.out .wa-who{color:var(--bubble-out-meta)}
.wa-txt{white-space:pre-wrap;font-size:14.5px;line-height:1.42;display:inline}
.wa-txt a{color:var(--link);text-decoration:underline;text-underline-offset:2px}
.wa-meta{
  float:right;position:relative;top:5px;margin:0 -2px -4px 8px;font-size:11px;line-height:1;
  color:var(--bubble-meta);display:inline-flex;align-items:center;gap:3px;white-space:nowrap;user-select:none;
}
.wa-row.out .wa-meta{color:var(--bubble-out-meta)}
.wa-meta .tick{width:16px;height:11px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.wa-meta .tick.seen{color:var(--link)}
.wa-thread.no-ticks .wa-meta .tick{display:none}
.wa-bub.hl{outline:2px solid var(--primary);outline-offset:1px}
.wa-bub.wide{width:min(100%,360px)}

/* system note */
.wa-row.sys .wa-note{
  background:var(--bubble-in);color:var(--muted);font-size:12px;line-height:1.4;
  padding:5px 12px;border-radius:8px;text-align:center;max-width:82%;box-shadow:var(--shadow-xs);
}
.wa-row.sys .wa-note.internal{background:rgba(var(--warning-rgb),.16);color:var(--text)}
.wa-row.sys .wa-note.internal::before{content:"Internal note";display:block;font-size:10.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--warning);margin-bottom:2px}

/* attachments */
.wa-img{display:block;max-width:100%;width:min(320px,100%);border-radius:calc(var(--bubble-radius) - 2px);margin:-1px -3px 4px -4px;cursor:zoom-in;background:var(--hover)}
.wa-file{
  display:flex;align-items:center;gap:10px;background:rgba(0,0,0,.12);padding:9px 11px;border-radius:8px;
  margin:0 -2px 5px -3px;text-decoration:none;color:inherit;min-width:220px;
}
html[data-theme="light"] .wa-file{background:rgba(0,0,0,.06)}
.wa-file:hover{text-decoration:none;background:rgba(0,0,0,.18)}
.wa-file .fi{width:36px;height:36px;border-radius:8px;background:var(--primary);color:var(--on-primary);display:grid;place-items:center;flex:none}
.wa-file .fi .i{width:18px;height:18px}
.wa-file .ft{min-width:0;flex:1}
.wa-file .fn{font-size:13.5px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wa-file .fs{font-size:11.5px;color:var(--bubble-meta)}
.wa-row.out .wa-file .fs{color:var(--bubble-out-meta)}
.wa-file .dl{color:inherit;opacity:.7;flex:none}
.wa-file .dl .i{width:18px;height:18px}

/* CTA buttons under a bubble */
.wa-btns{margin:6px -8px -7px -9px;display:flex;flex-direction:column;border-top:1px solid rgba(var(--text-rgb),.08)}
.wa-cta{
  display:flex;align-items:center;justify-content:center;gap:7px;padding:10px 12px;
  background:none;border:0;border-top:1px solid rgba(var(--text-rgb),.08);color:var(--link);
  font-size:14px;font-weight:600;cursor:pointer;text-decoration:none;font-family:inherit;transition:background .12s;
}
.wa-cta:first-child{border-top:0}
.wa-cta:hover{background:rgba(var(--text-rgb),.05);text-decoration:none}
.wa-cta:last-child{border-radius:0 0 var(--bubble-radius) var(--bubble-radius)}
.wa-cta .i{width:17px;height:17px}
.wa-cta.wa{color:var(--primary)}

/* typing */
.wa-typing{display:flex;gap:4px;padding:6px 4px}
.wa-typing i{width:7px;height:7px;border-radius:50%;background:var(--muted);animation:waBlink 1.3s infinite}
.wa-typing i:nth-child(2){animation-delay:.18s}
.wa-typing i:nth-child(3){animation-delay:.36s}
@keyframes waBlink{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}
.wa-loading{display:flex;gap:6px;justify-content:center;padding:40px 0}
.wa-loading span{width:9px;height:9px;border-radius:50%;background:var(--muted);animation:waBlink 1.3s infinite}
.wa-loading span:nth-child(2){animation-delay:.18s}
.wa-loading span:nth-child(3){animation-delay:.36s}

/* jump to bottom */
.wa-jump{
  position:absolute;right:18px;bottom:16px;width:40px;height:40px;border-radius:50%;z-index:3;
  background:var(--surface);border:1px solid var(--border);color:var(--muted);display:grid;place-items:center;cursor:pointer;box-shadow:var(--shadow);
}
.wa-jump .n{position:absolute;top:-6px;right:-4px;background:var(--primary);color:var(--on-primary);font-size:10.5px;font-weight:700;min-width:18px;height:18px;border-radius:9px;display:grid;place-items:center;padding:0 5px}

/* --------------------------------------------------------- composer */
.wa-composer{
  display:flex;align-items:flex-end;gap:6px;padding:8px 12px;background:var(--header);
  padding-bottom:calc(8px + env(safe-area-inset-bottom));flex:none;position:relative;border-top:1px solid var(--border);
}
.wa-ico{
  width:42px;height:42px;border-radius:50%;background:none;border:0;color:var(--muted);flex:none;
  display:grid;place-items:center;cursor:pointer;transition:background .15s,color .15s;
}
.wa-ico:hover{background:var(--hover);color:var(--text)}
.wa-ico.on{color:var(--primary)}
.wa-ico .i{width:24px;height:24px}
.wa-field{
  flex:1;min-width:0;display:flex;align-items:flex-end;background:var(--surface);border:1px solid var(--border);
  border-radius:22px;padding:4px 6px 4px 14px;min-height:42px;transition:border-color .15s;
}
.wa-field:focus-within{border-color:var(--primary)}
.wa-field textarea,.wa-field input{
  flex:1;min-width:0;border:0;background:none;color:var(--text);font-size:15px;font-family:inherit;outline:none;
  resize:none;max-height:140px;line-height:1.4;padding:7px 0;box-shadow:none;min-height:0;
}
.wa-field textarea::placeholder,.wa-field input::placeholder{color:var(--muted)}
.wa-field .wa-ico{width:34px;height:34px}
.wa-field .wa-ico .i{width:21px;height:21px}
.wa-send{
  width:44px;height:44px;border-radius:50%;border:0;background:var(--primary);color:var(--on-primary);
  display:grid;place-items:center;cursor:pointer;flex:none;transition:transform .12s,background .15s;
}
.wa-send:hover{background:var(--primary-hover)}
.wa-send:active{transform:scale(.93)}
.wa-send .i{width:22px;height:22px;fill:currentColor;stroke:none}
.wa-send .i-send{display:none;margin-left:2px}
.wa-send.ready .i-send{display:block}
.wa-send.ready .i-mic{display:none}
.wa-send.text-only .i-mic{display:none}
.wa-send.text-only .i-send{display:block}

/* quick reply chips (inbox) + icebreakers (visitor) */
.wa-chips{display:flex;gap:8px;padding:8px 12px 2px;overflow-x:auto;flex:none;scrollbar-width:none;background:var(--header)}
.wa-chips::-webkit-scrollbar{display:none}
.wa-chips:empty{display:none}
.wa-chip{
  display:inline-flex;align-items:center;gap:7px;white-space:nowrap;padding:8px 14px;border-radius:999px;
  border:1px solid var(--border);background:var(--surface);color:var(--text);font-size:13.5px;font-weight:500;
  cursor:pointer;font-family:inherit;transition:transform .12s,background .15s,border-color .15s;flex:none;
}
.wa-chip:hover{border-color:var(--primary);color:var(--primary)}
.wa-chip:active{transform:scale(.96)}
.wa-chip.solid{background:var(--primary);border-color:var(--primary);color:var(--on-primary);font-weight:600}
.wa-chip.solid:hover{background:var(--primary-hover);color:var(--on-primary)}
.wa-chip .ce{font-size:15px}

/* the composer in "internal note" mode */
.wa-composer.note-mode .wa-field{border-color:var(--warning);background:rgba(var(--warning-rgb),.08)}
.wa-composer.note-mode .wa-send{background:var(--warning);color:#1a1200}
.wa-mode{
  display:none;position:absolute;left:14px;top:-14px;background:var(--warning);color:#1a1200;font-size:11px;font-weight:700;
  padding:3px 10px;border-radius:999px;letter-spacing:.04em;text-transform:uppercase;
}
.wa-composer.note-mode .wa-mode{display:block}

/* ------------------------------------------------------ emoji panel */
.emo{
  position:absolute;left:12px;bottom:calc(100% + 6px);width:min(340px,calc(100% - 24px));max-height:300px;z-index:30;
  background:var(--surface);border:1px solid var(--border);border-radius:14px;box-shadow:var(--shadow);
  display:flex;flex-direction:column;animation:waPop .14s ease-out;overflow:hidden;
}
.emo .emo-tabs{display:flex;border-bottom:1px solid var(--border);background:var(--surface2)}
.emo .emo-tabs button{flex:1;border:0;background:none;padding:8px 0;font-size:17px;cursor:pointer;border-bottom:2px solid transparent;opacity:.7}
.emo .emo-tabs button.on{border-bottom-color:var(--primary);opacity:1}
.emo .emo-grid{overflow-y:auto;padding:8px;display:grid;grid-template-columns:repeat(8,1fr);gap:2px}
.emo .emo-grid button{border:0;background:none;font-size:22px;line-height:1;padding:6px 0;border-radius:8px;cursor:pointer}
.emo .emo-grid button:hover{background:var(--hover)}

/* --------------------------------------------------- slash popover */
.wa-pop{
  position:absolute;left:12px;right:12px;bottom:calc(100% + 6px);max-height:260px;overflow-y:auto;z-index:30;
  background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow);padding:6px;animation:waPop .12s;
}
.wa-pop button{display:flex;gap:10px;align-items:flex-start;width:100%;text-align:left;border:0;background:none;padding:9px 10px;border-radius:8px;color:var(--text);cursor:pointer}
.wa-pop button:hover,.wa-pop button.on{background:var(--hover)}
.wa-pop .sc{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12px;color:var(--primary);flex:none;padding-top:2px;min-width:52px}
.wa-pop .tx{font-size:13px;color:var(--muted);line-height:1.4;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}

/* --------------------------------------------------- attach sheet */
.wa-sheet-back{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:40;animation:fade .15s}
.wa-sheet{
  position:absolute;left:12px;bottom:calc(100% + 8px);z-index:45;background:var(--surface);border:1px solid var(--border);
  border-radius:14px;padding:8px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:2px;min-width:200px;animation:waPop .14s;
}
.wa-sheet button{display:flex;align-items:center;gap:12px;border:0;background:none;padding:9px 12px;border-radius:9px;color:var(--text);font-size:14px;cursor:pointer;font-family:inherit;text-align:left}
.wa-sheet button:hover{background:var(--hover)}
.wa-sheet button i{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;color:#fff;flex:none}
.wa-sheet button i .i{width:18px;height:18px}
.wa-sheet .c1{background:#a457e6}.wa-sheet .c2{background:#e6497c}.wa-sheet .c3{background:#3a6df0}.wa-sheet .c4{background:#f0932b}

/* ---------------------------------------------------------- lightbox */
.wa-lightbox{position:fixed;inset:0;background:rgba(0,0,0,.92);z-index:300;display:grid;place-items:center;padding:20px;animation:fade .15s;cursor:zoom-out}
.wa-lightbox img{max-width:100%;max-height:100%;border-radius:6px;box-shadow:0 20px 60px rgba(0,0,0,.6)}
.wa-lightbox .x{position:absolute;top:14px;right:14px;width:42px;height:42px;border-radius:50%;background:rgba(255,255,255,.12);border:0;color:#fff;display:grid;place-items:center;cursor:pointer}
.wa-lightbox .x .i{width:20px;height:20px}
.wa-lightbox .dl{position:absolute;top:14px;right:66px;width:42px;height:42px;border-radius:50%;background:rgba(255,255,255,.12);color:#fff;display:grid;place-items:center}
.wa-lightbox .dl .i{width:20px;height:20px}

/* ---------------------------------------------------- upload progress */
.wa-uploading{
  position:absolute;left:12px;right:12px;bottom:calc(100% + 8px);z-index:20;background:var(--surface);border:1px solid var(--border);
  border-radius:12px;padding:10px 14px;box-shadow:var(--shadow);font-size:13px;display:flex;align-items:center;gap:10px;animation:waPop .14s;
}
.wa-uploading .bar{flex:1;height:5px;border-radius:3px;background:var(--surface2);overflow:hidden}
.wa-uploading .bar i{display:block;height:100%;width:40%;background:var(--primary);animation:waSlide 1.1s infinite}
@keyframes waSlide{from{transform:translateX(-100%)}to{transform:translateX(260%)}}

/* ====================================================================
   VOICE - player and recorder (shared)
   ==================================================================== */
.voice{display:flex;align-items:center;gap:8px;padding:2px 0 0;min-width:min(250px,60vw)}
.v-play{background:none;border:0;padding:0;cursor:pointer;flex:none;color:var(--muted);display:grid;place-items:center;width:32px;height:32px}
.wa-row.out .v-play{color:var(--bubble-out-meta)}
.v-play .i{width:30px;height:30px;fill:currentColor;stroke:none}
.v-play .i-s,.v-play .i-w{display:none}
.voice.playing .v-play .i-s{display:block}
.voice.playing .v-play .i-p{display:none}
.voice.busy .v-play .i-w{display:block;animation:spin 1s linear infinite;fill:none;stroke:currentColor;stroke-width:2.2}
.voice.busy .v-play .i-p,.voice.busy .v-play .i-s{display:none}
@keyframes spin{to{transform:rotate(360deg)}}
.v-mid{flex:1;min-width:0}
.v-wave{position:relative;height:28px;display:flex;align-items:center;gap:2px;cursor:pointer;touch-action:none}
.v-wave i{flex:1 1 0;min-width:2px;max-width:3px;border-radius:2px;background:var(--muted);opacity:.45;transition:background .1s,opacity .1s}
.v-wave i.on{opacity:1;background:var(--link)}
.wa-row.out .v-wave i{background:var(--bubble-out-meta);opacity:.6}
.wa-row.out .v-wave i.on{background:var(--bubble-out-text);opacity:1}
.v-head{position:absolute;top:50%;width:12px;height:12px;border-radius:50%;background:var(--link);transform:translate(-50%,-50%);pointer-events:none;box-shadow:0 1px 3px rgba(0,0,0,.35);left:0}
.wa-row.out .v-head{background:var(--bubble-out-text)}
.v-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-left:40px;margin-top:1px}
.v-dur{font-size:11.5px;color:var(--bubble-meta);font-variant-numeric:tabular-nums}
.wa-row.out .v-dur{color:var(--bubble-out-meta)}
.wa-bub.vb .v-foot .wa-meta{float:none;top:0;margin:0}
.v-side{width:44px;height:44px;flex:none;position:relative;display:grid;place-items:center}
.v-av{width:44px;height:44px;border-radius:50%;overflow:hidden;background:var(--primary);display:grid;place-items:center;color:var(--on-primary);font-weight:700;font-size:16px}
.v-av img{width:100%;height:100%;object-fit:cover}
.v-av .i{width:26px;height:26px;stroke:var(--on-primary)}
.v-badge{position:absolute;right:-1px;bottom:-1px;width:17px;height:17px;border-radius:50%;background:var(--bubble-in);display:grid;place-items:center}
.wa-row.out .v-badge{background:var(--bubble-out)}
.v-badge .i{width:12px;height:12px;stroke-width:0;fill:var(--muted)}
.voice.seen .v-badge .i{fill:var(--link)}
.wa-row.out .voice .v-badge .i{fill:var(--bubble-out-meta)}
.v-speed{position:absolute;inset:0;margin:auto;width:38px;height:38px;border-radius:50%;border:0;background:rgba(0,0,0,.28);color:var(--bubble-text);font:600 11.5px/1 inherit;cursor:pointer;display:none;place-items:center;white-space:nowrap}
html[data-theme="light"] .v-speed{background:rgba(0,0,0,.10)}
.voice.started .v-speed{display:grid}
.voice.started .v-av{visibility:hidden}
.voice.started .v-badge{display:none}
.wa-bub.vb{padding:5px 8px 5px}

/* recorder - the visitor widget and the inbox composer */
.c-fields{display:flex;align-items:flex-end;gap:4px;flex:1;min-width:0}
.c-rec{display:flex;align-items:center;gap:10px;flex:1;min-width:0;height:44px;padding:0 2px;animation:recIn .16s ease-out}
@keyframes recIn{from{opacity:0}to{opacity:1}}
.rec-trash{background:none;border:0;color:var(--muted);padding:6px;border-radius:50%;cursor:pointer;display:grid;place-items:center;flex:0 0 auto;transition:color .15s,transform .15s}
.rec-trash:hover{color:var(--danger)}
.wa-composer.armed .rec-trash{color:var(--danger);transform:scale(1.18)}
.rec-dot{width:9px;height:9px;border-radius:50%;background:#f2374b;flex:0 0 auto;animation:recBlink 1.15s steps(1,end) infinite}
@keyframes recBlink{0%,49%{opacity:1}50%,100%{opacity:0}}
.rec-time{font-size:14.5px;font-variant-numeric:tabular-nums;color:var(--text);flex:0 0 auto;min-width:42px}
.rec-live{flex:1;min-width:0;height:26px;display:flex;align-items:center;gap:2px;overflow:hidden;justify-content:flex-end}
.rec-live i{width:2.5px;flex:0 0 auto;border-radius:2px;background:var(--muted);opacity:.75;height:3px}
.rec-hint{display:flex;align-items:center;gap:2px;color:var(--muted);font-size:13.5px;flex:0 0 auto;animation:slideHint 2s ease-in-out infinite;white-space:nowrap}
.rec-hint .i{width:16px;height:16px}
@keyframes slideHint{0%,100%{opacity:.45;transform:translateX(4px)}50%{opacity:1;transform:translateX(-2px)}}
.wa-composer.locked .rec-hint,.wa-composer.locked .rec-live{display:none}
.wa-composer.locked .rec-time{flex:1}
.rec-stop{background:none;border:0;padding:8px;cursor:pointer;display:grid;place-items:center;flex:0 0 auto}
.rec-stop span{width:17px;height:17px;border-radius:3px;background:#f2374b;display:block}

.wa-composer.rec .wa-send{
  transform:scale(1.32);background:var(--primary);
  transition:transform .12s,background .15s,box-shadow .15s;
  box-shadow:0 0 0 10px rgba(var(--primary-rgb),.16),0 0 0 22px rgba(var(--primary-rgb),.08);
}
.wa-composer.armed .wa-send{background:#f2374b;box-shadow:0 0 0 10px rgba(242,55,75,.16)}
.wa-composer.locked .wa-send{transform:none;background:var(--primary);box-shadow:none}
.wa-composer.locked .wa-send .i-mic{display:none}
.wa-composer.locked .wa-send .i-send{display:block}

.c-prev{display:flex;align-items:center;gap:10px;flex:1;min-width:0;height:44px;background:var(--surface);border:1px solid var(--border);border-radius:22px;padding:0 12px 0 4px}
.prev-del{background:none;border:0;color:var(--danger);padding:7px;cursor:pointer;display:grid;place-items:center;flex:0 0 auto}
.prev-play{background:none;border:0;color:var(--text);padding:5px;cursor:pointer;display:grid;place-items:center;flex:0 0 auto}
.prev-play .i{width:24px;height:24px}
.prev-play .i-s{display:none}
.prev-play.on .i-s{display:block}
.prev-play.on .i-p{display:none}
.prev-wave{flex:1;min-width:0;height:26px;display:flex;align-items:center;gap:2px;overflow:hidden;cursor:pointer}
.prev-wave i{flex:1 1 0;min-width:2px;max-width:3px;border-radius:2px;background:var(--muted);opacity:.45}
.prev-wave i.on{opacity:1;background:var(--primary)}
.prev-time{font-size:13px;font-variant-numeric:tabular-nums;color:var(--muted);flex:0 0 auto}
@media(max-width:480px){.rec-hint span{font-size:12.5px}}

@media(max-width:640px){
  .wa-thread{padding:12px 10px 8px}
  .wa-bub{max-width:86%}
  .voice{min-width:min(232px,66vw)}
  /* a CTA under a bubble is a primary action - give it a full-size target */
  .wa-cta{padding:13px 12px}
  .wa-chips{padding:8px 10px 2px}
  .wa-composer{padding-left:8px;padding-right:8px;gap:4px}
  .wa-file{min-width:0}
  .wa-img{width:100%}
}
@media(max-width:380px){
  .wa-bub{max-width:92%}
  .wa-ico{width:38px;height:38px}
  .wa-ico .i{width:22px;height:22px}
}
/* Landscape on a phone leaves almost no height: shrink the chrome so the
   thread itself keeps most of the screen. */
@media(max-height:460px) and (orientation:landscape){
  .wa-thread{padding-top:6px}
  .wa-composer{padding-top:5px;padding-bottom:calc(5px + env(safe-area-inset-bottom))}
  .wa-chips{padding-top:5px}
  .emo{max-height:190px}
}
