*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root{
  color-scheme:dark;
  --page:#0d111a;
  --header:#141b27;
  --header-soft:#222d3e;
  --chat:#0d111a;
  --incoming:#1b2433;
  --outgoing:#263c6b;
  --composer:#141b27;
  --field:#222d3e;
  --accent:#638bff;
  --accent-strong:#466de5;
  --green:#25d366;
  --danger:#ff6b6b;
  --text:#eef2f9;
  --muted:#a1aec2;
  --subtle:#98a8bf;
  --line:rgba(134,150,160,.16);
  --shadow:0 10px 36px rgba(0,0,0,.28);
  --app-height:100dvh;
  --app-top:0px;
}

html{
  width:100%;
  height:100%;
  overflow:hidden;
  background:var(--page);
}

body{
  position:fixed;
  inset:0;
  width:100%;
  height:100%;
  overflow:hidden;
  overscroll-behavior:none;
  background:var(--page);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  -webkit-text-size-adjust:100%;
  -webkit-tap-highlight-color:transparent;
}

/* Overscan keeps iOS and embedded webviews dark while their bars resize. */
body::before{
  content:"";
  position:fixed;
  inset:-160px;
  z-index:-2;
  background:var(--page);
  pointer-events:none;
}

button,input,textarea{font:inherit}
button{border:0;color:inherit;cursor:pointer}
button:disabled{cursor:default;opacity:.46}
input,textarea{
  color:inherit;
  font-size:16px;
  -webkit-user-select:text;
  user-select:text;
}

#app{
  position:fixed;
  top:0;
  left:50%;
  isolation:isolate;
  display:flex;
  flex-direction:column;
  width:min(100%,960px);
  height:var(--app-height);
  min-height:320px;
  overflow:hidden;
  transform:translate3d(-50%,var(--app-top),0);
  background:var(--chat);
  box-shadow:0 0 0 1px rgba(255,255,255,.035),0 24px 80px rgba(0,0,0,.35);
}

.scr{
  display:none;
  flex:1;
  min-height:0;
  overflow:hidden;
}
.scr.on{display:flex;animation:screenIn .24s ease both}

/* Login */
#ls{
  position:relative;
  align-items:center;
  justify-content:center;
  padding:calc(24px + env(safe-area-inset-top,0px)) 20px
    calc(24px + env(safe-area-inset-bottom,0px));
  background:
    radial-gradient(circle at 18% 12%,rgba(42,171,238,.16),transparent 33%),
    linear-gradient(180deg,#111b21,var(--page));
}

#ls::before{
  content:"";
  position:absolute;
  inset:0;
  opacity:.3;
  background-image:
    radial-gradient(circle at 16px 16px,rgba(255,255,255,.075) 1.2px,transparent 1.4px),
    radial-gradient(circle at 46px 46px,rgba(255,255,255,.045) 1px,transparent 1.2px);
  background-size:64px 64px;
  pointer-events:none;
}

.lcard{
  position:relative;
  width:min(380px,100%);
  padding:36px 32px 30px;
  border:1px solid var(--line);
  border-radius:22px;
  background:rgba(32,44,51,.94);
  box-shadow:0 20px 60px rgba(0,0,0,.34);
  display:flex;
  flex-direction:column;
  align-items:center;
  animation:cardIn .45s cubic-bezier(.2,.8,.2,1) both;
}

.lcard img{
  width:82px!important;
  height:82px!important;
  margin-bottom:20px;
  border-radius:50%!important;
  object-fit:cover;
  box-shadow:0 0 0 4px rgba(42,171,238,.12),0 12px 28px rgba(0,0,0,.28);
}

.ltit{
  margin-bottom:7px;
  color:#fff;
  font-size:25px;
  font-weight:700;
  letter-spacing:-.02em;
}

