/* V8.7 (CAIXA) — caixa de conversa nova. Só apresentação (ver js/conv87.js). Carrega DEPOIS de todos os outros CSS.
   Layout em duas famílias:
   A) "calha" (largura >= 560px: iPhone deitado 844x390, Fold aberto, PC): calha à esquerda com o retrato de QUEM FALA em cima e o MEU em baixo,
      balão de fala + alternativas à direita.
   B) "empilhado" (largura < 560px: iPhone em pé, Fold fechado): quem fala em cima (retrato + nome + papel), balão, depois o meu retrato e as alternativas.
   Tudo roda dentro do painel (nunca corta); botões >= 44px. */
:root{--c87-ink:#2B1B3D;--c87-mut:#7C6C97;--c87-line:#E7DDF7;--c87-glass:rgba(255,250,243,.93);--c87-pink:#FF5E8A;--c87-teal:#19B5A5}

/* ---- painel (vidro) ---- */
#sheet.talk{background:linear-gradient(180deg,rgba(20,10,40,0) 40%,rgba(20,10,40,.28) 100%)}
#sheet.talk .panel.dlg.c87{
  background:var(--c87-glass);-webkit-backdrop-filter:blur(10px) saturate(1.2);backdrop-filter:blur(10px) saturate(1.2);
  border:3px solid #fff;border-radius:26px;padding:12px 12px 12px;
  box-shadow:0 14px 44px rgba(20,10,40,.5),0 0 0 1px rgba(43,27,61,.12);
  display:flex!important;flex-direction:column;overflow:hidden!important;position:relative;
  width:calc(100% - 12px)!important;max-width:760px!important;height:auto!important;
  margin:0 auto calc(6px + env(safe-area-inset-bottom,0px))!important;
  max-height:min(76%,calc(100% - 64px))!important;
  animation:c87in .34s cubic-bezier(.2,.9,.3,1.08) both}
@keyframes c87in{from{transform:translateY(38px) scale(.97);opacity:0}to{transform:none;opacity:1}}
#sheet.talk .panel.dlg.c87 .xbtn{position:absolute;right:10px;top:10px;width:44px;height:44px;z-index:5;font-size:20px;background:#fff;box-shadow:0 3px 0 #D7CBEE}
#sheet.talk .panel.dlg.c87 #dbody{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;scrollbar-width:thin;padding-right:2px}
#sheet.talk .panel.dlg.c87 #dbody.c87g{display:grid!important;gap:0;align-content:start;
  grid-template-columns:minmax(0,1fr);
  grid-template-areas:"who" "bubble" "pt" "me" "opts" "fb" "rb";grid-template-rows:repeat(7,max-content)}
#sheet.talk .panel.dlg.c87 #dbody.c87g>*{margin:0;align-self:start!important;min-width:0}
#sheet.talk .panel.c87 #dbody.c87g>.who{grid-area:who!important}
#sheet.talk .panel.c87 #dbody.c87g>.bubble{grid-area:bubble!important}
#sheet.talk .panel.c87 #dbody.c87g>.ptline{grid-area:pt!important}
#sheet.talk .panel.c87 #dbody.c87g>.c87-me{grid-area:me!important}
#sheet.talk .panel.c87 #dbody.c87g>.opts{grid-area:opts!important}
#sheet.talk .panel.c87 #dbody.c87g>.fb{grid-area:fb!important}
#sheet.talk .panel.c87 #dbody.c87g>.rowbtns{grid-area:rb!important}
#sheet.talk .panel.c87 #dbody.c87g>.ptline:empty,#sheet.talk .panel.c87 #dbody.c87g>.fb:empty{display:none}

