/* chat.css — the standalone mobile flow, scoped to .chat-window.
   Generated from mobile/mobile.css by tools/scope-mobile-css.py.
   Do not hand-edit; edit mobile.css and re-run the script. */
.chat-window{
  --col:min(100%,480px);
  --wa-base:#efeae2;
  --wa-in:#ffffff;
  --wa-out:#d9fdd3;
  --wa-text:#111b21;
  --wa-muted:#667781;
  --wa-green:#00a884;
  --wa-dark:#0b141a;
  --wa-bar:#f0f2f5;
  --top-h:calc(92px + env(safe-area-inset-top));
  --input-h:calc(62px + env(safe-area-inset-bottom));
  --sig:#22e07a;
}.chat-window *{box-sizing:border-box}.chat-window [hidden]{display:none!important}.chat-window{
  margin:0;background:var(--wa-dark);color:var(--wa-text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;line-height:1.4;overflow-x:clip;
}.chat-window img{display:block;max-width:100%;height:auto}.chat-window p{margin:0}.chat-window button{font:inherit;color:inherit;background:none;border:0;cursor:pointer;-webkit-tap-highlight-color:transparent}.chat-window svg{fill:currentColor}.chat-window :focus-visible{outline:2px solid var(--wa-green);outline-offset:2px}.chat-window .wa{position:relative;width:var(--col);margin:0 auto;min-height:100svh;background:var(--wa-base);box-shadow:0 0 60px rgba(0,0,0,.55)}.chat-window .wa-top{position:fixed;top:0;left:50%;transform:translateX(-50%);width:var(--col);z-index:30;background:var(--wa-in);box-shadow:0 1px 0 rgba(0,0,0,.08);transition:opacity .4s ease,transform .4s ease}.chat-window .statusbar{display:flex;align-items:center;justify-content:space-between;height:calc(28px + env(safe-area-inset-top));padding:env(safe-area-inset-top) 16px 0;font-size:.74rem;font-weight:600;color:#0b141a}.chat-window .sb-right{display:flex;align-items:center;gap:5px}.chat-window .sb-right svg{height:11px;width:auto;color:#0b141a}.chat-window .wa-header{display:flex;align-items:center;gap:8px;height:64px;padding:0 6px 0 4px}.chat-window .hbtn{width:36px;height:36px;display:grid;place-items:center;color:#54656f;border-radius:50%}.chat-window .hbtn svg{width:22px;height:22px}.chat-window .back svg{width:24px;height:24px}.chat-window .avatar{width:40px;height:40px;border-radius:50%;overflow:hidden;background:#fff;border:1px solid rgba(11,20,26,.08);display:grid;place-items:center;flex:0 0 auto}.chat-window .avatar img{width:100%;height:100%;object-fit:cover;transform:scale(1.06)}.chat-window .who{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center}.chat-window .who strong,.chat-window .who em{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-window .who strong{font-size:1rem;font-weight:600;color:#111b21;line-height:1.15}.chat-window .who em{font-style:normal;font-size:.72rem;color:#667781}.chat-window .hdr-icons{display:flex;align-items:center}.chat-window .thread{
  position:relative;
  padding:calc(var(--top-h) + 8px) 12px calc(var(--input-h) + 18px);
  background:var(--wa-base) url("assets/wa-pattern.svg") repeat;
  background-size:220px 220px;
  display:flex;flex-direction:column;gap:10px;
}.chat-window .sys{align-self:center;max-width:92%;margin:2px 0;padding:8px 12px;border-radius:8px;background:#fdf4d5;color:#54656f;font-size:.76rem;text-align:center;box-shadow:0 1px 1px rgba(0,0,0,.06)}.chat-window .sys.small{max-width:none;background:#fff5c8;font-size:.72rem}.chat-window .sys span{color:#1976d2}.chat-window .date{align-self:center;margin:8px 0;padding:5px 12px;border-radius:7px;background:var(--wa-in);color:#54656f;font-size:.72rem;font-weight:500;box-shadow:0 1px 1px rgba(0,0,0,.08)}.chat-window .row{position:relative;display:flex;flex-direction:column}.chat-window .row.out{align-items:flex-end}.chat-window .row.in{align-items:flex-start}.chat-window .msg{
  position:relative;max-width:82%;width:fit-content;
  padding:7px 10px 8px;border-radius:9px;
  background:var(--wa-in);color:var(--wa-text);
  font-size:.93rem;line-height:1.42;overflow-wrap:anywhere;
  box-shadow:0 1px 1px rgba(0,0,0,.1);
}.chat-window .msg p + p{margin-top:5px}.chat-window .msg strong{font-weight:600}.chat-window .msg.out{background:var(--wa-out)}.chat-window .msg.in::after{content:"";position:absolute;left:-7px;bottom:0;width:0;height:0;border:7px solid transparent;border-left:0;border-right-color:var(--wa-in);border-bottom:0;border-top-width:7px}.chat-window .msg.out::after{content:"";position:absolute;right:-7px;bottom:0;width:0;height:0;border:7px solid transparent;border-right:0;border-left-color:var(--wa-out);border-bottom:0;border-top-width:7px}.chat-window .meta{float:right;display:inline-flex;align-items:center;gap:3px;margin:5px 0 -2px 10px;font-size:.66rem;color:#667781;white-space:nowrap}.chat-window .ticks{width:16px;height:11px;fill:none;stroke:#53bdeb;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}.chat-window .typing{display:none;position:relative;align-items:center;gap:4px;padding:13px 14px;border-radius:9px;background:var(--wa-in);box-shadow:0 1px 1px rgba(0,0,0,.1)}.chat-window.fx .thread > .row.waiting > .typing{display:inline-flex}.chat-window.fx .thread > .row:not(.arrived) > .msg{opacity:0;transform:translateY(20px)}.chat-window.fx .thread > .row.arrived > .msg{opacity:1;transform:none;transition:opacity .4s ease,transform .45s cubic-bezier(.2,.9,.3,1.35)}.chat-window .typing::after{content:"";position:absolute;left:-7px;bottom:0;width:0;height:0;border:7px solid transparent;border-left:0;border-right-color:var(--wa-in);border-bottom:0;border-top-width:7px}.chat-window .typing i{width:7px;height:7px;border-radius:50%;background:#9aa6ab;animation:dots 1.2s ease-in-out infinite}.chat-window .typing i:nth-child(2){animation-delay:.18s}.chat-window .typing i:nth-child(3){animation-delay:.36s}
@keyframes dots{0%,60%,100%{transform:translateY(0);opacity:.45}30%{transform:translateY(-4px);opacity:1}}.chat-window .quick{margin:9px -10px -8px;border-top:1px solid rgba(0,0,0,.08)}.chat-window .quick button{display:block;width:100%;min-height:46px;padding:0 14px;color:#027eb5;font-size:.9rem;font-weight:600;transition:background .2s ease}.chat-window .quick button:active{background:rgba(2,126,181,.09)}.chat-window .row.done .quick{display:none}.chat-window .row.pending{display:none}.chat-window .quiz{display:flex;flex-direction:column;gap:10px}.chat-window .quiz-card{width:min(88%,330px);padding:0;overflow:hidden}.chat-window .quiz-head{padding:11px 12px 0;color:#111b21}.chat-window .quiz-q{padding:5px 12px 12px;color:#111b21}.chat-window .opts{margin-top:0;border-top:1px solid rgba(0,0,0,.08)}.chat-window .opts button{display:block;width:100%;min-height:46px;padding:0 14px;border-bottom:1px solid rgba(0,0,0,.08);color:#027eb5;font-size:.88rem;font-weight:600;transition:background .18s ease,color .18s ease,opacity .18s ease}.chat-window .opts button:last-child{border-bottom:0}.chat-window .opts button:active{background:rgba(2,126,181,.1)}.chat-window .opts button:disabled{cursor:default}.chat-window .opts button.correct{color:#1faa59;background:rgba(31,170,89,.08)}.chat-window .opts button.wrong{color:#d64545;background:rgba(214,69,69,.07)}.chat-window .opts button.dim{opacity:.4}.chat-window .quiz-card .meta{position:absolute;right:10px;bottom:6px}.chat-window .quiz-card{position:relative;padding-bottom:22px}.chat-window.js .thread:not(.unlocked) [data-gate]{display:none}.chat-window .gate-hint{display:none;align-self:center;align-items:center;gap:9px;margin:10px 0 0;padding:7px 13px;border-radius:7px;background:#fff;box-shadow:0 1px 1px rgba(0,0,0,.08);font-size:.74rem;color:#667781}.chat-window.js .thread:not(.unlocked) .gate-hint{display:flex}.chat-window .gate-hint strong{color:#111b21}.chat-window .gate-hint .tap{position:relative;flex:0 0 auto;width:18px;height:18px;border-radius:50%;border:2px solid #027eb5}.chat-window .gate-hint .tap::after{content:"";position:absolute;left:50%;top:50%;width:5px;height:5px;margin:-2.5px 0 0 -2.5px;border-radius:50%;background:#027eb5;animation:tapdot 1.5s ease-out infinite}
@keyframes tapdot{0%{transform:scale(.6);opacity:1}70%{transform:scale(2.8);opacity:0}100%{opacity:0}}.chat-window.js .thread:not(.unlocked) .quick button{animation:gatepulse 1.9s ease-in-out infinite}
@keyframes gatepulse{0%,100%{box-shadow:0 0 0 0 rgba(2,126,181,.32)}55%{box-shadow:0 0 0 9px rgba(2,126,181,0)}}.chat-window .row.done .gate-hint{display:none!important}.chat-window.js .thread:not(.sent) [data-sos-gate]{display:none}.chat-window .mic-hint{display:none;align-self:center;align-items:center;gap:9px;margin:8px 0;padding:9px 14px;border-radius:999px;background:#fff;color:#54656f;font-size:.78rem;box-shadow:0 1px 1px rgba(0,0,0,.08)}.chat-window .mic-hint svg{flex:0 0 auto;width:16px;height:16px;color:#027eb5}.chat-window .mic-hint strong{color:#111b21}.chat-window.js .thread.mic-ready:not(.sent) .mic-hint{display:flex}.chat-window.js .thread.mic-ready:not(.sent) .mic{animation:micpulse 2s ease-in-out infinite}
@keyframes micpulse{0%,100%{box-shadow:0 0 0 0 rgba(0,168,132,.5)}55%{box-shadow:0 0 0 13px rgba(0,168,132,0)}}.chat-window .mic.recording{background:#e5484d;animation:none;box-shadow:0 0 0 7px rgba(229,72,77,.22)}.chat-window.recording .wa-input{background:#ffeceb}.chat-window.recording .field{color:#b1525a}.chat-window .msg.in .opts{margin:9px -10px -8px;border-top:1px solid rgba(0,0,0,.08)}.chat-window .call-log{align-self:center;margin:6px 0;padding:5px 12px;border-radius:7px;background:#fff;color:#54656f;font-size:.74rem;box-shadow:0 1px 1px rgba(0,0,0,.08)}.chat-window .msg.voice{display:grid;grid-template-columns:32px 1fr;grid-template-areas:"play wave" "play meta";align-items:center;column-gap:10px;row-gap:0;min-width:198px;max-width:84%;padding:8px 10px 5px;text-align:left}.chat-window .vplay{grid-area:play;position:relative;width:32px;height:32px;border-radius:50%;background:#54656f;transition:background .2s ease}.chat-window .vplay::after{content:"";position:absolute;left:54%;top:50%;width:0;height:0;transform:translate(-50%,-50%);border-left:10px solid #fff;border-top:6.5px solid transparent;border-bottom:6.5px solid transparent}.chat-window .playing .vplay::after{width:8px;height:11px;border:0;border-radius:1.5px;background:#fff}.chat-window .wrow{grid-area:wave;display:flex;align-items:center;gap:7px;min-width:0}.chat-window .wave{flex:1;display:flex;align-items:center;justify-content:space-between;height:24px;min-width:0}.chat-window .wave i{width:2px;border-radius:1px;background:#8696a0;transform-origin:50% 50%}.chat-window .playing .wave i{animation:eq .9s ease-in-out infinite;background:#54656f}.chat-window .playing .wave i:nth-child(3n){animation-delay:.15s}.chat-window .playing .wave i:nth-child(4n){animation-delay:.3s}.chat-window .playing .wave i:nth-child(5n){animation-delay:.45s}
@keyframes eq{50%{transform:scaleY(.35)}}.chat-window .vlen{flex:0 0 auto;font-size:.7rem;color:#667781;line-height:1}.chat-window .vmeta{grid-area:meta;display:flex;align-items:center;justify-content:flex-end;gap:5px;font-size:.66rem;color:#667781;line-height:1}.chat-window .vmeta .ticks{width:15px;height:10px}.chat-window .call{position:fixed;inset:0;left:50%;transform:translateX(-50%);width:var(--col);z-index:80;display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding:clamp(48px,12vh,120px) clamp(18px,7vw,48px) calc(clamp(32px,7vh,72px) + env(safe-area-inset-bottom));text-align:center;background:linear-gradient(180deg,#0b141a 0%,#101d26 55%,#0b141a 100%);color:#fff;overflow:hidden}.chat-window .call-glow{position:absolute;inset:0;background:radial-gradient(62% 38% at 50% 28%,rgba(37,211,102,.2),transparent 72%);pointer-events:none}.chat-window .call-body{position:relative;display:flex;flex-direction:column;align-items:center;gap:10px;margin:auto 0}.chat-window .call-avatar{width:clamp(82px,22vw,112px);height:clamp(82px,22vw,112px);border-radius:50%;display:grid;place-items:center;background:linear-gradient(160deg,#4a3520,#1d1509);border:2px solid rgba(255,255,255,.18);font-size:clamp(2rem,6vw,2.5rem);font-weight:800;color:#ffd9a8;margin-bottom:6px}.chat-window .call.ringing .call-avatar{animation:ringpulse 1.7s ease-out infinite}
@keyframes ringpulse{0%{box-shadow:0 0 0 0 rgba(37,211,102,.55)}100%{box-shadow:0 0 0 40px transparent}}.chat-window .call.connected .call-avatar{animation:none;box-shadow:0 0 0 6px rgba(37,211,102,.18)}.chat-window .call-name{font-size:clamp(1.35rem,6vw,1.6rem);font-weight:700;letter-spacing:-.01em}.chat-window .call-sub{color:rgba(255,255,255,.7);font-size:clamp(.86rem,4vw,.95rem)}.chat-window .call-timer{font-family:ui-monospace,Menlo,monospace;font-size:1rem;letter-spacing:.06em;color:rgba(255,255,255,.85)}.chat-window .call-controls{position:relative;width:100%}.chat-window .ring-actions,.chat-window .talk-actions{align-items:center;justify-content:center;display:flex}.chat-window .ring-actions{gap:clamp(64px,16vw,108px)}.chat-window .talk-actions{gap:34px}.chat-window .call.ringing .talk-actions,.chat-window .call.connected .ring-actions{display:none}.chat-window .cbtn{width:clamp(58px,17vw,76px);height:clamp(58px,17vw,76px);border-radius:50%;display:grid;place-items:center;color:#fff;box-shadow:0 12px 28px rgba(0,0,0,.45);transition:transform .15s ease}.chat-window .cbtn svg{width:clamp(26px,7vw,32px);height:clamp(26px,7vw,32px)}.chat-window .cbtn:active{transform:scale(.93)}.chat-window .cbtn.decline,.chat-window .cbtn.end{background:#e5484d}.chat-window .cbtn.accept{background:#25d366}.chat-window .cbtn.muted,.chat-window .cbtn.speaker{width:56px;height:56px;background:rgba(255,255,255,.14)}.chat-window .cbtn.muted svg,.chat-window .cbtn.speaker svg{width:24px;height:24px}.chat-window.in-call{overflow:hidden}.chat-window .wa-input{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:var(--col);z-index:30;display:flex;align-items:center;gap:8px;padding:8px 10px calc(8px + env(safe-area-inset-bottom));background:var(--wa-bar);transition:opacity .4s ease,transform .4s ease}.chat-window .field{flex:1;min-width:0;display:flex;align-items:center;gap:10px;height:44px;padding:0 14px;border-radius:22px;background:#fff;color:#8696a0;font-size:.92rem}.chat-window .field .emoji{flex:0 0 auto;width:24px;height:24px;color:#54656f}.chat-window .field .ph{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-window .wa-input .ic{width:26px;height:26px;color:#54656f;flex:0 0 auto}.chat-window .mic{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;background:var(--wa-green);color:#fff;flex:0 0 auto}.chat-window .mic svg{width:24px;height:24px}.chat-window.chat-over .wa-top{opacity:0;transform:translateX(-50%) translateY(-12px);pointer-events:none}.chat-window.chat-over .wa-input{opacity:0;transform:translateX(-50%) translateY(16px);pointer-events:none}.chat-window.fallback .msg{opacity:1!important;visibility:visible!important}.chat-window @media (max-width:400px){
  .wa-header{gap:6px}
  .hbtn{width:34px;height:34px}
  .msg{max-width:86%}
  .msg.voice{min-width:186px}
  .quiz-card{width:min(90%,320px)}
}
@media (max-width:340px){.chat-window{--top-h:calc(88px + env(safe-area-inset-top))}.chat-window .wa-header{height:60px;gap:4px}.chat-window .avatar{width:36px;height:36px}.chat-window .who strong{font-size:.95rem}.chat-window .hdr-icons .hbtn[aria-label="Video call"]{display:none}.chat-window .msg{font-size:.9rem;max-width:90%}.chat-window .msg.voice{min-width:168px;grid-template-columns:30px 1fr}.chat-window .vplay{width:30px;height:30px}.chat-window .quiz-card{width:96%}.chat-window .call{padding-left:18px;padding-right:18px}.chat-window .cbtn{width:58px;height:58px}.chat-window .ring-actions{gap:64px}}
@media (max-height:640px){.chat-window .call{padding-top:8vh;padding-bottom:5vh}.chat-window .call-avatar{width:84px;height:84px;font-size:2rem}}
@media (min-width:520px) and (min-height:760px){.chat-window .wa{border-left:1px solid rgba(255,255,255,.06);border-right:1px solid rgba(255,255,255,.06)}}

@media (prefers-reduced-motion: reduce){.chat-window .typing i,.chat-window .playing .wave i{animation:none}}

/* ── imprinted into the website: fill the frame instead of the viewport ── */
.chat-window{position:relative}
.chat-window .wa{display:flex;flex-direction:column;width:var(--col);height:100%;min-height:0;margin:0 auto;box-shadow:none}
.chat-window .thread{flex:1;min-height:0;overflow-y:auto;overflow-anchor:none;scroll-behavior:smooth;scrollbar-width:none}
.chat-window .thread::-webkit-scrollbar{display:none}
.chat-window .wa-top{position:absolute;top:0;left:0;width:100%;transform:none}
.chat-window .wa-input{position:absolute;bottom:0;left:0;width:100%;transform:none}
.chat-window .call{position:fixed;inset:0;left:0;width:100%;transform:none}
/* merged: drop the frame's transform so the call covers the whole viewport
   (it also means the identity transform stops creating a containing block) */
.chat-full .chat-window{transform:none}
.chat-window .quiz-card{margin-top:0}
/* nothing lands early, and an unlanded item holds no space — so the newest
   message always sits at the bottom and the older ones ride up past it */
.chat-window.fx .thread>.row:not(.arrived):not(.waiting),
.chat-window.fx .thread>.sys:not(.arrived),
.chat-window.fx .thread>.date:not(.arrived),
.chat-window.fx .thread>.quiz:not(.arrived),
.chat-window.fx .thread>.mic-hint:not(.arrived){display:none}
@keyframes bw-arrive{from{opacity:0;transform:translateY(14px) scale(.985)}to{opacity:1;transform:none}}
.chat-window.fx .thread>.row.arrived>.msg,
.chat-window.fx .thread>.sys.arrived,
.chat-window.fx .thread>.date.arrived,
.chat-window.fx .thread>.quiz.arrived,
.chat-window.fx .thread>.mic-hint.arrived{animation:bw-arrive .34s cubic-bezier(.2,.8,.3,1) both}
/* the newest message sits just above the input bar and older ones ride up */
.chat-window .thread>:first-child{margin-top:auto}
@media (prefers-reduced-motion: reduce){
  .chat-window .wa-top,.chat-window .wa-input{transition:none}
}
