/* Quiz MA em formato de conversa de WhatsApp (versão B do quiz-MA-chat). */
:root{--hdr:#008069;--bg:#efeae2;--in:#fff;--out:#d9fdd3;--text:#111b21;--meta:#667781;--tick:#53bdeb;--green:#00a884;--btn:#027eb5;--font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}
*{box-sizing:border-box}html,body{height:100%;margin:0}
body{background:#d1d7db;color:var(--text);font-family:var(--font);font-size:16px;-webkit-font-smoothing:antialiased}
button{font:inherit;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
button:focus-visible{outline:3px solid var(--green);outline-offset:2px}
svg:not(vturb-smartplayer svg){display:block;width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
[hidden],.icon-library{display:none!important}

.chat-shell{position:relative;display:flex;flex-direction:column;width:100%;height:100dvh;max-width:560px;margin:auto;overflow:hidden;
  background-color:var(--bg);
  background-image:radial-gradient(circle at 20% 30%,rgba(0,0,0,.035) 0 2px,transparent 3px),radial-gradient(circle at 70% 75%,rgba(0,0,0,.03) 0 3px,transparent 4px),radial-gradient(circle at 85% 20%,rgba(0,0,0,.025) 0 1.5px,transparent 2.5px);
  background-size:60px 60px,90px 90px,45px 45px}
.chat-header{display:flex;align-items:center;gap:8px;flex-shrink:0;padding:calc(10px + env(safe-area-inset-top)) 10px 10px 6px;background:var(--hdr);color:#fff;z-index:5}
.hdr-icon svg{width:24px;height:24px}
.avatar{display:inline-flex;flex-shrink:0;overflow:hidden;border-radius:50%;background:#cfd4d6}
.avatar img{width:100%;height:100%;object-fit:cover;object-position:center 18%}
.header-avatar{width:40px;height:40px}
.profile-copy{min-width:0;flex:1}
.profile-name{display:block;font-size:17px;font-weight:600;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.profile-status{display:block;font-size:13px;line-height:1.3;opacity:.85}
.hdr-icons{display:flex;gap:20px;padding-right:4px}.hdr-icons svg{width:22px;height:22px}

.conversation{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:none;padding:8px 14px 12px;scroll-behavior:smooth}
.conversation::-webkit-scrollbar{display:none}
.chip{display:table;margin:8px auto;padding:5px 12px;border-radius:8px;font-size:12.5px;line-height:1.4;text-align:center;box-shadow:0 1px .5px rgba(11,20,26,.13)}
.date-label{background:#fff;color:var(--meta);text-transform:uppercase}
.e2e{background:#ffeecd;color:#54656f;max-width:88%;margin-bottom:14px}
.e2e svg{display:inline-block!important;width:11px!important;height:11px!important;margin-right:4px;vertical-align:-1px}

.message-row{display:flex;margin-top:2px;animation:message-in .2s ease-out both}
.message-row.group-start{margin-top:10px}
.mini-avatar{display:none}
.sent{justify-content:flex-end}
.bubble{position:relative;font-size:15.5px;line-height:1.35;padding:6px 8px 8px 9px;max-width:85%;overflow-wrap:anywhere;white-space:pre-line;background:var(--in);border-radius:8px;box-shadow:0 1px .5px rgba(11,20,26,.13)}
.sent .bubble{background:var(--out)}
.group-start.received .bubble{border-top-left-radius:0}
.group-start.sent .bubble{border-top-right-radius:0}
.group-start.received .bubble::before,.group-start.sent .bubble::before{content:"";position:absolute;top:0;width:8px;height:13px}
.group-start.received .bubble::before{left:-8px;background:var(--in);clip-path:polygon(0 0,100% 0,100% 100%)}
.group-start.sent .bubble::before{right:-8px;background:var(--out);clip-path:polygon(0 0,100% 0,0 100%)}
.bubble strong{font-weight:700}
.bubble .hl-red{color:#d42a2a;font-weight:700}.bubble .hl-green{color:#0b8a3e;font-weight:700}
/* hora (e ticks) no canto, como no WhatsApp */
.meta{float:right;display:inline-flex;align-items:center;gap:3px;margin:8px 0 -5px 10px;font-size:11px;line-height:1;color:var(--meta);white-space:nowrap}
.ticks{width:16px;height:11px;color:#8696a0}.ticks.read{color:var(--tick)}
.media-message .meta,.card-message .meta{position:absolute;right:8px;bottom:6px;float:none;margin:0;color:#fff;text-shadow:0 0 3px rgba(0,0,0,.6)}
.card-message .meta{color:var(--meta);text-shadow:none}
.receipt{display:none}

.typing-row{display:flex;margin-top:8px}
.typing-bubble{display:flex;align-items:center;gap:4px;background:var(--in);border-radius:0 8px 8px 8px;padding:12px 14px;box-shadow:0 1px .5px rgba(11,20,26,.13)}
.typing-bubble span{width:7px;height:7px;border-radius:50%;background:#8696a0;animation:typing 1.15s infinite ease-in-out}
.typing-bubble span:nth-child(2){animation-delay:.16s}.typing-bubble span:nth-child(3){animation-delay:.32s}

/* botões de resposta rápida (WhatsApp Business) */
.choices{display:flex;flex-direction:column;align-items:stretch;gap:4px;padding:10px 0 2px;max-width:85%}
.choices:empty{display:none}
.choice-label{font-size:12px;color:var(--meta);margin:0 0 4px 4px}
.choice{display:flex;align-items:center;justify-content:center;gap:8px;min-height:42px;padding:9px 14px;border:0;border-radius:8px;background:#fff;color:var(--btn);font-size:15px;font-weight:500;line-height:1.3;text-align:center;box-shadow:0 1px .5px rgba(11,20,26,.13);animation:message-in .2s ease-out}
.choice.option{justify-content:flex-start;text-align:left;color:var(--text);font-weight:400}
.choice.option:not(:has(.emo)){justify-content:center;text-align:center;color:var(--btn);font-weight:500}
.choice .emo{font-size:19px;line-height:1;flex-shrink:0}
.choice:active{background:#f0f2f5}
.delayed{display:none}.delayed .choice+.choice{margin-top:4px}
.scroll-bottom{position:absolute;right:14px;bottom:76px;display:grid;place-items:center;width:40px;height:40px;border-radius:50%;border:0;background:#fff;color:#54656f;box-shadow:0 1px 3px rgba(11,20,26,.3);z-index:4}

.chat-footer{display:flex;align-items:center;gap:6px;padding:6px 6px calc(6px + env(safe-area-inset-bottom));flex-shrink:0;z-index:5}
.composer{flex:1;height:48px;display:flex;align-items:center;gap:14px;border-radius:26px;background:#fff;padding:0 14px;color:#8696a0;box-shadow:0 1px .5px rgba(11,20,26,.13)}
.composer-placeholder{flex:1;font-size:17px}
.mic-btn{display:grid;place-items:center;width:48px;height:48px;border-radius:50%;background:var(--green);color:#fff;flex-shrink:0}

/* nota de voz */
.audio-message{display:flex;align-items:center;gap:10px;width:290px;max-width:85%;padding:8px 10px 18px 8px!important}
.audio-avatar{position:relative;width:46px;height:46px;flex-shrink:0;order:-1}
.audio-avatar img{width:100%;height:100%;border-radius:50%;object-fit:cover;object-position:center 18%}
.audio-avatar::after{content:"";position:absolute;right:-3px;bottom:-2px;width:18px;height:18px;border-radius:50%;background:var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='9' y='3' width='6' height='11' rx='3' fill='white'/%3E%3Cpath d='M6 11a6 6 0 0 0 12 0M12 17v3' stroke='white' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/12px no-repeat}
.audio-play{display:grid;place-items:center;flex-shrink:0;width:30px;height:30px;border:0;background:none;color:#8696a0;padding:0}
.audio-play svg{width:26px;height:26px;fill:currentColor;stroke:none}
.audio-play .ico-pause{display:none}.audio-message.playing .ico-play{display:none}.audio-message.playing .ico-pause{display:block}
.audio-wave{display:flex;align-items:center;gap:2px;flex:1;height:28px;cursor:pointer}
.audio-wave i{flex:1;min-width:2px;border-radius:2px;background:#c3cbd0}.audio-wave i.on{background:var(--tick)}
.audio-time{position:absolute;left:94px;bottom:5px;font-size:11px;color:var(--meta);font-variant-numeric:tabular-nums}

/* foto e vídeo */
.media-message{padding:3px;width:280px;max-width:85%}
.media-message>img{display:block;width:100%;height:auto;border-radius:6px}
.video-message{width:290px;white-space:normal;line-height:normal}
.video-message vturb-smartplayer{border-radius:6px;overflow:hidden}
.video-done{padding:6px 4px;color:var(--meta);font-size:14px}

/* relatório e níveis (etapa 22) */
.card-message{width:290px;max-width:85%;padding:10px 10px 22px}
.report{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.report-box{background:#f7f8fa;border:1px solid #e9edef;border-radius:10px;padding:12px 8px;display:flex;flex-direction:column;gap:10px;align-items:center;justify-content:center}
.report-title{font-size:12px;font-weight:700;text-align:center;line-height:1.3}
.ring{width:100%;max-width:110px;aspect-ratio:1;border-radius:50%;padding:12px;background:#e9edef}
.ring-in{width:100%;height:100%;border-radius:50%;background:#f7f8fa;display:grid;place-items:center;font-size:26px;font-weight:700;letter-spacing:-.05em}
.report-right{display:flex;flex-direction:column;gap:8px}
.report-result{font-size:12px;font-weight:700;text-align:center}.report-result b{color:#d42a2a}
.report-img{flex:1;padding:8px 8px 0;justify-content:flex-end}.report-img img{width:100%;display:block}
.levels{display:grid;grid-template-columns:repeat(3,1fr)}
.level{display:flex;flex-direction:column;align-items:center;gap:10px;padding:6px 4px;text-align:center}
.level+.level{border-left:1px solid #e9edef}
.level-bar{width:30px;height:90px;border-radius:6px;background:#e9edef;overflow:hidden;display:flex;align-items:flex-end}
.level-fill{width:100%;height:0;background:linear-gradient(to top,#00a884,#25d366);color:#fff;font-size:8px;font-weight:700;text-align:center;padding-top:6px;transition:height 1.2s ease-out}
.level-title{font-size:12px;font-weight:700}.level-desc{font-size:10px;line-height:1.5;color:var(--meta)}

@keyframes typing{0%,60%,100%{transform:translateY(0);opacity:.55}30%{transform:translateY(-4px);opacity:1}}
@keyframes message-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
@media(min-width:650px){body{display:grid;place-items:center;padding:24px}.chat-shell{height:calc(100dvh - 48px);max-height:980px;border-radius:14px;box-shadow:0 20px 60px rgba(0,0,0,.25)}}
@media(max-width:360px){.hdr-icons{gap:14px}.bubble{font-size:15px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition:none!important}}
.audio-message .meta{position:absolute;right:8px;bottom:5px;float:none;margin:0}

/* modo cinema da VSL (chat.js cinema()): player fixo abaixo do cabeçalho, conversa e botão rolam embaixo */
.chat-shell.cinema .conversation{padding-top:calc(var(--stage-h) + 10px)}
.video-message.stage{position:fixed;top:var(--stage-top);left:var(--stage-left);width:var(--stage-w);height:var(--stage-h);z-index:4;max-width:none;
  margin:0;padding:0;border-radius:0;background:#000;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 8px rgba(0,0,0,.35)}
.video-message.stage::before,.video-message.stage .meta{display:none}
.video-message.stage vturb-smartplayer{border-radius:0;margin:0!important}
.message-row:has(.stage) .mini-avatar{visibility:hidden}
.message-row:has(.stage){min-height:0;height:0;margin:0}