/* ---- quem fala (retrato em cima) ---- */
#sheet.talk .panel.c87 #dbody.c87g>.who{display:flex;align-items:center;gap:12px;margin:0 52px 10px 0;padding:0;position:relative}
#sheet.talk .panel.c87 #dbody.c87g .who>div:not(.avatar):not(.dots){min-width:0;flex:1}
#sheet.talk .panel.c87 #dbody.c87g .who b{display:block;font:800 20px/1.1 var(--f1);color:var(--c87-ink);overflow-wrap:anywhere}
#sheet.talk .panel.c87 #dbody.c87g .who small{display:inline-block;margin-top:3px;padding:2px 10px;border-radius:99px;background:#EFE8FA;color:#6A5A8C;font:800 12.5px/1.35 var(--f1);max-width:100%}
#sheet.talk .panel.c87 #dbody.c87g .who .dots{margin:0;position:static;flex:none;gap:4px}
#sheet.talk .panel.c87 #dbody.c87g .who .dots i{width:8px;height:8px}
.c87-av{--s:76px;position:relative;width:var(--s)!important;height:var(--s)!important;flex:none;border-radius:50%;overflow:visible!important;
  background:radial-gradient(circle at 50% 38%,#FFF 0,#F6EEFF 55%,#E3D6F7 100%);border:4px solid #fff!important;
  box-shadow:0 4px 0 #D7CBEE,0 8px 18px rgba(43,27,61,.28)!important;display:flex;align-items:center;justify-content:center}
.c87-av>span,.c87-av>.pxav{display:block;width:100%;height:100%;border-radius:50%;overflow:hidden}
.c87-av img{width:100%;height:100%;object-fit:cover;image-rendering:pixelated;border-radius:50%;display:block}
.c87-av svg{width:100%;height:100%;border-radius:50%}
.c87-badge{position:absolute;right:-6px;top:-6px;font-style:normal;font-size:20px;line-height:1;filter:drop-shadow(0 2px 2px rgba(0,0,0,.3));animation:c87pop .35s both}
.c87-badge:empty{display:none}
.c87-ring{position:absolute;inset:-7px;border-radius:50%;border:3px solid var(--c87-pink);opacity:0;pointer-events:none}
.c87-av.talking .c87-ring{animation:c87ring 1.1s ease-out 2}
.c87-av.talking{animation:c87talk .55s ease-in-out 3 alternate}
@keyframes c87ring{0%{transform:scale(.92);opacity:.9}100%{transform:scale(1.22);opacity:0}}
@keyframes c87talk{to{transform:translateY(-3px)}}
@keyframes c87pop{from{transform:scale(0) rotate(-30deg)}to{transform:none}}
.c87-av[data-expr=feliz]{animation:c87happy .5s ease-out}
.c87-av[data-expr=pensar]{animation:c87think .6s ease-out}
@keyframes c87happy{30%{transform:scale(1.1) rotate(-3deg)}60%{transform:scale(.98) rotate(2deg)}}
@keyframes c87think{0%,100%{transform:none}30%{transform:rotate(-6deg)}60%{transform:rotate(4deg)}}

/* ---- balão de fala ---- */
#sheet.talk .panel.c87 #dbody.c87g>.bubble{position:relative;display:flex!important;flex-wrap:nowrap;align-items:center;gap:12px;margin-top:18px;
  background:#fff;border:3px solid var(--c87-line);border-radius:6px 22px 22px 22px;padding:14px 14px 12px;box-shadow:0 4px 0 #E3D8F5;animation:c87bub .38s .08s both}
@keyframes c87bub{from{transform:translateY(8px) scale(.97);opacity:0}to{transform:none;opacity:1}}
#sheet.talk .panel.c87 #dbody.c87g>.bubble::before{content:"";position:absolute;left:24px;top:-11px;width:0;height:0;border:11px solid transparent;border-top:0;border-bottom:11px solid var(--c87-line);transform:none}
#sheet.talk .panel.c87 #dbody.c87g>.bubble::after{content:"";position:absolute;left:27px;top:-6px;width:0;height:0;border:8px solid transparent;border-top:0;border-bottom:8px solid #fff;transform:none}
#sheet.talk .panel.c87 #dbody.c87g>.bubble .vis{order:0;font-size:40px;line-height:1;flex:none}
#sheet.talk .panel.c87 #dbody.c87g>.bubble .en{order:1;flex:1 1 0;min-width:0;max-height:none!important;overflow:visible!important;font:700 21px/1.28 var(--f1);color:var(--c87-ink);overflow-wrap:anywhere;padding:0!important;outline:none}
.panel.c87[data-len87=s] .bubble .en{font-size:24px!important}
.panel.c87[data-len87=m] .bubble .en{font-size:21px!important}
.panel.c87[data-len87=l] .bubble .en{font-size:19px!important}
.panel.c87[data-len87=xl] .bubble .en{font-size:17px!important;line-height:1.3!important}
/* botões do balão (ouvir / devagar / esconder): pastilhas que ficam a cavalo na borda de cima */
#sheet.talk .panel.c87 #dbody.c87g>.ptline{margin:8px 4px 0;font:700 14px/1.35 var(--f2);color:var(--c87-mut)}
#sheet.talk .panel.c87 #dbody.c87g .pthint742{font-size:12px}

/* ---- o meu retrato, junto das alternativas ---- */
#sheet.talk .panel.c87 #dbody.c87g>.c87-me{display:flex;align-items:center;gap:10px;margin:12px 0 8px;animation:c87bub .38s .16s both}
.c87-me .c87-av{--s:52px}
.c87-mename b{display:block;font:800 16px/1.1 var(--f1);color:var(--c87-ink)}
.c87-mename small{display:block;font:800 12px/1.3 var(--f1);color:var(--c87-mut)}

/* ---- alternativas ---- */
#sheet.talk .panel.c87 #dbody.c87g>.opts{display:flex;flex-direction:column;gap:8px;margin:0}
#sheet.talk .panel.c87 #dbody.c87g .opt{min-height:50px;padding:10px 14px;border-radius:18px;border:3px solid var(--c87-line);background:#fff;font:700 19px/1.22 var(--f1);color:var(--c87-ink);box-shadow:0 4px 0 #D7CBEE;
  overflow-wrap:anywhere;touch-action:manipulation;animation:c87opt .32s both;transition:transform .12s,background .15s,border-color .15s}
#sheet.talk .panel.c87 #dbody.c87g .opt:nth-child(2){animation-delay:.06s}#sheet.talk .panel.c87 #dbody.c87g .opt:nth-child(3){animation-delay:.12s}#sheet.talk .panel.c87 #dbody.c87g .opt:nth-child(4){animation-delay:.18s}#sheet.talk .panel.c87 #dbody.c87g .opt:nth-child(5){animation-delay:.24s}
@keyframes c87opt{from{transform:translateX(14px);opacity:0}to{transform:none;opacity:1}}
#sheet.talk .panel.c87 #dbody.c87g .opt>span:first-child{flex:1;min-width:0}
#sheet.talk .panel.c87 #dbody.c87g .opt .sp{flex:none;display:flex;align-items:center;gap:5px;background:none;font-size:16px}
/* V8.9.34: 🔊 e 🐢 por opção — dois botões redondos pequenos, lado a lado; só ouvem (não escolhem) */
#sheet.talk .panel.c87 #dbody.c87g .opt .sp1{flex:none;width:34px;height:34px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:#F4EEFC;font-size:16px;font-style:normal;line-height:1;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;user-select:none}
#sheet.talk .panel.c87 #dbody.c87g .opt .sp2{background:#E4F7F3}
#sheet.talk .panel.c87 #dbody.c87g .opt .sp1:active{transform:scale(.92)}
#sheet.talk .panel.c87 #dbody.c87g .opt:active:not(.right):not(.wrong){transform:translateY(2px);box-shadow:0 2px 0 #D7CBEE}
#sheet.talk .panel.c87 #dbody.c87g .opt.right{background:#D7F8E9;border-color:var(--c87-teal);box-shadow:0 4px 0 #8ADCC3,0 0 0 4px rgba(25,181,165,.22);animation:c87right .55s both}
#sheet.talk .panel.c87 #dbody.c87g .opt.wrong{background:#FFE0E5;border-color:#E8374F;box-shadow:0 4px 0 #F2B0BB;animation:c87shake .42s both}
#sheet.talk .panel.c87 #dbody.c87g .opt.dim{opacity:.42}
@keyframes c87right{0%{transform:scale(.97)}45%{transform:scale(1.035)}100%{transform:scale(1)}}
@keyframes c87shake{0%,100%{transform:none}20%{transform:translateX(-7px)}40%{transform:translateX(6px)}60%{transform:translateX(-4px)}80%{transform:translateX(3px)}}
.panel.c87[data-opt87=m] .opt{font-size:17.5px!important}
.panel.c87[data-opt87=l] .opt{font-size:16.5px!important}
#sheet.talk .panel.c87 #dbody.c87g .opt small.opt-pt{display:block;font:600 12.5px/1.25 var(--f2);color:var(--c87-mut);margin-top:2px}

/* ---- feedback + botões ---- */
#sheet.talk .panel.c87 #dbody.c87g>.fb{margin:10px 0 0;border-radius:16px}
#sheet.talk .panel.c87 #dbody.c87g>.fb.ok,#sheet.talk .panel.c87 #dbody.c87g>.fb.no{padding:9px 13px;font-size:15px;max-height:none}
#sheet.talk .panel.c87 #dbody.c87g>.rowbtns{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0 0;padding-bottom:2px}
#sheet.talk .panel.c87 #dbody.c87g>.rowbtns .btn,#sheet.talk .panel.c87 #dbody.c87g>.rowbtns .hintbtn{min-height:46px;font-size:16.5px;border-radius:99px;flex:0 1 auto}
#sheet.talk .panel.c87 #dbody.c87g>.rowbtns .btn.go{flex:1 1 150px;animation:c87right .5s both}
#sheet.talk .panel.c87 #dbody.c87g>.rowbtns .micbtn{flex:1 1 150px}
.panel.c87.c87-no .opts{animation:none}

/* ================= A) calha: largura >= 560px ================= */
@media (min-width:560px){
  #sheet.talk .panel.dlg.c87{padding:12px 14px 12px 12px;max-width:880px!important}
  #sheet.talk .panel.dlg.c87 #dbody.c87g{grid-template-columns:116px minmax(0,1fr);column-gap:14px;
    grid-template-areas:"who bubble" "who pt" "me opts" "me fb" "me rb"}
  #sheet.talk .panel.c87 #dbody.c87g>.who{flex-direction:column;align-items:center;text-align:center;gap:6px;margin:0;position:sticky;top:0;align-self:start!important;grid-row:1/3!important}
  #sheet.talk .panel.c87 #dbody.c87g>.who>div:not(.avatar):not(.dots){flex:none;width:100%}
  #sheet.talk .panel.c87 #dbody.c87g>.who .dots{justify-content:center}
  #sheet.talk .panel.c87 #dbody.c87g>.who .c87-av{--s:100px}
  #sheet.talk .panel.c87 #dbody.c87g>.who small{font-size:12px}
  #sheet.talk .panel.c87 #dbody.c87g>.who b{font-size:18px}
  #sheet.talk .panel.c87 #dbody.c87g>.bubble{margin-top:6px;margin-right:58px;border-radius:22px 22px 22px 22px}
  #sheet.talk .panel.c87 #dbody.c87g>.bubble::before{left:-11px;top:26px;border:11px solid transparent;border-left:0;border-right:11px solid var(--c87-line);border-bottom-color:transparent}
  #sheet.talk .panel.c87 #dbody.c87g>.bubble::after{left:-6px;top:29px;border:8px solid transparent;border-left:0;border-right:8px solid #fff;border-bottom-color:transparent}
  #sheet.talk .panel.c87 #dbody.c87g>.c87-me{flex-direction:column;align-items:center;text-align:center;gap:4px;margin:10px 0 0;position:sticky;bottom:0;align-self:end!important;grid-row:3/6!important}
  #sheet.talk .panel.c87 #dbody.c87g>.c87-me .c87-av{--s:70px}
  #sheet.talk .panel.c87 #dbody.c87g>.opts{margin-top:10px}
}

