/* v326 Group chats + Admin support panel (chat326.js). Site colours only (--accent, --accent-rgb, --accent-text, --accent-ink,
   --surface, --surface2, --bg, --line, --text, --muted) so it follows light/dark and the chosen accent. Reuses the msg-* chat
   pieces from messages.css. Classes start c326-. Phones/tablets/landscape: fills the screen edge to edge (no gaps).
   Laptops (>=860px wide and >=560px tall): a centred panel over a dimmed page. */
html.c326-open,html.c326-open body{overflow:hidden}
html.c326-open .toast{z-index:2147483001}
.c326{position:fixed;inset:0;z-index:1400;display:flex;align-items:stretch;justify-content:center}
.c326-scrim{display:none}
.c326-win{position:relative;display:flex;flex-direction:column;width:100%;height:100%;height:100dvh;background:var(--surface);color:var(--text);
  padding-top:env(safe-area-inset-top);box-sizing:border-box;overflow:hidden}
@media(min-width:860px) and (min-height:560px){
  .c326{align-items:center}
  .c326-scrim{display:block;position:absolute;inset:0;background:rgba(0,0,0,.55)}
  .c326-win{width:min(760px,calc(100vw - 48px));height:min(820px,calc(100vh - 48px));height:min(820px,calc(100dvh - 48px));border-radius:22px;border:1px solid var(--line);
    box-shadow:0 24px 70px rgba(0,0,0,.45);padding-top:0}
}
/* header */
.c326-h{display:flex;align-items:center;gap:6px;padding:8px 10px;border-bottom:1px solid var(--line);background:var(--surface);flex:none;min-height:60px;box-sizing:border-box}
.c326-ht{flex:1 1 auto;min-width:0;padding:0 4px}
.c326-ht h2{margin:0;font-size:17px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.c326-ht p{margin:2px 0 0;font-size:12.5px;color:var(--muted);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.c326 .msg-ic.fr-btn svg,.c326-ib svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.c326 .fr-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.c326-new{flex:none;min-height:40px;padding:0 12px}
@media(max-width:380px){.c326-new span{display:none}.c326-new{width:44px;padding:0}}
.c326-sm{min-height:36px!important;padding:0 12px!important;font-size:13px;flex:none}
.c326-danger{color:var(--danger,#e5484d)!important}
/* body */
.c326-b{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;background:var(--surface)}
.c326-scroll{background:var(--bg)}
.c326-pad{padding:14px 16px 16px}
.c326-list{padding:8px}
.c326-empty{min-height:0;padding:36px 20px}
.c326-err{margin:16px}
.c326-foot{flex:none}
.c326-bar{flex:none;padding:10px 16px calc(10px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--surface)}
.c326-wide{width:100%}
/* icon avatars */
.c326-icav{background:rgba(var(--accent-rgb),.16);color:var(--accent-text)}
.c326-icav svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.c326-icav-s{background:linear-gradient(135deg,rgba(var(--accent-rgb),.28),rgba(var(--accent-rgb),.1))}
.c326-mrows{padding:0 8px;margin-bottom:2px}
.c326-mrows+.msg-list,.c326-mrows+.msg-empty{border-top:1px solid var(--line);padding-top:6px}
.c326-mrows+.msg-empty{min-height:0}
.c326-n{margin-left:auto}
/* group bubbles */
.c326 div.msg-bub{cursor:default}
.c326-from{font-size:12px;font-weight:800;color:var(--muted);margin:2px 8px 3px;display:inline-flex;align-items:center;gap:4px}
.c326-from svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:2}
.c326-sys{align-self:center;max-width:90%;margin:6px 0;text-align:center}
.c326-sys span{display:inline-block;padding:5px 12px;border-radius:99px;background:var(--surface);border:1px solid var(--line);font-size:12.5px;font-weight:700;color:var(--muted);line-height:1.35}
.c326 .msg-b{max-width:min(82%,560px)}
.c326 .msg-media{max-width:min(240px,62vw)}
/* new group + picker */
.c326-f{margin-bottom:12px}
.c326-pick{padding:0;margin:0 -8px}
.c326-prow{grid-template-columns:auto minmax(0,1fr) 28px}
.c326-prow .msg-av.fr-av{width:42px;height:42px}
.c326-tick{width:26px;height:26px;border-radius:50%;border:2px solid var(--line);display:grid;place-items:center;box-sizing:border-box}
.c326-prow.on .c326-tick{background:var(--accent);border-color:var(--accent);color:var(--accent-ink,#000)}
.c326-tick svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.c326-pnone{margin:8px 0;font-size:14.5px;line-height:1.45}
/* group info */
.c326-rn{display:flex;gap:8px}.c326-rn input{flex:1 1 auto;min-width:0}.c326-rn .fr-btn{flex:none}
.c326-sec-h{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:8px 0 6px}
.c326-sec-h h3{margin:0;font-size:15px}
.c326-mem{padding:0}
.c326-mrow2{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:12px;align-items:center;min-height:60px;padding:6px 2px;border-top:1px solid var(--line)}
.c326-mrow2:first-child{border-top:0}
.c326-mrow2 .msg-av.fr-av{width:42px;height:42px}
.c326-leave{margin-top:18px;display:grid;gap:6px;text-align:center}
.c326-leave p{margin:0}
/* confirm sheet */
.c326-cf{position:absolute;inset:0;z-index:5;display:flex;align-items:flex-end;justify-content:center}
.c326-cf-s{position:absolute;inset:0;background:rgba(0,0,0,.45)}
.c326-cf-b{position:relative;width:100%;max-width:460px;background:var(--surface);border-radius:20px 20px 0 0;padding:18px 18px calc(18px + env(safe-area-inset-bottom));box-sizing:border-box;box-shadow:0 -10px 40px rgba(0,0,0,.3)}
.c326-cf-b h3{margin:0 0 6px;font-size:17px}.c326-cf-b p{margin:0 0 14px;color:var(--muted);line-height:1.45}
@media(min-width:860px) and (min-height:560px){.c326-cf{align-items:center}.c326-cf-b{border-radius:18px;max-width:400px}}
/* ---------- admin support ---------- */
.c326-sup .c326-msgs{min-height:100%;display:flex;flex-direction:column}
.c326-hero{margin:auto 0;padding:22px 8px 12px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:10px}
.c326-hero-ic{width:76px;height:76px;border-radius:24px;display:grid;place-items:center;color:var(--accent-ink,#000);
  background:linear-gradient(140deg,var(--accent),rgba(var(--accent-rgb),.55));box-shadow:0 12px 34px rgba(var(--accent-rgb),.35)}
.c326-hero-ic svg{width:40px;height:40px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.c326-hero h3{margin:4px 0 0;font-size:20px;line-height:1.25}
.c326-hero p{margin:0;max-width:42ch;color:var(--muted);font-size:14.5px;line-height:1.5}
.c326-hero b{color:var(--text)}
.c326-chips{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%;max-width:440px;margin-top:6px}
.c326-chip{appearance:none;min-height:46px;padding:8px 10px;border-radius:14px;border:1px solid var(--line);background:var(--surface);color:var(--text);font:inherit;font-size:13.5px;font-weight:700;cursor:pointer;line-height:1.25}
.c326-chip:hover{border-color:rgba(var(--accent-rgb),.6);background:rgba(var(--accent-rgb),.08)}
.c326-chip:focus-visible{outline:3px solid var(--accent-text);outline-offset:2px}
.c326-r-ai .c326-bub{background:linear-gradient(160deg,rgba(var(--accent-rgb),.14),var(--surface2));border-color:rgba(var(--accent-rgb),.35)}
.c326-ai-l{color:var(--accent-text)}
.c326-r-agent.them .c326-bub{border-color:rgba(var(--accent-rgb),.55);box-shadow:0 0 0 1px rgba(var(--accent-rgb),.25) inset}
.c326-ag-l{color:var(--text)}
.c326-typing{display:inline-flex;gap:5px;align-items:center;min-height:40px}
.c326-typing i{width:7px;height:7px;border-radius:50%;background:var(--muted);animation:c326b 1.2s infinite ease-in-out}
.c326-typing i:nth-child(2){animation-delay:.15s}.c326-typing i:nth-child(3){animation-delay:.3s}
@keyframes c326b{0%,80%,100%{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}
.c326-hold-slot{flex:none}
.c326-hold{display:flex;align-items:center;gap:14px;margin:0;padding:12px 16px;border-top:1px solid var(--line);
  background:linear-gradient(90deg,rgba(var(--accent-rgb),.16),rgba(var(--accent-rgb),.05))}
.c326-qn{position:relative;flex:none;width:58px;height:58px;border-radius:50%;display:grid;place-items:center;background:var(--accent);color:var(--accent-ink,#000)}
.c326-qn::before{content:"";position:absolute;inset:-5px;border-radius:50%;border:2px solid rgba(var(--accent-rgb),.55);animation:c326p 2s infinite ease-out}
.c326-qn span{font:800 26px/1 var(--display,inherit);font-variant-numeric:tabular-nums}
@keyframes c326p{0%{transform:scale(.92);opacity:.9}100%{transform:scale(1.18);opacity:0}}
.c326-hold-t{min-width:0}
.c326-hold-t h3{margin:0 0 3px;font-size:16px;line-height:1.25}
.c326-hold-t p{margin:0;font-size:13px;line-height:1.4;color:var(--muted)}
.c326-hold-t b{color:var(--text)}
.c326-live{display:flex;align-items:center;gap:8px;padding:9px 16px;border-top:1px solid var(--line);font-size:13.5px;background:rgba(var(--accent-rgb),.08)}
.c326-dot{width:9px;height:9px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 3px rgba(34,197,94,.25);flex:none}
.c326-talk{display:flex;gap:8px;margin:0 0 8px}
.c326-talkb{flex:1 1 auto;min-height:40px!important}
.c326-endb{flex:none;min-height:40px!important;padding:0 14px!important;color:var(--muted)!important}
.c326-talk-end{justify-content:flex-end}
.c326-closed{display:grid;gap:10px;text-align:center}
.c326-closed p{margin:0;color:var(--muted);font-size:14px}
/* landscape phones: keep the chat area tall enough */
@media(max-height:480px){.c326-h{min-height:52px;padding:4px 8px}.c326-ht p{display:none}.c326-hero{padding:8px}.c326-hero-ic{width:48px;height:48px;border-radius:16px}.c326-hero-ic svg{width:26px;height:26px}
  .c326-hero h3{font-size:17px}.c326-hero p{display:none}.c326-chips{grid-template-columns:repeat(4,minmax(0,1fr))}.c326-chip{min-height:40px;font-size:12.5px}
  .c326-hold{padding:6px 12px}.c326-qn{width:42px;height:42px}.c326-qn span{font-size:19px}.c326-hold-t p{display:none}.c326-talk{margin-bottom:6px}.c326-foot.msg-foot{padding-top:6px;padding-bottom:calc(6px + env(safe-area-inset-bottom))}}
/* admin queue */
.c326-qsec{margin:0 0 16px}
.c326-qsec h3{display:flex;align-items:center;gap:8px;margin:0 0 6px;font-size:15px}
.c326-qsec .msg-list{padding:0;margin:0 -8px}
.c326-qrow{display:flex;align-items:center;gap:6px;padding-right:8px}
.c326-qrow .msg-row{flex:1 1 auto;min-width:0}
.c326-qm{font-size:12.5px;font-weight:700;color:var(--accent-text)}
.c326-qe{margin:2px 0 0;font-size:14px}
.c326-pk{flex:none}
/* the Social sheet tile */
html.hs-open #homeSocial .tt-row.c326-srow{margin-top:8px;min-height:58px;color:var(--tt-ink,#16181d);text-align:left;box-sizing:border-box}
.c326-srow>svg:first-child{color:var(--accent,#0f8f5f)}
.c326-srt{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.c326-srt b{font:700 15px/1.15 var(--body,inherit)}
.c326-srt small{font:500 12.5px/1.2 var(--body,inherit);color:var(--tt-mut,#5d6573);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.c326-srow>svg:last-child{opacity:.5;width:18px!important;height:18px!important}
.c326-tn{min-width:20px;height:20px;padding:0 6px;box-sizing:border-box;border-radius:99px;background:var(--danger,#e5484d);color:#fff;font:800 11px/20px var(--body,inherit);font-style:normal;text-align:center}
@media(prefers-reduced-motion:reduce){.c326-qn::before,.c326-typing i{animation:none}}