.lstatus{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-bottom:15px;
  color:#8bd7fa;
  font-size:12px;
  font-weight:600;
}
.lstatus::before{
  content:"";
  width:7px;
  height:7px;
  border-radius:50%;
  background:var(--green);
  box-shadow:0 0 0 4px rgba(37,211,102,.1);
}
.lstatus.offhours{color:#d4a85e}
.lstatus.offhours::before{background:#f59e0b;box-shadow:0 0 0 4px rgba(245,158,11,.1)}

.lsub{
  width:100%;
  max-width:300px;
  margin-bottom:24px;
  color:var(--muted);
  font-size:14px;
  line-height:1.5;
  text-align:center;
}
.lsub.offhours{
  padding:11px 13px;
  border:1px solid rgba(245,158,11,.24);
  border-radius:12px;
  background:rgba(245,158,11,.08);
  color:#f5c875;
  text-align:left;
}

.linp{
  width:100%;
  height:50px;
  margin-bottom:11px;
  padding:0 15px;
  border:1px solid transparent;
  border-radius:12px;
  outline:none;
  background:var(--field);
  transition:border-color .18s ease,box-shadow .18s ease,background .18s ease;
}
.linp:focus{
  border-color:rgba(42,171,238,.8);
  background:#30414b;
  box-shadow:0 0 0 3px rgba(42,171,238,.11);
}
.linp::placeholder,#ti::placeholder{color:var(--muted)}

.lbtn{
  position:relative;
  width:100%;
  min-height:50px;
  overflow:hidden;
  border-radius:12px;
  background:var(--accent-strong);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  font-size:15px;
  font-weight:700;
  transition:background .16s ease,transform .12s ease,box-shadow .16s ease;
}
.lbtn:hover:not(:disabled){background:#35afe4;box-shadow:0 8px 24px rgba(34,158,217,.24)}
.lbtn:active:not(:disabled){transform:scale(.975)}

/* Chat shell */
#cs{
  position:relative;
  flex-direction:column;
  background:var(--chat);
}

.hdr{
  min-height:62px;
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:11px;
  padding:0 10px 0 14px;
  background:var(--header);
  border-bottom:1px solid rgba(255,255,255,.035);
  box-shadow:0 2px 10px rgba(0,0,0,.16);
  z-index:10;
}

.hdr img{
  width:40px!important;
  height:40px!important;
  flex:0 0 auto;
  border-radius:50%!important;
  object-fit:cover;
  box-shadow:0 0 0 2px rgba(255,255,255,.07);
}

.hin{flex:1;min-width:0}
.hname{
  overflow:hidden;
  color:#f7f9fa;
  font-size:15.5px;
  font-weight:650;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.hst{
  display:flex;
  align-items:center;
  gap:6px;
  margin-top:2px;
}
.hdot{
  width:7px;
  height:7px;
  flex:0 0 auto;
  border-radius:50%;
  background:var(--green);
  transition:background .2s ease;
}
.hstxt{color:var(--muted);font-size:12px}
.hstxt.anim{animation:statusIn .2s ease}

.hbtn{
  position:relative;
  min-width:40px;
  min-height:40px;
  padding:8px 11px;
  overflow:hidden;
  border-radius:50px;
  background:transparent;
  color:var(--muted);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  white-space:nowrap;
  transition:color .15s ease,background .15s ease,transform .12s ease;
}
.hbtn:hover{background:rgba(255,255,255,.07);color:var(--text)}
.hbtn:active{transform:scale(.93)}
.hbtn-ico{width:40px;padding:0}
#hcl:hover{color:#ff8b8b;background:rgba(255,107,107,.09)}

.chat-stage{
  position:relative;
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.chat-stage::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:0;
  background:
    linear-gradient(rgba(11,20,26,.9),rgba(11,20,26,.9)),
    radial-gradient(circle at 20px 20px,rgba(134,150,160,.22) 1.2px,transparent 1.4px);
  background-size:auto,44px 44px;
  pointer-events:none;
}

.mwrap{
  position:relative;
  z-index:1;
  flex:1;
  min-height:0;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior-y:contain;
  scrollbar-color:rgba(134,150,160,.28) transparent;
  -webkit-overflow-scrolling:touch;
}
.mwrap::-webkit-scrollbar{width:4px}
.mwrap::-webkit-scrollbar-thumb{border-radius:4px;background:rgba(134,150,160,.25)}

.mlist{
  width:100%;
  max-width:860px;
  min-height:100%;
  margin:0 auto;
  padding:14px 22px 12px;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  gap:2px;
}

.dsp,.sysmsg{
  display:flex;
  justify-content:center;
  margin:9px 0;
}
.dsp span,.sysmsg span{
  max-width:80%;
  padding:5px 11px;
  border-radius:8px;
  background:rgba(32,44,51,.88);
  box-shadow:0 1px 2px rgba(0,0,0,.2);
  color:#b6c2c8;
  font-size:11.5px;
  font-weight:600;
  text-align:center;
}

.close-prompt{
  align-self:center;
  width:min(100%,390px);
  margin:10px 0;
  padding:14px;
  border:1px solid rgba(42,171,238,.28);
  border-radius:14px;
  background:rgba(42,171,238,.1);
  box-shadow:0 3px 12px rgba(0,0,0,.14);
  text-align:center;
}
.close-prompt-text{color:var(--text);font-size:13px;line-height:1.45;white-space:pre-wrap}
.close-prompt button{width:100%;min-height:39px;margin-top:11px;border:0;border-radius:10px;background:var(--accent);color:#fff;font-weight:750;font-size:13px}
.close-prompt button:disabled{opacity:.65}

.emp{
  margin:auto;
  padding:54px 20px;
  color:var(--muted);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:13px;
  text-align:center;
  animation:fadeIn .35s ease both;
}
.emp svg{opacity:.38;color:var(--accent)}
.emp p{max-width:240px;font-size:14px;line-height:1.5}

.msg{
  max-width:min(76%,620px);
  display:flex;
  flex-direction:column;
  transform-origin:left bottom;
}
.msg.o{align-self:flex-end;transform-origin:right bottom;animation:messageOut .2s cubic-bezier(.2,.8,.2,1) both}
.msg.i{align-self:flex-start;animation:messageIn .2s cubic-bezier(.2,.8,.2,1) both}

.bub{
  position:relative;
  min-width:72px;
  padding:7px 9px 5px;
  border-radius:9px;
  background:var(--incoming);
  box-shadow:0 1px 1px rgba(0,0,0,.18);
  line-height:1.42;
  overflow:visible;
  overflow-wrap:anywhere;
}
.msg.o .bub{
  border-bottom-right-radius:3px;
  background:var(--outgoing);
}
.msg.i .bub{border-bottom-left-radius:3px}

.msg.o .bub::after,.msg.i .bub::after{
  content:"";
  position:absolute;
  bottom:0;
  width:8px;
  height:12px;
  pointer-events:none;
}
.msg.o .bub::after{
  right:-7px;
  background:linear-gradient(135deg,transparent 0 49%,var(--outgoing) 50%);
}
.msg.i .bub::after{
  left:-7px;
  background:linear-gradient(225deg,transparent 0 49%,var(--incoming) 50%);
}
.msg.o+.msg.o .bub,.msg.i+.msg.i .bub{margin-top:1px;border-radius:9px}
.msg.o+.msg.o .bub::after,.msg.i+.msg.i .bub::after{display:none}
.msg.i+.msg.i .bsnm{display:none}

.bsnm{
  margin:0 0 2px 1px;
  color:#53bdeb;
  font-size:12.5px;
  font-weight:650;
}
.btxt{font-size:14.5px;white-space:pre-wrap}
.btxt a{color:#53bdeb;text-decoration:none}
.btxt a:hover{text-decoration:underline}

.bmeta{
  float:right;
  clear:right;
  min-height:15px;
  margin:4px 0 -2px 8px;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:3px;
}
.btime{color:rgba(233,237,239,.52);font-size:10.5px;line-height:1}
.msg.o .btime{color:rgba(213,240,235,.62)}
.bmeta svg{opacity:.9}

.rxns{
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  margin-top:5px;
}
.rxns span{
  min-width:25px;
  height:22px;
  padding:0 6px;
  border:1px solid rgba(83,189,235,.22);
  border-radius:11px;
  background:rgba(42,171,238,.09);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
}

.qblock{
  margin-bottom:5px;
  padding:5px 7px;
  border-left:3px solid var(--accent);
  border-radius:3px 6px 6px 3px;
  background:rgba(0,0,0,.13);
  cursor:pointer;
}
.qname{color:#53bdeb;font-size:11.5px;font-weight:700}
.qtxt{
  max-width:250px;
  overflow:hidden;
  color:rgba(233,237,239,.67);
  font-size:11.5px;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.msg.hl .bub{animation:messageHighlight 1.25s ease}

.mimg,.mvid{
  width:auto;
  max-width:min(360px,70vw);
  max-height:390px;
  border-radius:7px;
  background:rgba(0,0,0,.18);
  display:block;
  object-fit:contain;
}
.mimg{cursor:zoom-in}
.maud{width:235px;max-width:66vw}
.mfile{
  min-width:0;
  max-width:100%;
  color:inherit;
  display:flex;
  align-items:center;
  gap:9px;
  text-decoration:none;
}
.fic{
  width:38px;
  height:38px;
  flex:0 0 auto;
  border-radius:50%;
  background:rgba(42,171,238,.16);
  color:#72c9f0;
  display:grid;
  place-items:center;
}
.fnm{
  max-width:min(210px,52vw);
  overflow:hidden;
  font-size:13px;
  font-weight:600;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.media-fallback{
  max-width:270px;
  padding:9px;
  border:1px solid rgba(255,107,107,.22);
  border-radius:8px;
  background:rgba(255,107,107,.07);
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:7px;
  font-size:12px;
}
.media-fallback a,.media-fallback button{
  padding:5px 8px;
  border-radius:6px;
  background:rgba(255,255,255,.08);
  color:var(--text);
  text-decoration:none;
}

.sdwn{
  position:absolute;
  right:18px;
  bottom:14px;
  z-index:5;
  width:42px;
  height:42px;
  border-radius:50%;
  background:var(--header);
  color:var(--muted);
  box-shadow:0 4px 16px rgba(0,0,0,.35);
  display:grid;
  place-items:center;
  opacity:0;
  pointer-events:none;
  transform:translateY(8px) scale(.92);
  transition:opacity .18s ease,transform .18s ease,color .18s ease;
}
.sdwn.on{opacity:1;pointer-events:auto;transform:none}
.sdwn:hover{color:var(--text)}
.sdwn.bounce{animation:downBounce .35s ease}
.ubadge{
  position:absolute;
  top:-4px;
  right:-3px;
  min-width:18px;
  height:18px;
  padding:0 5px;
  border-radius:9px;
  background:var(--accent-strong);
  color:#fff;
  display:grid;
  place-items:center;
  font-size:10px;
  font-weight:700;
  animation:badgeIn .24s cubic-bezier(.2,.9,.2,1.4);
}

.typing-bar{
  flex:0 0 auto;
  padding:7px 16px 6px;
  background:var(--chat);
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:8px;
  animation:typingIn .18s ease;
}
.typing-dots{display:flex;gap:3px}
.typing-dots span{
  width:5px;
  height:5px;
  border-radius:50%;
  background:var(--accent);
  animation:typingDot 1.15s ease-in-out infinite;
}
.typing-dots span:nth-child(2){animation-delay:.14s}
.typing-dots span:nth-child(3){animation-delay:.28s}
.typing-lbl{font-size:11.5px}

.iarea{
  flex:0 0 auto;
  padding:8px 10px;
  padding-bottom:calc(8px + env(safe-area-inset-bottom,0px));
  background:var(--page);
  border-top:1px solid rgba(255,255,255,.025);
}
.irow{
  max-width:900px;
  margin:0 auto;
  display:flex;
  align-items:flex-end;
  gap:6px;
}
.icn,.sndbtn{
  position:relative;
  width:44px;
  height:44px;
  flex:0 0 auto;
  overflow:visible;
  border-radius:50%;
  display:grid;
  place-items:center;
  transition:background .15s ease,color .15s ease,transform .12s ease;
}
.icn svg{display:block;max-width:20px;max-height:20px}
.icn{background:transparent;color:var(--muted)}
.icn:hover{background:rgba(255,255,255,.055);color:var(--text)}
.icn:active,.sndbtn:active{transform:scale(.9)}
.sndbtn{
  background:var(--accent-strong);
  color:#fff;
  transform:scale(1);
  box-shadow:0 3px 12px rgba(34,158,217,.24);
}
.sndbtn:not(:disabled) svg{animation:sendReady .22s ease}
.sndbtn:disabled{background:var(--header-soft);color:var(--subtle);box-shadow:none}

.tbox{
  flex:1;
  min-height:44px;
  padding:9px 13px;
  border:1px solid transparent;
  border-radius:22px;
  background:var(--composer);
  display:flex;
  align-items:center;
  transition:border-color .16s ease,background .16s ease;
}
.tbox:focus-within{border-color:rgba(42,171,238,.28);background:#24343d}
#ti{
  width:100%;
  max-height:108px;
  resize:none;
  border:0;
  outline:0;
  background:transparent;
  color:var(--text);
  line-height:1.4;
  overflow-y:auto;
}

.fprev{
  max-width:900px;
  margin:0 auto 7px;
  animation:previewIn .2s ease;
}
.fpi{
  min-height:48px;
  padding:6px 9px;
  border-left:3px solid var(--accent);
  border-radius:7px;
  background:var(--header);
  display:flex;
  align-items:center;
  gap:9px;
}
.fpth{flex:1;min-width:0}
.fpth img{max-width:78px;max-height:54px;border-radius:6px;display:block;object-fit:cover}
.fpnm{overflow:hidden;font-size:13px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}
.fprm{
  width:28px;
  height:28px;
  flex:0 0 auto;
  border-radius:50%;
  background:rgba(255,255,255,.06);
  color:var(--muted);
  display:grid;
  place-items:center;
}

.uspin{
  max-width:900px;
  margin:0 auto 6px;
  padding:3px 5px;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:7px;
  font-size:12px;
}
.sp{
  width:13px;
  height:13px;
  border:2px solid rgba(255,255,255,.13);
  border-top-color:var(--accent);
  border-radius:50%;
  animation:spin .7s linear infinite;
}

.epick{
  flex:0 0 auto;
  padding:8px;
  background:var(--header);
  border-top:1px solid var(--line);
  animation:panelIn .18s ease;
}
.ecats{
  padding-bottom:6px;
  margin-bottom:6px;
  border-bottom:1px solid var(--line);
  display:flex;
  gap:2px;
  overflow-x:auto;
  scrollbar-width:none;
}
.ecats::-webkit-scrollbar{display:none}
.ecat,.eitm{border-radius:8px;background:transparent}
.ecat{min-width:36px;padding:5px 7px;font-size:19px}
.ecat.on,.ecat:hover,.eitm:hover{background:rgba(255,255,255,.065)}
.egrid{
  max-height:184px;
  overflow-y:auto;
  display:grid;
  grid-template-columns:repeat(auto-fill,38px);
  gap:2px;
}
.eitm{width:38px;height:38px;font-size:21px}

.cbar{
  flex:0 0 auto;
  display:none;
  padding:12px 18px calc(14px + env(safe-area-inset-bottom,0px));
  border-top:1px solid rgba(255,107,107,.15);
  background:var(--page);
  flex-direction:column;
  align-items:center;
  gap:9px;
}
.cbar.on{display:flex;animation:panelIn .2s ease}
.cbar-t{color:#f2a1a1;font-size:12.5px;font-weight:600}
.newbtn{
  position:relative;
  width:100%;
  max-width:300px;
  min-height:43px;
  overflow:hidden;
  border-radius:22px;
  background:var(--accent-strong);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-size:14px;
  font-weight:700;
  transition:transform .12s ease,background .15s ease;
}
.newbtn:hover{background:#35afe4}
.newbtn:active{transform:scale(.97)}

.dropzone{
  position:absolute;
  inset:10px;
  z-index:20;
  opacity:0;
  pointer-events:none;
  transform:scale(.985);
  transition:opacity .18s ease,transform .18s ease;
  display:grid;
  place-items:center;
}
.dropzone.on{opacity:1;pointer-events:auto;transform:none}
.dropzone::before{
  content:"";
  position:absolute;
  inset:0;
  border:2px dashed rgba(83,189,235,.45);
  border-radius:18px;
  background:rgba(11,20,26,.9);
  backdrop-filter:blur(8px);
}
.dropcard{
  position:relative;
  width:min(320px,calc(100vw - 44px));
  padding:24px 20px;
  border-radius:15px;
  background:var(--header);
  color:var(--text);
  box-shadow:var(--shadow);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  text-align:center;
}
.dropcard svg{color:var(--accent)}
.dropcard b{font-size:16px}
.dropcard span{color:var(--muted);font-size:12px;line-height:1.4}

.mov{
  position:fixed;
  inset:0;
  z-index:1000;
  padding:20px;
  background:rgba(0,0,0,.66);
  backdrop-filter:blur(4px);
  display:flex;
  align-items:center;
  justify-content:center;
  animation:fadeIn .16s ease;
}
.mbox{
  width:100%;
  max-width:330px;
  padding:22px;
  border-radius:15px;
  background:var(--header);
  box-shadow:0 18px 50px rgba(0,0,0,.44);
  animation:dialogIn .22s cubic-bezier(.2,.8,.2,1);
}
.mbox h3{margin-bottom:7px;font-size:17px}
.mbox p{margin-bottom:19px;color:var(--muted);font-size:14px;line-height:1.45}
.mbtns{display:flex;justify-content:flex-end;gap:7px}
.mbc,.mbo{
  min-height:38px;
  padding:0 14px;
  border-radius:8px;
  font-size:13px;
  font-weight:700;
  transition:background .15s ease,transform .12s ease;
}
.mbc{background:rgba(255,255,255,.07)}
.mbo{background:var(--danger);color:#fff}
.mbc:active,.mbo:active{transform:scale(.96)}

.tst{
  position:fixed;
  left:50%;
  bottom:calc(76px + env(safe-area-inset-bottom,0px));
  z-index:9999;
  max-width:calc(100vw - 28px);
  padding:10px 15px;
  border-radius:10px;
  background:#263740;
  color:var(--text);
  box-shadow:0 8px 30px rgba(0,0,0,.4);
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  opacity:0;
  pointer-events:none;
  transform:translateX(-50%) translateY(8px);
  transition:opacity .18s ease,transform .18s ease;
  white-space:nowrap;
}
.tst.on{opacity:1;transform:translateX(-50%) translateY(0)}
.tst[data-type=ok]{color:#9be9ba}
.tst[data-type=err]{color:#ffb2b2}

.lb{
  position:fixed;
  inset:0;
  z-index:2000;
  background:rgba(0,0,0,.96);
  cursor:zoom-out;
  display:flex;
  align-items:center;
  justify-content:center;
  animation:fadeIn .18s ease;
}
.lb img,.lb video{max-width:96vw;max-height:92vh;border-radius:6px;object-fit:contain}

.lo-btn{
  align-self:center;
  margin:8px auto 5px;
  padding:7px 13px;
  border-radius:8px;
  background:rgba(32,44,51,.88);
  color:#aebcc3;
  font-size:12px;
  font-weight:600;
}

.rpl{
  position:absolute;
  border-radius:50%;
  background:rgba(255,255,255,.17);
  pointer-events:none;
  transform:scale(0);
  animation:ripple .5s ease-out forwards;
}

@keyframes screenIn{from{opacity:0}to{opacity:1}}
@keyframes cardIn{from{opacity:0;transform:translateY(18px) scale(.98)}to{opacity:1;transform:none}}
@keyframes statusIn{from{opacity:0;transform:translateY(2px)}to{opacity:1;transform:none}}
@keyframes messageIn{from{opacity:0;transform:translate(-7px,5px) scale(.97)}to{opacity:1;transform:none}}
@keyframes messageOut{from{opacity:0;transform:translate(7px,5px) scale(.97)}to{opacity:1;transform:none}}
@keyframes messageHighlight{0%,100%{filter:none}42%{filter:brightness(1.28);box-shadow:0 0 0 2px rgba(42,171,238,.42)}}
@keyframes typingIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@keyframes typingDot{0%,70%,100%{opacity:.32;transform:translateY(0)}35%{opacity:1;transform:translateY(-3px)}}
@keyframes sendReady{from{opacity:.3;transform:translate(-3px,3px) scale(.8)}to{opacity:1;transform:none}}
@keyframes previewIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes panelIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes dialogIn{from{opacity:0;transform:translateY(10px) scale(.97)}to{opacity:1;transform:none}}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes ripple{to{transform:scale(5);opacity:0}}
@keyframes downBounce{0%,100%{transform:none}45%{transform:scale(1.16)}}
@keyframes badgeIn{from{opacity:0;transform:scale(.5)}to{opacity:1;transform:none}}

@media(max-width:600px){
  #app{width:100%;box-shadow:none}
  .hdr{min-height:calc(58px + env(safe-area-inset-top,0px));padding:env(safe-area-inset-top,0px) 6px 0 11px}
  .hdr img{width:38px!important;height:38px!important}
  .hname{font-size:15px}
  .hbtxt{display:none}
  .hbtn{width:40px;padding:0}
  .mlist{padding:11px 10px 9px}
  .msg{max-width:86%}
  .btxt{font-size:14.5px}
  .mimg,.mvid{max-width:73vw;max-height:340px}
  .iarea{padding:7px 6px;padding-bottom:calc(7px + env(safe-area-inset-bottom,0px))}
  .irow{gap:3px}
  .icn,.sndbtn{width:42px;height:42px}
  .tbox{min-height:42px;padding:8px 12px}
  #ti{max-height:88px}
  .dropzone{inset:7px}
  .tst{bottom:calc(70px + env(safe-area-inset-bottom,0px))}
}

@media(max-width:365px){
  .lcard{padding:30px 22px 24px}
  .msg{max-width:90%}
  #ebt{display:none}
}

@media(max-height:520px) and (orientation:landscape){
  #ls{padding:8px 18px}
  .lcard{max-width:430px;padding:14px 24px}
  .lcard img{width:52px!important;height:52px!important;margin-bottom:7px}
  .ltit{font-size:20px}
  .lstatus{margin-bottom:5px}
  .lsub{margin-bottom:9px}
  .linp,.lbtn{height:42px;min-height:42px}
  .hdr{min-height:50px}
  .iarea{padding-top:5px;padding-bottom:calc(5px + env(safe-area-inset-bottom,0px))}
  .icn,.sndbtn{width:38px;height:38px}
  .tbox{min-height:38px}
  .egrid{max-height:82px}
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{
    scroll-behavior:auto!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important;
  }
}

/* Shared visual language and accessible controls. */
button:focus-visible,a:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
#ls{overflow:auto}.lcard{border-radius:18px}.hdr img{border-radius:12px}.lcard .linp{font-size:16px}
.mbox{max-width:calc(100vw - 32px)}.mbtns button{min-height:44px}.hbtn,.fprm{min-width:40px;min-height:40px}
.lb img{max-height:90dvh;object-fit:contain}.mfile{overflow-wrap:anywhere}
@media(min-width:1000px){#app{border-inline:1px solid var(--line)}}
@media(max-width:600px){#app{min-height:0}.lcard{max-height:100%;overflow:auto}.icn,.sndbtn{min-width:42px}.mbox{padding:24px}}

/* One scroll container keeps both the name field and submit button reachable
   when the visual viewport shrinks for a software keyboard. */
#app{min-height:0}
#ls{flex-direction:column;justify-content:flex-start;overflow-y:auto;overscroll-behavior:contain;background:var(--page);padding:20px}
#ls .lcard{flex:none;max-height:none;overflow:visible;margin-block:auto;padding:28px;background:var(--header)}
.lcard>*{flex-shrink:0}.linp{font-size:16px}.linp:focus{background:var(--field);border-color:var(--accent)}
.lbtn:hover:not(:disabled){background:var(--accent);box-shadow:none}
#app.compact-viewport #ls{padding:10px 16px}
#app.compact-viewport .lcard{padding:16px 20px;border-radius:14px}
#app.compact-viewport .lcard img{width:36px!important;height:36px!important;margin-bottom:6px}
#app.compact-viewport .ltit{font-size:20px;margin-bottom:4px}
#app.compact-viewport .lstatus{margin-bottom:6px}
#app.compact-viewport .lsub{font-size:12px;margin-bottom:10px}
#app.compact-viewport .linp,#app.compact-viewport .lbtn{height:44px;min-height:44px}
#app.compact-viewport .hdr{min-height:48px;padding-block:6px}
#app.compact-viewport .iarea{padding-top:6px;padding-bottom:max(6px,env(safe-area-inset-bottom,0px))}
@media(max-height:400px){#ls .lcard img,#ls .lstatus{display:none}#ls .lcard{padding:14px 18px}.lsub.offhours{max-height:64px;overflow:auto}}