/* ================= iPhone deitado e ecrãs baixos ================= */
@media (orientation:landscape) and (max-height:560px){
  #sheet.talk{flex-direction:row!important;justify-content:flex-end!important;align-items:stretch!important}
  #sheet.talk .panel.dlg.c87{width:min(72vw,680px)!important;max-width:none!important;margin:6px calc(6px + env(safe-area-inset-right,0px)) 6px 0!important;max-height:calc(100% - 12px)!important;padding:10px 10px 10px 10px;border-radius:22px;animation-name:c87inR}
  @keyframes c87inR{from{transform:translateX(44px);opacity:0}to{transform:none;opacity:1}}
  #sheet.talk .panel.dlg.c87 .xbtn{top:6px;right:6px;width:44px;height:44px}
  #sheet.talk .panel.dlg.c87 #dbody.c87g{grid-template-columns:92px minmax(0,1fr);column-gap:12px}
  #sheet.talk .panel.c87 #dbody.c87g>.who .c87-av{--s:78px}
  #sheet.talk .panel.c87 #dbody.c87g>.who b{font-size:15.5px}
  #sheet.talk .panel.c87 #dbody.c87g>.who small{font-size:11px;padding:1px 8px}
  #sheet.talk .panel.c87 #dbody.c87g>.who .dots i{width:7px;height:7px}
  #sheet.talk .panel.c87 #dbody.c87g>.c87-me .c87-av{--s:54px}
  #sheet.talk .panel.c87 #dbody.c87g>.c87-me{margin-top:6px}
  #sheet.talk .panel.c87 #dbody.c87g>.bubble{margin-top:4px;margin-right:58px;padding:9px 12px}
  #sheet.talk .panel.c87 #dbody.c87g>.bubble::before{top:20px}#sheet.talk .panel.c87 #dbody.c87g>.bubble::after{top:23px}
  #sheet.talk .panel.c87 #dbody.c87g>.bubble .vis{font-size:32px}
  .panel.c87[data-len87=s] .bubble .en{font-size:21px!important}
  .panel.c87[data-len87=m] .bubble .en{font-size:19px!important}
  .panel.c87[data-len87=l] .bubble .en{font-size:17px!important}
  .panel.c87[data-len87=xl] .bubble .en{font-size:15.5px!important}
  #sheet.talk .panel.c87 #dbody.c87g>.opts{gap:6px;margin-top:8px}
  #sheet.talk .panel.c87 #dbody.c87g .opt{min-height:44px;padding:6px 10px;font-size:17px;border-radius:15px}
  #sheet.talk .panel.c87 #dbody.c87g .opt .sp1{width:30px;height:30px}
  .panel.c87[data-opt87=m] .opt{font-size:16px!important}
  .panel.c87[data-opt87=l] .opt{font-size:15px!important}
  #sheet.talk .panel.c87 #dbody.c87g>.rowbtns{margin-top:8px}
  #sheet.talk .panel.c87 #dbody.c87g>.rowbtns .btn,#sheet.talk .panel.c87 #dbody.c87g>.rowbtns .hintbtn{min-height:44px;font-size:15px;padding:6px 14px}
  #sheet.talk .panel.c87 #dbody.c87g>.fb.ok,#sheet.talk .panel.c87 #dbody.c87g>.fb.no{font-size:14px;padding:7px 11px}
}

/* ================= PC / ecrã alto em largura: caixa ao fundo, centrada ================= */
@media (orientation:landscape) and (min-height:561px){
  #sheet.talk{flex-direction:column!important;justify-content:flex-end!important;align-items:center!important}
  #sheet.talk .panel.dlg.c87{width:min(880px,74vw)!important;max-width:880px!important;margin:0 auto 18px!important;max-height:min(66%,calc(100% - 80px))!important}
  #sheet.talk .panel.c87 #dbody.c87g>.who .c87-av{--s:112px}
  #sheet.talk .panel.dlg.c87 #dbody.c87g{grid-template-columns:132px minmax(0,1fr)}
  #sheet.talk .panel.c87 #dbody.c87g>.bubble .en{font-size:22px}
}

/* ================= iPhone / Fold fechado em pé (< 560px) ================= */
@media (max-width:559px){
  #sheet.talk .panel.dlg.c87{max-height:min(78%,calc(100% - 56px))!important;padding:10px 10px 10px}
  #sheet.talk .panel.c87 #dbody.c87g>.who .c87-av{--s:72px}
  #sheet.talk .panel.c87 #dbody.c87g>.who{margin-right:50px}
  #sheet.talk .panel.c87 #dbody.c87g .opt{font-size:18px}
  .panel.c87[data-opt87=m] .opt{font-size:16.5px!important}
  .panel.c87[data-opt87=l] .opt{font-size:15.5px!important}
}
@media (max-width:370px){
  #sheet.talk .panel.c87 #dbody.c87g>.who b{font-size:17px}
  .panel.c87[data-len87=xl] .bubble .en{font-size:16px!important}
}
@media (prefers-reduced-motion:reduce){
  #sheet.talk .panel.dlg.c87,#sheet.talk .panel.c87 #dbody.c87g *,.c87-av{animation:none!important}
}

/* ---- fecho: botões do balão em linha, em baixo à direita; a dica "segure no texto" ocupa o canto esquerdo vazio ---- */
#sheet.talk .panel.c87 #dbody.c87g>.bubble{padding-bottom:54px;margin-right:52px!important}
@media (min-width:560px){#sheet.talk .panel.c87 #dbody.c87g>.bubble::before{top:24px}#sheet.talk .panel.c87 #dbody.c87g>.bubble::after{top:27px}}
#sheet.talk .panel.c87 #dbody.c87g>.bubble>.say,#sheet.talk .panel.c87 #dbody.c87g>.bubble>.slow,#sheet.talk .panel.c87 #dbody.c87g>.bubble>.h80-chip,#sheet.talk .panel.c87 #dbody.c87g>.bubble>button{position:absolute!important;top:auto!important;bottom:6px;margin:0!important;border-radius:50%;z-index:2;box-shadow:0 3px 0 rgba(0,0,0,.18);width:44px!important;height:44px!important;min-width:44px;font-size:21px;border-width:2px}
#sheet.talk .panel.c87 #dbody.c87g>.bubble>.say{right:8px}
#sheet.talk .panel.c87 #dbody.c87g>.bubble>.slow{right:58px}
#sheet.talk .panel.c87 #dbody.c87g>.bubble>.h80-chip{right:108px}
/* V8.9.23 (C6): o balão é sticky com z-index 4 (V8.9.20) e tapava a dica posta por baixo dele com margem negativa.
   Agora a dica ou vai para DENTRO do balão, no canto esquerdo vazio (.pth-canto, só quando cabe inteira: conv742g.js · pthintFit742),
   ou fica na sua própria linha, logo por baixo do balão. Nunca cortada. */
#sheet.talk .panel.c87 #dbody.c87g>.ptline:has(>.pthint742:only-child){margin:0 0 4px 14px;pointer-events:none}
#sheet.talk .panel.c87 #dbody.c87g>.ptline:empty{display:block!important;min-height:0!important;height:0;margin:0!important;padding:0;overflow:hidden}   /* vazia mas na grelha: com display:none (regra da l. 34) o meu retrato (grid-row:auto) subia para a linha «pt» e ficava sozinho por cima das respostas */
#sheet.talk .panel.c87 #dbody.c87g>.bubble>.pthint742.pth-canto{position:absolute;left:14px;bottom:28px;transform:translateY(50%);z-index:1;margin:0;display:block;
  font:700 12px/1.3 var(--f2);color:var(--c87-mut);opacity:1;pointer-events:none;overflow-wrap:normal;word-break:normal;hyphens:none}
@media (orientation:landscape) and (max-height:560px){#sheet.talk .panel.c87 #dbody.c87g>.bubble>.pthint742.pth-canto{bottom:25px;font-size:12.5px}}
#sheet.talk .panel.c87 #dbody.c87g>.ptline:not(:has(>.pthint742:only-child)){margin-top:10px}
#sheet.talk .panel.c87 #dbody.c87g>.bubble+.ptline{margin-bottom:6px}
#sheet.talk .panel.c87 #dbody.c87g .who .dots:has(i:only-child){display:none}
#sheet.talk .panel.c87 #dbody.c87g>.c87-me{align-self:start!important;position:sticky;top:0;bottom:auto}
@media (orientation:landscape) and (max-height:560px){
  #sheet.talk .panel.dlg.c87{align-self:flex-end!important;height:auto!important}
  #sheet.talk .panel.c87 #dbody.c87g>.bubble{padding-bottom:50px}
  #sheet.talk .panel.c87 #dbody.c87g>.ptline:has(>.pthint742:only-child){font-size:12.5px}
  #sheet.talk .panel.c87 #dbody.c87g>.who{margin-right:0}
}
@media (max-width:559px){#sheet.talk .panel.c87 #dbody.c87g>.who{margin-right:52px}#sheet.talk .panel.c87 #dbody.c87g>.bubble{margin-right:0!important}}

@media (min-width:560px){
/* texto curto: botões na mesma linha do enunciado (a caixa fica mais baixa) */
#sheet.talk .panel.c87[data-len87=s] #dbody.c87g>.bubble{padding-bottom:12px;padding-right:164px;min-height:74px}
#sheet.talk .panel.c87[data-len87=s] #dbody.c87g>.bubble>.say,#sheet.talk .panel.c87[data-len87=s] #dbody.c87g>.bubble>.slow,#sheet.talk .panel.c87[data-len87=s] #dbody.c87g>.bubble>.h80-chip{bottom:auto!important;top:50%;margin-top:-22px!important}
#sheet.talk .panel.c87[data-len87=s] #dbody.c87g>.ptline:has(>.pthint742:only-child){margin:6px 0 0 6px;height:auto;width:auto}
}
/* o engine.js (fit) encolhe o #dbody com zoom quando excede o painel; aqui o painel rola, por isso o zoom fica sempre 1 */
#sheet.talk .panel.c87 #dbody{zoom:1!important}


/* ================= V8.7.1 (FICHA): polimento ================= */
/* (1) os dois retratos do MESMO tamanho, em todos os formatos  (2) o meu retrato centrado na altura das respostas  (3) mais rosto, menos fundo */
#sheet.talk .panel.c87{--c87-s:64px}
#sheet.talk .panel.c87 #dbody.c87g .c87-av,#sheet.talk .panel.c87 #dbody.c87g>.who .c87-av,#sheet.talk .panel.c87 #dbody.c87g>.c87-me .c87-av{--s:var(--c87-s)}
@media (min-width:560px){#sheet.talk .panel.c87{--c87-s:100px}}
@media (orientation:landscape) and (max-height:560px){#sheet.talk .panel.c87{--c87-s:72px}}
@media (orientation:landscape) and (min-height:561px){#sheet.talk .panel.c87{--c87-s:112px}}
/* fundo do círculo mais claro e discreto; o rosto enche o círculo */
.c87-av{background:#FBF7FF!important}
.c87-av img.c87-rt{transform:none}
/* calha: o meu retrato fica na MESMA linha das respostas, centrado na altura do bloco */
@media (min-width:560px){
  #sheet.talk .panel.dlg.c87 #dbody.c87g{grid-template-areas:"who bubble" "who pt" "me opts" ". fb" ". rb"}
  #sheet.talk .panel.c87 #dbody.c87g>.c87-me{grid-row:3!important;align-self:center!important;position:static!important;margin:10px 0 0}
}
/* empilhado (em pé): duas colunas na parte das respostas — retrato à esquerda, centrado, respostas à direita */
@media (max-width:559px){
  #sheet.talk .panel.dlg.c87 #dbody.c87g{grid-template-columns:var(--c87-s) minmax(0,1fr);column-gap:8px;grid-template-areas:"who who" "bubble bubble" "pt pt" "me opts" ". fb" ". rb"}
  #sheet.talk .panel.c87 #dbody.c87g>.c87-me{grid-row:auto!important;align-self:center!important;position:static!important;margin:8px 0 0;flex-direction:column;align-items:center;gap:2px}
  #sheet.talk .panel.c87 #dbody.c87g>.opts{margin-top:8px}
  #sheet.talk .panel.c87 #dbody.c87g>.c87-me .c87-mename small{display:none}
  #sheet.talk .panel.c87 #dbody.c87g>.c87-me .c87-mename b{font-size:12px;max-width:var(--c87-s);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}
  #sheet.talk .panel.c87 #dbody.c87g>.fb,#sheet.talk .panel.c87 #dbody.c87g>.rowbtns{margin-left:0}
}

/* ================= V8.9.20 · Onda 3 · caixa de conversa nova (CX-1 … CX-10) ================= */
/* CX-7: progresso em pílulas grandes (contam o caminho, com ramos) */
#sheet.talk .panel.c87 #dbody.c87g .who .dots.pills{gap:5px;align-items:center}
#sheet.talk .panel.c87 #dbody.c87g .who .dots.pills i{width:22px;height:9px;border-radius:9px;background:#E3D8F5;border:0;transition:background .2s,transform .2s}
#sheet.talk .panel.c87 #dbody.c87g .who .dots.pills i.done{background:var(--t1,var(--c87-teal))}
#sheet.talk .panel.c87 #dbody.c87g .who .dots.pills i.on{background:var(--t1,var(--c87-pink));box-shadow:0 0 0 3px rgba(43,27,61,.14);transform:scaleY(1.25)}
/* D-1: selo «voz provisória» (enquanto não se grava) */
#sheet.talk .panel.c87 #dbody.c87g>.bubble>.vozprov{position:absolute!important;left:12px;bottom:12px;font:800 11.5px/1 var(--f1);font-style:normal;padding:4px 9px;border-radius:99px;background:#FFF1C9;color:#6B4A00;border:2px dashed #E0A800;pointer-events:auto;max-width:48%}
/* CX-4: texto a escrever-se; ⏩ para mostrar tudo; respostas só depois */
#sheet.talk .panel.c87 #dbody.c87g>.opts.espera{opacity:0;pointer-events:none}
#sheet.talk .panel.c87 #dbody.c87g>.opts{transition:opacity .2s}
#sheet.talk .panel.c87 #dbody.c87g>.bubble>.skipbtn{position:absolute!important;right:158px;bottom:6px;min-width:44px;height:44px;border-radius:99px;border:2px solid var(--c87-line);background:#fff;font-size:18px;color:var(--c87-ink);cursor:pointer;z-index:3}
/* CX-1/CX-3: ícone da resposta, estados das respostas */
#sheet.talk .panel.c87 #dbody.c87g .opt .oi{flex:none;font-size:26px;line-height:1;margin-right:8px;display:inline-block}
#sheet.talk .panel.c87 #dbody.c87g .opt.so-ouvir:not(.right){cursor:pointer;opacity:1}
#sheet.talk .panel.c87 #dbody.c87g .opt.ouvida::after{content:"✓";position:absolute;right:46px;top:6px;font:800 14px/1 var(--f1);color:var(--c87-teal)}
#sheet.talk .panel.c87 #dbody.c87g .opt{position:relative}
/* CX-2: «quase» (âmbar e tracejado, sem vermelho) */
#sheet.talk .panel.c87 #dbody.c87g .opt.wrong.quase{background:#FFF4D6;border:3px dashed #D99A00;box-shadow:0 4px 0 #F0D58A;animation:c87shake .42s both;color:var(--c87-ink)}
#sheet.talk .panel.c87 #dbody.c87g .opt.brilha{border-color:var(--c87-teal);box-shadow:0 0 0 4px rgba(25,181,165,.35),0 4px 0 #8ADCC3;animation:c87glow 1.1s ease-in-out infinite alternate}
@keyframes c87glow{to{box-shadow:0 0 0 7px rgba(25,181,165,.15),0 4px 0 #8ADCC3}}
#sheet.talk .panel.c87 #dbody.c87g>.fb.ok,#sheet.talk .panel.c87 #dbody.c87g>.fb.no,#sheet.talk .panel.c87 #dbody.c87g>.fb.quase{overflow:visible;min-height:min-content;max-height:none}
#sheet.talk .panel.c87 #dbody.c87g>.fb.quase{background:#FFF4D6;border:2px solid #E3B33A;color:var(--c87-ink)}
#sheet.talk .panel.c87 #dbody.c87g>.fb .reouvir{display:inline-block;margin-top:6px;min-height:44px;padding:6px 14px;border-radius:99px;border:2px solid #D99A00;background:#fff;font:800 15px var(--f1);color:var(--c87-ink);cursor:pointer}
/* CX-3: o botão «Continuar ▶» fica sempre à vista, agarrado ao fundo da caixa (a lista rola por baixo dele) */
#sheet.talk .panel.c87 #dbody.c87g>.rowbtns:not(:has(#nx)){position:static;background:none;margin-left:0;margin-right:0}
#sheet.talk .panel.c87 #dbody.c87g>.rowbtns:has(#nx){position:sticky;bottom:-3px;z-index:3;padding-top:8px;background:linear-gradient(to bottom,rgba(255,250,243,0),var(--c87-glass,#fffaf3) 7%)}
/* CX-3: convite a ouvir as outras + botão grande */
#sheet.talk .panel.c87 #dbody.c87g>.rowbtns .ouvir{flex:1 1 100%;margin:0;display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 10px;font:700 14px/1.3 var(--f2);color:var(--c87-mut)}
#sheet.talk .panel.c87 #dbody.c87g>.rowbtns .ouvir b{font:800 14px/1.3 var(--f1);color:var(--c87-ink)}
#sheet.talk .panel.c87 #dbody.c87g>.rowbtns .btn.go{min-height:56px;font-size:19px;flex:1 1 220px;animation:c87right .5s both,c87pulse 1.8s 1s ease-in-out infinite}
@keyframes c87pulse{50%{transform:scale(1.025)}}
/* CX-3: estrelinhas, palavra a voar, pessoa a pular */
.c87-st{position:absolute;left:50%;top:50%;font-style:normal;font-size:16px;color:#FFC400;pointer-events:none;z-index:6;opacity:0;animation:c87st .9s var(--dl,0ms) ease-out both}
@keyframes c87st{0%{transform:translate(-50%,-50%) scale(.4);opacity:1}100%{transform:translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) scale(1.3);opacity:0}}
.c87-fly{position:fixed;z-index:99999;font-size:30px;pointer-events:none;transform:translate(-50%,-50%);animation:c87fly 1s cubic-bezier(.5,0,.8,.5) both}
@keyframes c87fly{0%{transform:translate(-50%,-50%) scale(1);opacity:1}100%{transform:translate(calc(-50% + var(--tx)),calc(-50% + var(--ty))) scale(.4);opacity:.2}}
.c87-av.pula{animation:c87pula .6s ease-out}
@keyframes c87pula{30%{transform:translateY(-12px) scale(1.06)}60%{transform:translateY(0)}80%{transform:translateY(-4px)}}
.c87-av[data-expr=surpreso]{animation:c87sur .5s ease-out}
.c87-av[data-expr=triste]{animation:c87sad .7s ease-out}
@keyframes c87sur{30%{transform:scale(1.12)}}
@keyframes c87sad{40%{transform:translateY(3px) scale(.96)}}
/* CX-7: fim da conversa */
#dbody .result .okline{margin:0 0 4px;text-align:center}
#dbody .result .pista{display:flex;align-items:center;gap:12px;margin:12px auto 4px;max-width:420px;padding:10px 14px;border-radius:18px;background:#EAF7F4;border:2px solid var(--c87-teal,#19B5A5);text-align:left}
#dbody .result .pista .pista-av{--s:64px;flex:none;width:64px;height:64px;border-radius:50%;overflow:hidden;background:#FBF7FF;border:3px solid #fff;box-shadow:0 3px 0 #D7CBEE}
#dbody .result .pista .pista-av img,#dbody .result .pista .pista-av svg{width:100%;height:100%;object-fit:cover}
#dbody .result .pista p{margin:0;font:700 17px/1.3 var(--f1);color:var(--c87-ink,#2B1B3D)}
#dbody .result .pista small{display:block;font:700 13px var(--f2);color:var(--c87-mut,#7C6C97)}
#dbody .result .outro{display:block;margin:10px auto 0;min-height:48px}
/* CX-6: a caixa com a cor do prédio — toldo em riscas no topo, anel e botões no mesmo tom (texto sempre tinta escura sobre vidro claro; só o botão leva texto claro, ≥ 4,5:1 verificado por testes/caixa_contraste.js) */
#sheet.talk .panel.c87[data-tema]:not([data-tema=""]){--c87-pink:var(--t1);padding-top:20px}
#sheet.talk .panel.c87[data-tema]:not([data-tema=""])::before{content:"";position:absolute;left:0;right:0;top:0;height:10px;background:repeating-linear-gradient(90deg,var(--t1) 0 16px,var(--t3) 16px 32px);image-rendering:pixelated;z-index:4;box-shadow:0 2px 0 rgba(43,27,61,.18)}
#sheet.talk .panel.c87[data-tema]:not([data-tema=""]) #dbody.c87g>.rowbtns .btn.go,#sheet.talk .panel.c87[data-tema]:not([data-tema=""]) #dbody.c87g>.rowbtns .micbtn{background:var(--t1);color:var(--tx);border-color:var(--t2);box-shadow:0 4px 0 var(--t2)}
#sheet.talk .panel.c87[data-tema]:not([data-tema=""]) #dbody.c87g .c87-ring{border-color:var(--t1)}
#sheet.talk .panel.c87[data-tema]:not([data-tema=""]) #dbody.c87g>.bubble{border-color:var(--t3)}
.panel.c87[data-tema=fogo]{--t1:#B3261E;--t2:#7A1712;--t3:#F2A900;--tx:#fff}
.panel.c87[data-tema=casa]{--t1:#8A4B14;--t2:#5C3009;--t3:#E8B77A;--tx:#fff}
.panel.c87[data-tema=torre]{--t1:#4B3A9C;--t2:#2F2469;--t3:#B7A9F0;--tx:#fff}
.panel.c87[data-tema=banca_negocios]{--t1:#1F5A8B;--t2:#133A5C;--t3:#9CC3E6;--tx:#fff}
.panel.c87[data-tema=servico_publico]{--t1:#1F5FA8;--t2:#143E70;--t3:#F0C419;--tx:#fff}
.panel.c87[data-tema=saude]{--t1:#0B7A6B;--t2:#065046;--t3:#9BE0D3;--tx:#fff}
.panel.c87[data-tema=comercio_alimentar]{--t1:#B0386A;--t2:#782347;--t3:#F7B5CE;--tx:#fff}
.panel.c87[data-tema=comercio_geral]{--t1:#9C3D75;--t2:#6A2650;--t3:#F0B4DA;--tx:#fff}
.panel.c87[data-tema=restauracao]{--t1:#A8501C;--t2:#70330F;--t3:#F4BE8A;--tx:#fff}
.panel.c87[data-tema=cultura]{--t1:#6B3FA0;--t2:#47276F;--t3:#D1B8F0;--tx:#fff}
.panel.c87[data-tema=mar]{--t1:#0E6F8E;--t2:#094A60;--t3:#9CDDF0;--tx:#fff}
.panel.c87[data-tema=ensino]{--t1:#3D5A99;--t2:#273A66;--t3:#B5C7F0;--tx:#fff}
.panel.c87[data-tema=religiao]{--t1:#7A5A12;--t2:#503A08;--t3:#EBD392;--tx:#fff}
.panel.c87[data-tema=animais]{--t1:#5F7A1B;--t2:#3E5110;--t3:#CFE48E;--tx:#fff}
.panel.c87[data-tema=desporto_parque]{--t1:#2E7D32;--t2:#1D5220;--t3:#A8E0AB;--tx:#fff}
.panel.c87[data-tema=noite_diversao]{--t1:#5E2B97;--t2:#3E1B66;--t3:#C9A8F0;--tx:#fff}
.panel.c87[data-tema=transporte_auto]{--t1:#46525E;--t2:#2D353D;--t3:#B7C3CF;--tx:#fff}
.panel.c87[data-tema=turismo_alojamento]{--t1:#8B4A6B;--t2:#5C2F46;--t3:#E6B8D0;--tx:#fff}
.panel.c87[data-tema=cuidado_pessoal]{--t1:#A63D6F;--t2:#702549;--t3:#F2B6D0;--tx:#fff}
/* CX-10: letra, contraste e menos movimento (Definições → Tela e leitura) */
/* A+ / A++: a letra do enunciado e das respostas cresce (zoom só nesses blocos); o painel rola, nada corta */
html[data-letra87="1"] #sheet.talk .panel.c87 #dbody.c87g .bubble .en,html[data-letra87="1"] #sheet.talk .panel.c87 #dbody.c87g .opt>span:first-of-type,html[data-letra87="1"] #sheet.talk .panel.c87 #dbody.c87g>.fb{zoom:1.15}
html[data-letra87="2"] #sheet.talk .panel.c87 #dbody.c87g .bubble .en,html[data-letra87="2"] #sheet.talk .panel.c87 #dbody.c87g .opt>span:first-of-type,html[data-letra87="2"] #sheet.talk .panel.c87 #dbody.c87g>.fb{zoom:1.3}
html[data-contraste87="1"] #sheet.talk .panel.dlg.c87{background:#fff;border-color:#000;-webkit-backdrop-filter:none;backdrop-filter:none}
html[data-contraste87="1"] #sheet.talk .panel.c87 #dbody.c87g .bubble{border-color:#000;background:#fff}
html[data-contraste87="1"] #sheet.talk .panel.c87 #dbody.c87g .opt{border-color:#000;color:#000}
html[data-contraste87="1"] #sheet.talk .panel.c87 #dbody.c87g .who small,html[data-contraste87="1"] #sheet.talk .panel.c87 #dbody.c87g>.ptline,html[data-contraste87="1"] .c87-mename small{color:#1a1a1a;background:#e9e9e9}
html[data-quieto87="1"] #sheet.talk .panel.dlg.c87,html[data-quieto87="1"] #sheet.talk .panel.c87 *,html[data-quieto87="1"] .c87-av,html[data-quieto87="1"] .c87-st,html[data-quieto87="1"] .c87-fly{animation:none!important;transition:none!important}
html[data-quieto87="1"] .c87-st,html[data-quieto87="1"] .c87-fly{display:none!important}

/* ---- V8.9.20 · CX-9: deitado / ecrã largo sem buraco nem sobreposição. A coluna da esquerda (.c87-col) tem quem fala e o meu retrato; a última linha da grelha (1fr) absorve a altura extra. ---- */
@media (min-width:560px){
  #sheet.talk .panel.dlg.c87 #dbody.c87g{grid-template-areas:"col bubble" "col pt" "col opts" "col fb" "col rb";grid-template-rows:repeat(5,max-content);min-height:310px}
  #sheet.talk .panel.c87 #dbody.c87g>.c87-col{grid-area:col;display:flex;flex-direction:column;align-items:center;gap:10px;position:sticky;top:0;align-self:start;min-width:0;height:0;overflow:visible}   /* altura 0: a coluna não estica as linhas da grelha (era o «buraco»); #dbody tem uma altura mínima que a acomoda */
  #sheet.talk .panel.c87 #dbody.c87g>.c87-col>.who{grid-area:auto!important;display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;margin:0;position:static;width:100%}
  #sheet.talk .panel.c87 #dbody.c87g>.c87-col>.who>div:not(.avatar):not(.dots){flex:none;width:100%}
  #sheet.talk .panel.c87 #dbody.c87g>.c87-col>.who .dots{justify-content:center}
  #sheet.talk .panel.c87 #dbody.c87g>.c87-col>.who b{font-size:18px}
  #sheet.talk .panel.c87 #dbody.c87g>.c87-col>.who small{font-size:12px}
  #sheet.talk .panel.c87 #dbody.c87g>.c87-col>.c87-me{grid-area:auto!important;display:flex;flex-direction:column;align-items:center;text-align:center;gap:4px;margin:0;position:static!important;align-self:center!important}
  #sheet.talk .panel.c87 #dbody.c87g>.rowbtns{align-self:end}
}
@media (orientation:landscape) and (max-height:560px){
  #sheet.talk .panel.dlg.c87 #dbody.c87g{min-height:258px}
  #sheet.talk .panel.c87 #dbody.c87g>.c87-col{gap:6px}
  #sheet.talk .panel.c87 #dbody.c87g>.c87-col>.who b{font-size:15.5px}
  #sheet.talk .panel.c87 #dbody.c87g>.c87-col>.who small{font-size:11px;padding:1px 8px}
  #sheet.talk .panel.c87 #dbody.c87g>.c87-col>.who .dots i{width:16px}
  #sheet.talk .panel.c87 #dbody.c87g>.rowbtns .ouvir{flex-wrap:nowrap;font-size:12.5px}
  #sheet.talk .panel.c87 #dbody.c87g>.rowbtns .ouvir b{font-size:12.5px;white-space:nowrap}
  #sheet.talk .panel.c87 #dbody.c87g>.rowbtns .btn.go{min-height:48px;font-size:17px}
  #sheet.talk .panel.c87 #dbody.c87g>.bubble>.vozprov{font-size:10.5px;padding:3px 8px}
}
/* o selo «voz provisória» fica na borda de cima do balão, à direita (não tapa o texto em nenhum formato) */
#sheet.talk .panel.c87 #dbody.c87g>.bubble>.vozprov{left:auto!important;right:14px;bottom:auto!important;top:-11px}
#sheet.talk .panel.c87 #dbody.c87g>.rowbtns .ouvir{margin-top:2px}
@media (max-width:420px){#sheet.talk .panel.c87 #dbody .result h2{padding:0 46px;font-size:clamp(22px,7vw,28px)}}
/* V8.9.20 · a fala da pessoa fica SEMPRE inteira à vista (deitado, Fold e normal); quem rola são as respostas e o rodapé */
#sheet.talk .panel.c87 #dbody.c87g>.bubble{position:sticky!important;top:12px;z-index:4;box-shadow:0 -12px 0 var(--c87-glass,#fffaf3),0 3px 0 rgba(120,90,160,.18)}
#sheet.talk .panel.c87 #dbody.c87g>.bubble>.vozprov{top:auto!important;bottom:-10px!important;left:auto!important;right:16px!important;z-index:5}
/* V8.9.20 · nomes compridos (Comandante Vasco) só quebram nos espaços; o selo «voz provisória» tem o seu espaço debaixo da fala */
#sheet.talk .panel.c87 #dbody.c87g .who b,#sheet.talk .panel.c87 #dbody.c87g .who small{overflow-wrap:normal!important;word-break:normal!important;hyphens:none!important}
#sheet.talk .panel.c87 #dbody.c87g>.bubble{margin-bottom:12px}

/* V8.9.34: Galaxy Fold fechado (≤ 320 px): botões ainda mais pequenos, o texto da opção nunca é empurrado para fora */
@media (max-width:330px){#sheet.talk .panel.c87 #dbody.c87g .opt{padding:6px 8px;gap:6px}#sheet.talk .panel.c87 #dbody.c87g .opt .sp{gap:3px}#sheet.talk .panel.c87 #dbody.c87g .opt .sp1{width:28px;height:28px;font-size:14px}}

/* ================= V8.9.40 (Equipa D) · REPAGINAÇÃO: uma só linguagem para todas as caixas de conversa (MC2, aula, encontro guiado, banco, Sadie, Torre) =================
   Só aparência. Vidro claro com luz, cantos grandes, retratos com anel da cor do prédio, balão limpo, respostas em cartões, progresso fino.
   Nada de lógica: os mesmos nós e as mesmas grelhas de antes. Mobile first (393×851, 844×390, Fold 280×653 / 884×1104). */
#sheet.talk .panel.dlg.c87{
  --k87-ink:#2B1B3D;--k87-acc:var(--t1,#FF5E8A);--k87-ring:var(--t3,#E3D6F7);
  background:linear-gradient(165deg,rgba(255,255,255,.97) 0%,rgba(252,247,255,.95) 55%,rgba(246,239,255,.93) 100%);
  -webkit-backdrop-filter:blur(16px) saturate(1.3);backdrop-filter:blur(16px) saturate(1.3);
  border:1.5px solid rgba(255,255,255,.95);border-radius:30px;
  box-shadow:0 22px 60px rgba(25,12,50,.45),0 2px 0 rgba(255,255,255,.9) inset,0 0 0 1px rgba(43,27,61,.07)}
/* toldo: faixa fina que acompanha a cor do prédio (nos sem tema, rosa→roxo da marca) */
#sheet.talk .panel.c87::before{content:"";position:absolute;left:0;right:0;top:0;height:6px;z-index:4;image-rendering:auto;
  background:linear-gradient(90deg,var(--t1,#FF5E8A),var(--t3,#B58CFF) 50%,var(--t1,#FF5E8A));box-shadow:none}
#sheet.talk .panel.c87[data-tema]:not([data-tema=""]){padding-top:16px}
#sheet.talk .panel.c87[data-tema]:not([data-tema=""])::before{height:6px;background:linear-gradient(90deg,var(--t1),var(--t3) 50%,var(--t1));box-shadow:none}
#sheet.talk .panel.dlg.c87 .xbtn{background:rgba(255,255,255,.9);border:1.5px solid rgba(43,27,61,.1);color:var(--c87-ink);box-shadow:0 4px 14px rgba(43,27,61,.18);transition:transform .15s}
#sheet.talk .panel.dlg.c87 .xbtn:active{transform:scale(.9)}

/* retratos: anel da cor do prédio + luz suave por trás */
.c87-av{background:radial-gradient(circle at 50% 30%,#fff 0,#F8F2FF 60%,#EADFFB 100%)!important;border:3px solid #fff!important;
  box-shadow:0 0 0 3px var(--k87-ring,#E3D6F7),0 10px 22px rgba(43,27,61,.28)!important}
.c87-av img.c87-rt{transition:opacity .18s}
.c87-badge{right:-4px;top:-4px;width:24px;height:24px;display:flex;align-items:center;justify-content:center;font-size:14px;background:#fff;border-radius:50%;box-shadow:0 2px 6px rgba(43,27,61,.3)}
.c87-ring{border-color:var(--k87-acc,#FF5E8A)}

/* nome + papel: o papel é uma etiqueta que quebra linha e nunca sai da caixa */
#sheet.talk .panel.c87 #dbody.c87g .who b{font:800 19px/1.15 var(--f1);letter-spacing:-.01em;color:var(--k87-ink)}
#sheet.talk .panel.c87 #dbody.c87g .who small{background:linear-gradient(180deg,#F5EFFF,#EDE4FB);color:#5E4C85;border:1px solid rgba(94,76,133,.14);
  white-space:normal;overflow-wrap:break-word;word-break:normal;max-width:100%;font:800 12px/1.3 var(--f1);padding:3px 10px;border-radius:12px}
/* progresso: pílulas finas */
#sheet.talk .panel.c87 #dbody.c87g .who .dots.pills{gap:4px}
#sheet.talk .panel.c87 #dbody.c87g .who .dots.pills i{width:20px;height:6px;border-radius:6px;background:#E6DDF5;box-shadow:none;transform:none}
#sheet.talk .panel.c87 #dbody.c87g .who .dots.pills i.done{background:var(--t1,var(--c87-teal))}
#sheet.talk .panel.c87 #dbody.c87g .who .dots.pills i.on{background:var(--k87-acc);width:28px;box-shadow:0 0 0 3px rgba(255,255,255,.9),0 0 0 4px rgba(43,27,61,.12);transform:none}

/* balão da fala */
#sheet.talk .panel.c87 #dbody.c87g>.bubble{background:#fff;border:1.5px solid rgba(43,27,61,.07);border-radius:22px;
  box-shadow:0 8px 24px rgba(43,27,61,.12),0 0 0 4px var(--c87-glass,#fffaf3);position:sticky}
#sheet.talk .panel.c87 #dbody.c87g>.bubble::before{display:none}
#sheet.talk .panel.c87 #dbody.c87g>.bubble::after{content:"";position:absolute;left:26px;top:-7px;width:14px;height:14px;border:0;background:#fff;
  transform:rotate(45deg);border-radius:3px 0 0 0;border-left:1.5px solid rgba(43,27,61,.07);border-top:1.5px solid rgba(43,27,61,.07)}
@media (min-width:560px),(orientation:landscape) and (max-height:560px){
  #sheet.talk .panel.c87 #dbody.c87g>.bubble::after{left:-7px;top:28px;border:0;border-left:1.5px solid rgba(43,27,61,.07);border-bottom:1.5px solid rgba(43,27,61,.07);border-top:0;border-radius:0 0 0 3px}
}
#sheet.talk .panel.c87 #dbody.c87g>.bubble .en{color:var(--k87-ink);font-weight:700}
#sheet.talk .panel.c87 #dbody.c87g>.bubble>.say,#sheet.talk .panel.c87 #dbody.c87g>.bubble>.slow,#sheet.talk .panel.c87 #dbody.c87g>.bubble>.h80-chip,#sheet.talk .panel.c87 #dbody.c87g>.bubble>button{box-shadow:0 2px 8px rgba(43,27,61,.18)}
#sheet.talk .panel.c87 #dbody.c87g>.bubble>.say{background:linear-gradient(180deg,#FFD23F,#FFB300);border:0}

/* tradução (linha pt-BR) */
#sheet.talk .panel.c87 #dbody.c87g>.ptline .ptl{display:block;border-radius:14px;background:linear-gradient(180deg,#EEF5FF,#E4EEFF);border:1px solid rgba(40,90,170,.12)}

/* o meu retrato + nome */
.c87-mename b{color:var(--k87-ink,#2B1B3D)}
.c87-mename small{color:#8A7BA6}

/* respostas: cartões com luz, sombra suave e feedback claro */
#sheet.talk .panel.c87 #dbody.c87g .opt{background:linear-gradient(180deg,#fff,#FBF8FF);border:1.5px solid #E7DEF6;border-radius:18px;
  box-shadow:0 3px 0 #DDD1F2,0 8px 18px rgba(43,27,61,.07);color:var(--k87-ink)}
#sheet.talk .panel.c87 #dbody.c87g .opt:not(.right):not(.wrong):hover{border-color:var(--k87-acc);box-shadow:0 3px 0 var(--k87-ring),0 10px 22px rgba(43,27,61,.12)}
#sheet.talk .panel.c87 #dbody.c87g .opt:active:not(.right):not(.wrong){transform:translateY(2px);box-shadow:0 1px 0 #DDD1F2}
#sheet.talk .panel.c87 #dbody.c87g .opt.right{background:linear-gradient(180deg,#E4FBF0,#CFF5E4);border:1.5px solid #19B58F;box-shadow:0 3px 0 #8ADCC3,0 0 0 4px rgba(25,181,143,.2)}
#sheet.talk .panel.c87 #dbody.c87g .opt.wrong{background:linear-gradient(180deg,#FFF0F2,#FFE0E5);border:1.5px solid #EE6A7C;box-shadow:0 3px 0 #F2B0BB}
#sheet.talk .panel.c87 #dbody.c87g .opt .sp1{background:#F1EAFB;box-shadow:inset 0 0 0 1px rgba(94,76,133,.1)}
#sheet.talk .panel.c87 #dbody.c87g .opt .sp2{background:#E1F6F1}

/* feedback e botões */
#sheet.talk .panel.c87 #dbody.c87g>.fb.ok{background:linear-gradient(180deg,#E4FBF0,#D6F6E8);border:1px solid rgba(25,181,143,.4)}
#sheet.talk .panel.c87 #dbody.c87g>.fb.no{background:linear-gradient(180deg,#FFF3F5,#FFE6EA);border:1px solid rgba(238,106,124,.4)}
#sheet.talk .panel.c87 #dbody.c87g>.rowbtns .hintbtn{background:linear-gradient(180deg,#fff,#F6F0FF);border:1.5px solid #E1D6F4;box-shadow:0 3px 0 #DDD1F2;color:#5E4C85}
#sheet.talk .panel.c87 #dbody.c87g>.rowbtns .btn.go{background:linear-gradient(180deg,var(--k87-acc),var(--t2,#E03A6B));color:var(--tx,#fff);border:0;box-shadow:0 4px 0 rgba(0,0,0,.2),0 10px 22px rgba(43,27,61,.25)}

/* entradas curtas e suaves */
@keyframes k87in{from{transform:translateY(26px) scale(.97);opacity:0}to{transform:none;opacity:1}}
#sheet.talk .panel.dlg.c87{animation:k87in .3s cubic-bezier(.2,.9,.3,1.05) both}
@keyframes k87in2{from{transform:translateX(34px);opacity:0}to{transform:none;opacity:1}}
@media (orientation:landscape) and (max-height:560px){#sheet.talk .panel.dlg.c87{animation-name:k87in2}}
/* troca de fala: o balão e as respostas entram de novo a cada passo */
#sheet.talk .panel.c87 #dbody.c87g>.bubble{animation:c87bub .28s both}

/* ===== quem fala em ecrã estreito (iPhone em pé, Fold fechado): retrato | nome+papel, e o progresso por baixo, nunca por cima do papel ===== */
@media (max-width:559px){
  #sheet.talk .panel.c87 #dbody.c87g>.who{display:grid!important;grid-template-columns:var(--c87-s) minmax(0,1fr);grid-template-areas:"av txt" "av dots";column-gap:12px;row-gap:5px;align-items:center;margin:0 54px 10px 0}
  #sheet.talk .panel.c87 #dbody.c87g>.who>.avatar{grid-area:av}
  #sheet.talk .panel.c87 #dbody.c87g>.who>div:not(.avatar):not(.dots){grid-area:txt;min-width:0}
  #sheet.talk .panel.c87 #dbody.c87g>.who>.dots{grid-area:dots;justify-self:start;flex-wrap:wrap;max-width:100%}
}
@media (max-width:330px){
  #sheet.talk .panel.c87 #dbody.c87g>.who{margin-right:48px;column-gap:8px}
  #sheet.talk .panel.c87 #dbody.c87g .who b{font-size:16px}
  #sheet.talk .panel.c87 #dbody.c87g .who small{font-size:11px;padding:2px 8px}
  #sheet.talk .panel.c87 #dbody.c87g .who .dots.pills i{width:14px}
  #sheet.talk .panel.c87 #dbody.c87g .who .dots.pills i.on{width:20px}
}
/* a expressão do retrato muda com um fundo de cor discreto (surpresa/tristeza) */
.c87-av[data-expr=surpreso]{box-shadow:0 0 0 3px #FFD23F,0 10px 22px rgba(43,27,61,.28)!important}
.c87-av[data-expr=triste]{box-shadow:0 0 0 3px #9DB7E8,0 10px 22px rgba(43,27,61,.28)!important}
.c87-av[data-expr=pensar]{box-shadow:0 0 0 3px #C9B6F2,0 10px 22px rgba(43,27,61,.28)!important}
html[data-contraste87="1"] #sheet.talk .panel.c87 #dbody.c87g .opt{background:#fff}
/* V8.9.40: o progresso nunca roda nem salta por cima do papel (depois de acertar aparecia torto sobre a etiqueta) */
#sheet.talk .panel.c87 #dbody.c87g .who .dots,#sheet.talk .panel.c87 #dbody.c87g .who .dots i{transform:none!important;animation:none!important;rotate:none!important}

/* V8.9.40 (Opus): nunca partir uma palavra a meio («Enchanté» saía «Enchanté / e» no Fold 280 px): só quebra entre palavras;
   uma palavra mais comprida do que a linha inteira ainda pode partir (break-word), mas nunca uma palavra normal */
#sheet.talk .panel.c87 #dbody.c87g .opt,#sheet.talk .panel.c87 #dbody.c87g>.bubble .en,#sheet.talk .panel.c87 #dbody.c87g .opt *{overflow-wrap:break-word!important;word-break:normal!important;hyphens:manual!important}
/* V8.9.40 (Opus): no Fold fechado (≤ 330 px) a coluna do texto ficava tão estreita que «Enchantée» partia a meio: o texto passa a ocupar a largura toda
   e o 🔊 / 🐢 descem para uma linha própria, encostados à direita */
@media (max-width:330px){
  #sheet.talk .panel.c87 #dbody.c87g .opt{flex-wrap:wrap;row-gap:4px}
  #sheet.talk .panel.c87 #dbody.c87g .opt>span:first-child{flex:1 1 100%}
  #sheet.talk .panel.c87 #dbody.c87g .opt .sp{margin-left:auto}
}
/* MIS-QA-A11: no Fold fechado (280 px) o rodapé fixo da conversa (dica «Toque nas outras respostas» + «Continuar») chegava a 153 px de altura e tapava a última resposta (os 🔊/🐢 ficavam por baixo); mais compacto, para tapar menos */
@media (max-width:340px){
  #sheet.talk .panel.c87 #dbody.c87g>.rowbtns{gap:4px;margin-top:4px;padding-top:8px;background:linear-gradient(180deg,rgba(255,250,243,0),var(--c87-glass,#fffaf3) 10px)}   /* fundo opaco: o texto deixa de ler-se por cima da resposta de trás */
  #sheet.talk .panel.c87 #dbody.c87g>.rowbtns .ouvir{font-size:11.5px;line-height:1.2;gap:2px 6px}
  #sheet.talk .panel.c87 #dbody.c87g>.rowbtns .ouvir b{font-size:11.5px}
}
