/* Virtual Team web app. The look comes from the clickable demo (mockups/school-virtual-team.html):
   grey page, white rows, green bubbles for you, white for the agent, square-ish pictures with an "Agent" tag. */
:root{
  --bg:#EDEDED; --cell:#FFFFFF; --bar:#F7F7F7; --field:#FFFFFF; --line:#E2E2E2; --quote:#E3E3E3; --press:#ECECEC;
  --ink:#111111; --muted:#888888; --muted2:#B0B0B0;
  --mine:#A3E58A; --mine-ink:#0E1A08; --theirs:#FFFFFF;
  --accent:#2F55D4; --accent-ink:#FFFFFF; --accent-soft:#E5EBFF; --accent-text:#2443B0;
  --red:#F04646; --red-soft:#FDE4E4; --ok:#1E9E57; --ok-soft:#DDF3E6; --sun:#F2B517; --orange:#F29B38; --cell-pin:#F3F3F3;
  --c2:#FCEBD6; --c2t:#8A4F00;
  --scrim:rgba(0,0,0,.42); --shadow:0 10px 40px rgba(0,0,0,.14);
  --toast:rgba(17,17,17,.88);
  --cap-bg:rgba(255,255,255,.75); --cap-line:rgba(0,0,0,.14);
  --f:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Helvetica Neue","Segoe UI",Roboto,Arial,sans-serif;
  --mono:ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  --ease:cubic-bezier(.22,.8,.24,1);
  color-scheme:light;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#111111; --cell:#1B1B1B; --bar:#1E1E1E; --field:#2B2B2B; --line:#2C2C2C; --quote:#2A2A2A; --press:#262626;
  --ink:#E8E8E8; --muted:#8C8C8C; --muted2:#5E5E5E;
  --mine:#3F9A5C; --mine-ink:#F1FFF2; --theirs:#2C2C2C;
  --accent:#7D98FF; --accent-ink:#0B1233; --accent-soft:#1F2846; --accent-text:#AFC0FF;
  --red:#FA5A5A; --red-soft:#462020; --ok:#4CCB85; --ok-soft:#163A27; --sun:#F4C445; --orange:#F2A64E; --cell-pin:#232323;
  --c2:#3A2A14; --c2t:#F2B36B;
  --scrim:rgba(0,0,0,.6); --shadow:0 10px 40px rgba(0,0,0,.6);
  --toast:rgba(60,60,60,.95);
  --cap-bg:rgba(40,40,40,.8); --cap-line:rgba(255,255,255,.16);
  color-scheme:dark}}

*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{background:var(--bg);color:var(--ink);font-family:var(--f);font-size:16px;line-height:1.4;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent;overflow:hidden}
#app{height:100%;height:100dvh}
button{font:inherit;color:inherit;background:none;border:0;padding:0;margin:0;cursor:pointer;text-align:inherit}
button:disabled{cursor:default}
input,textarea{font:inherit;color:inherit}
a{color:var(--accent-text)}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
h1:focus,h1:focus-visible{outline:none}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.skip{position:absolute;left:8px;top:-60px;z-index:100;background:var(--accent);color:var(--accent-ink);padding:10px 14px;border-radius:8px;font-weight:600;text-decoration:none}
.skip:focus{top:8px}
.noscript{padding:24px;text-align:center}
svg.i{width:24px;height:24px;flex:none;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
svg.i.s{width:18px;height:18px}
.mono{font-family:var(--mono);font-size:12px}
.muted{color:var(--muted)}
.spin{display:inline-block;width:14px;height:14px;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;animation:spin .8s linear infinite;vertical-align:-2px}
@keyframes spin{to{transform:rotate(360deg)}}

/* ---------- pictures ---------- */
.av{position:relative;flex:none;display:block;background:var(--accent-soft);color:var(--accent-text)}
.av img,.av svg.blank{display:block;width:100%;height:100%;border-radius:inherit;object-fit:cover}
.av svg.blank{fill:currentColor;opacity:.55}
.av::after{content:"";position:absolute;inset:0;border-radius:inherit;box-shadow:inset 0 0 0 .5px rgba(0,0,0,.14);pointer-events:none}
.av.list{width:48px;height:48px;border-radius:6px}
.av.chat{width:40px;height:40px;border-radius:5px}
.av.sm{width:32px;height:32px;border-radius:5px}
.av.lg{width:64px;height:64px;border-radius:8px}
.tag-agent{position:absolute;right:-4px;bottom:-4px;z-index:1;font-style:normal;font-size:8.5px;font-weight:800;line-height:1;letter-spacing:.04em;padding:2px 3px 1.5px;border-radius:4px;background:linear-gradient(160deg,#5A7DFF,#2A47CF);color:#fff;box-shadow:0 0 0 1.5px var(--cell)}
.av.chat .tag-agent{font-size:7.5px;right:-3px;bottom:-3px}
.av.sm .tag-agent{font-size:7px;padding:1.5px 2px 1px;right:-3px;bottom:-3px}
.av.lg .tag-agent{font-size:11px;padding:3px 5px 2px;right:-6px;bottom:-6px;border-radius:5px;box-shadow:0 0 0 2px var(--cell)}

/* ---------- the front screens: the demo's sign-in (crest, title, a gap, buttons at the bottom) ---------- */
.front{height:100%;overflow-y:auto;background:var(--cell);display:flex;justify-content:center}
.front-in{width:100%;max-width:460px;min-height:100%;padding:max(64px,env(safe-area-inset-top)) 28px calc(28px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:12px}
.front .crest{width:68px;height:68px;border-radius:16px;filter:drop-shadow(0 8px 16px rgba(31,51,179,.3))}
.front h1{font-size:28px;line-height:1.15;margin:14px 0 0;font-weight:600}
.front .lede{color:var(--muted);font-size:16px;margin:0;max-width:34ch}
.front .sp{flex:1;min-height:12px}
.fnote{color:var(--muted);font-size:13px;text-align:center;margin:6px 0 0}
.howto{background:var(--bg);border-radius:8px;padding:14px 16px;margin-top:10px}
.howto h2{font-size:15px;margin:0 0 8px}
.howto ol{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:6px;font-size:15.5px}
.sbtn{display:flex;align-items:center;justify-content:center;gap:10px;min-height:50px;padding:0 16px;border-radius:8px;font-size:16.5px;font-weight:600;width:100%;background:var(--bg);text-align:center}
.sbtn.primary{background:var(--accent);color:var(--accent-ink)}
.sbtn:disabled{opacity:.55}
.sbtn svg{width:20px;height:20px;flex:none}
.sbtn.link{background:none;color:var(--accent-text);font-weight:500;min-height:44px}
/* signing in with an emailed code: one field on the front page, as big and clear as the buttons under it */
.howto p{margin:10px 0 0;font-size:14.5px;color:var(--muted)}
.ffield{display:flex;flex-direction:column;gap:6px;margin-top:18px}
.ffield label{font-size:14px;font-weight:600}
.ffield input{width:100%;height:50px;border-radius:8px;border:1px solid var(--line);background:var(--field);padding:0 14px;font-size:17px;outline:none}
.ffield input:focus-visible{outline:2px solid var(--accent);outline-offset:0}
.ffield input.codein{font-size:26px;letter-spacing:.35em;text-align:center;font-variant-numeric:tabular-nums;padding-left:calc(14px + .35em)}
.ffield input.codein::placeholder{color:var(--muted2);letter-spacing:.35em}
.ffield .hint{font-size:13px;color:var(--muted)}
.front .err{margin:0}
.front .err[hidden]{display:none}
.front .lede .addr{color:var(--ink);font-weight:600;overflow-wrap:anywhere}
.front .fnote:empty{display:none}
.err{margin:0;color:var(--red);font-size:15px}
.bigbtn{display:flex;align-items:center;justify-content:center;gap:8px;width:calc(100% - 32px);min-height:48px;margin:16px;padding:0 16px;border-radius:8px;background:var(--accent);color:var(--accent-ink);font-weight:600;font-size:17px;text-align:center}
.bigbtn:disabled{opacity:.4;cursor:not-allowed}
.bigbtn.sec{background:var(--cell);color:var(--ink)}
.bigbtn.danger{background:var(--cell);color:var(--red)}
.linkbtn{align-self:center;min-height:44px;padding:0 12px;color:var(--accent-text);font-size:15px}
.btn{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:0 16px;border-radius:8px;background:var(--cell);border:.5px solid var(--line);font-weight:600;font-size:14.5px}

/* "Before you start": the demo's consent page (rows with a coloured picture, a tick, then Start) */
.tpage{height:100%;display:flex;flex-direction:column;background:var(--bg)}
.tpage .nav{padding-top:env(safe-area-inset-top)}
.tpage .nav .nt{font-size:17px;font-weight:600}
.thead{padding:18px 16px 10px;margin:0;font-size:22px;font-weight:600;line-height:1.25}
.crow2{display:flex;gap:14px;align-items:flex-start;padding:14px 16px;background:var(--cell);border-bottom:.5px solid var(--line)}
.crow2:last-child{border-bottom:0}
.crow2 .ci{width:36px;height:36px;border-radius:9px;display:grid;place-items:center;flex:none;color:#fff}
.crow2 .ci svg{width:20px;height:20px;stroke-width:2}
.crow2 p{margin:0;font-size:15.5px;line-height:1.45;white-space:pre-line;overflow-wrap:anywhere;padding-top:2px}
.crow2 p.titled{color:var(--muted);font-size:15px;padding-top:0}
.crow2 p.titled b{display:block;color:var(--ink);font-weight:600;font-size:16px;margin-bottom:2px}
.ci.red,.cic.red{background:var(--red)} .ci.blue,.cic.blue{background:var(--accent)} .ci.grey,.cic.grey{background:#7D8597}
.ci.sun,.cic.sun{background:var(--sun)} .ci.green,.cic.green{background:var(--ok)} .ci.orange,.cic.orange{background:var(--orange)} .cic.indigo{background:#5B6BDB}
.tfoot{flex:none;display:flex;flex-direction:column;background:var(--bg);padding-bottom:env(safe-area-inset-bottom)}
.tfoot .err{padding:4px 16px 0}
.tfoot .bigbtn{margin:10px 16px 4px}
.agree{display:flex;gap:10px;align-items:center;padding:14px 16px 4px;font-size:14.5px;width:100%;min-height:44px}
.tick{width:22px;height:22px;border-radius:50%;border:1.5px solid var(--muted2);display:grid;place-items:center;flex:none;color:transparent}
.tick.on{background:var(--ok);border-color:var(--ok);color:#fff}
.tick svg{width:15px;height:15px;stroke-width:2.6}

/* ---------- the shell ---------- */
.app{height:100%;display:flex;flex-direction:column}
.conn{flex:none;display:flex;align-items:center;justify-content:center;gap:8px;padding:8px 14px;padding-top:max(8px,env(safe-area-inset-top));background:#FFEFD4;color:#6A4000;font-size:13.5px;text-align:center}
.conn[hidden]{display:none}
.shell{position:relative;flex:1;min-height:0;display:flex}
.pane{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--bg)}
/* On a phone: the tabs, or the chat (which covers the tab bar, as in the demo). */
.shell .pane-chat{display:none}
.shell.has-chat .pane-list{display:none}
.shell.has-chat .pane-chat{display:flex}

.nav{flex:none;height:48px;box-sizing:content-box;display:grid;grid-template-columns:72px 1fr 72px;align-items:center;background:var(--bg);padding-top:env(safe-area-inset-top);position:relative;z-index:2}
.nav.line{border-bottom:.5px solid var(--line)}
.nav .nt{margin:0;text-align:center;font-size:17px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.nav .nt small{display:block;font-size:11px;font-weight:400;color:var(--muted);margin-top:-1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nav .nb{width:48px;height:48px;display:grid;place-items:center;justify-self:start;margin-left:4px;border-radius:8px}
.nav .nb svg{width:26px;height:26px}
.nav .nr{justify-self:end;margin-right:4px;width:48px;height:48px;display:grid;place-items:center;border-radius:8px}
.scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain}

/* tabs */
.panes{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}
.tabpane{flex:1;min-height:0;display:flex;flex-direction:column;background:var(--bg)}
.tabpane[hidden]{display:none}
.tabbar{flex:none;display:flex;background:var(--bar);border-top:.5px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}
.tabbar button{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;height:56px;font-size:10.5px;color:var(--ink)}
.tabbar button .ti{position:relative;display:block;height:26px}
.tabbar button svg{width:26px;height:26px}
.tabbar button.on{color:var(--accent);font-weight:600}
.tabbar button.on svg{stroke-width:2.2}
.tabbar .badge{position:absolute;top:-5px;left:16px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--red);color:#fff;font-size:11px;font-weight:600;line-height:18px;text-align:center;font-style:normal}
.tabbar .badge[hidden]{display:none}

/* search, as in the demo: a soft bar under the title */
.search{flex:none;padding:0 8px 8px;background:var(--bg)}
.sfield{display:flex;align-items:center;justify-content:center;gap:6px;height:36px;border-radius:6px;background:var(--cell);color:var(--muted);padding:0 10px}
.sfield input{flex:0 1 auto;width:56px;min-width:0;height:36px;border:0;background:none;outline:none;font-size:15px;color:var(--ink);padding:0}
.sfield:focus-within,.sfield:has(input:not(:placeholder-shown)){justify-content:flex-start}
.sfield:focus-within input,.sfield input:not(:placeholder-shown){flex:1 1 auto}
.sfield input::placeholder{color:var(--muted)}
.sfield input::-webkit-search-cancel-button{-webkit-appearance:none}

/* ---------- the chat list ---------- */
.clist{list-style:none;margin:0;padding:0;background:var(--cell)}
.clist li{display:block}
.row{display:flex;gap:12px;align-items:center;height:72px;padding-left:16px;background:var(--cell);color:var(--ink);text-decoration:none}
.row:hover{background:var(--press)}
.row:active{background:var(--press)}
.row.on{background:var(--cell-pin)}
.row .avw{position:relative;flex:none}
.row .badge{position:absolute;top:-6px;right:-7px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--red);color:#fff;font-size:11px;font-weight:600;line-height:18px;text-align:center;font-style:normal;z-index:2}
.row .mid{flex:1;min-width:0;align-self:stretch;display:flex;flex-direction:column;justify-content:center;gap:4px;padding-right:16px;border-bottom:.5px solid var(--line)}
.clist li:last-child .row .mid{border-bottom:0}
.row .top{display:flex;align-items:baseline;gap:8px}
.row .top b{flex:1;min-width:0;font-weight:500;font-size:16.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row .top time{font-size:12px;color:var(--muted2);flex:none}
.row .sub{font-size:14px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row .typing-word{color:var(--ok);font-weight:500}
.clist .empty{display:flex;flex-direction:column;align-items:center;gap:6px;padding:48px 28px;text-align:center;color:var(--muted);background:var(--bg)}
.clist .empty b{color:var(--ink);font-size:17px}

/* ---------- cells (Contacts, Me), as in the demo ---------- */
.grp{margin-top:8px;background:var(--cell)}
.grp.first{margin-top:0}
.gtitle{margin:0;padding:16px 16px 6px;font-size:13px;color:var(--muted)}
.cell{display:flex;align-items:center;gap:14px;min-height:56px;padding-left:16px;width:100%;background:var(--cell);color:var(--ink);text-decoration:none;text-align:left}
.cell:active,.cell:hover{background:var(--press)}
.cell .cl{flex:1;min-width:0;align-self:stretch;display:flex;align-items:center;gap:8px;padding:12px 12px 12px 0;border-bottom:.5px solid var(--line);font-size:16.5px}
.grp>.cell:last-child .cl{border-bottom:0}
.cell .cl .lbl{flex:1;min-width:0}
.cell .cl .lbl small{display:block;font-size:13px;color:var(--muted);margin-top:2px}
.cell .chev{color:var(--muted2);display:grid}
.cell .cic{width:26px;height:26px;border-radius:6px;display:grid;place-items:center;color:#fff;flex:none;box-shadow:inset 0 0 0 .5px rgba(0,0,0,.1)}
.cell .cic svg{width:18px;height:18px;stroke-width:2}
.mehead{display:flex;gap:16px;align-items:center;padding:28px 16px 30px;background:var(--cell)}
.mewho{flex:1;min-width:0}
.mehead b{font-size:21px;font-weight:600;display:block}
.mehead small{display:block;color:var(--muted);font-size:14px;margin-top:4px}
.note{margin:0;padding:12px 16px 4px;font-size:13px;color:var(--muted)}
/* the small tag after a name in Contacts and the org chart (the demo's .tag and .ctag) */
.tag{font-size:10px;padding:1px 5px;border-radius:3px;background:var(--quote);color:var(--muted);white-space:nowrap;font-weight:500}
.tag.t{background:var(--c2);color:var(--c2t)} .tag.a{background:var(--accent-soft);color:var(--accent-text)}
.cell .lbl .ctag{margin-left:7px;vertical-align:2px;font-size:10.5px}
.cell .lbl{overflow-wrap:anywhere}
.cell.sub{padding-left:40px}
.cell.static{cursor:default}
.cell.static:active,.cell.static:hover{background:var(--cell)}
.gtitle b{color:var(--ink);font-weight:600}
.orghead .crest.sm{width:44px;height:44px;flex:none}
.mehead small.meteam{color:var(--ink)}
.blankstate{display:flex;flex-direction:column;align-items:center;gap:8px;padding:64px 32px;text-align:center;color:var(--muted);font-size:14.5px}
.blankstate b{color:var(--ink);font-size:17px}
.blankstate svg{width:44px;height:44px;stroke-width:1.4;margin-bottom:4px}

/* ---------- a chat ---------- */
.chatp{flex:1;min-height:0;display:flex;flex-direction:column}
.chead .ct{margin:0;font-size:17px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.25}
.chead .ct:focus{outline:none}
.msgwrap{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}
.msgs{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:4px 0 14px}
.msgs:focus-visible{outline-offset:-3px}
.mlist{display:flex;flex-direction:column}
.loading{display:flex;flex-direction:column;align-items:center;gap:10px;padding:40px 20px;color:var(--muted);text-align:center;margin:0}
.loading p{margin:0}
.tdiv{align-self:center;font-size:12px;color:var(--muted);padding:14px 0 6px}
.sysm{align-self:center;max-width:82%;text-align:center;font-size:12.5px;color:var(--muted);padding:6px 12px;margin:6px 0;border-radius:5px;background:var(--quote);white-space:pre-wrap;overflow-wrap:anywhere}
.msg{display:flex;gap:10px;padding:7px 12px;align-items:flex-start;animation:msgin .22s var(--ease)}
.msg.me{flex-direction:row-reverse}
@keyframes msgin{from{opacity:0;transform:translateY(5px)}}
.mcol{display:flex;flex-direction:column;gap:5px;max-width:calc(100% - 116px);min-width:0;align-items:flex-start}
.msg.me .mcol{align-items:flex-end}
.brow{display:flex;align-items:center;gap:6px;max-width:100%}
.msg.me .brow{flex-direction:row-reverse}
.bub{position:relative;padding:9px 12px;border-radius:5px;background:var(--theirs);color:var(--ink);font-size:16px;line-height:1.45;overflow-wrap:anywhere;white-space:pre-wrap;min-height:40px;min-width:40px}
.bub::before{content:"";position:absolute;top:14px;left:-5px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:6px solid var(--theirs)}
.msg.me .bub{background:var(--mine);color:var(--mine-ink)}
.msg.me .bub::before{left:auto;right:-5px;border-right:0;border-left:6px solid var(--mine)}
.msg.me .bub a{color:inherit}
.bub.gone{font-style:italic;color:var(--muted)}
.bub.think{display:flex;align-items:center;min-width:62px}
.dots{display:inline-flex;gap:4px;align-items:center;height:22px}
.dots i{width:7px;height:7px;border-radius:50%;background:var(--muted2);animation:bob 1.1s infinite ease-in-out}
.dots i:nth-child(2){animation-delay:.15s}.dots i:nth-child(3){animation-delay:.3s}
@keyframes bob{0%,80%,100%{opacity:.35;transform:none}40%{opacity:1;transform:translateY(-3px)}}
.msg.typing[hidden]{display:none}
.sendspin{width:18px;height:18px;border-radius:50%;border:2px solid var(--muted2);border-right-color:transparent;animation:spin .8s linear infinite;flex:none}
.failbtn{width:44px;height:44px;margin:-2px -10px;display:grid;place-items:center;flex:none}
.failbtn span{width:22px;height:22px;border-radius:50%;background:var(--red);color:#fff;font-weight:700;font-size:14px;display:grid;place-items:center}
.failnote{font-size:13px;color:var(--red);min-height:32px;padding:0 2px;text-decoration:underline;text-underline-offset:2px}

/* card buttons under an agent's message: the foot of the demo's chat card */
.cardbtns{display:flex;width:240px;max-width:100%;background:var(--cell);border-radius:6px;overflow:hidden}
.cardbtns.many{flex-direction:column}
.cbtn{flex:1 1 0;display:flex;align-items:center;justify-content:center;gap:6px;min-height:48px;padding:0 12px;color:var(--accent-text);font-weight:600;font-size:15.5px;text-decoration:none;text-align:center}
.cbtn+.cbtn{border-left:.5px solid var(--line)}
.cardbtns.many .cbtn+.cbtn{border-left:0;border-top:.5px solid var(--line)}
.cbtn:hover,.cbtn:active{background:var(--press)}
.cbtn:disabled{opacity:.5}
.cbtn.picked{opacity:1;background:var(--accent-soft)}

/* a page an agent made, under its message: the demo's mini app card (.mcard .mh .mt .mb .mf), with a live preview
   you cannot touch. The whole card is one button (.mopen, laid over it): a tap opens the page full screen */
.mcard{position:relative;display:flex;flex-direction:column;width:240px;max-width:100%;background:var(--cell);border-radius:6px;overflow:hidden;text-align:left}
.mcard .mh{display:flex;align-items:center;gap:6px;padding:10px 12px 4px;font-size:12.5px;color:var(--muted)}
.mcard .mt{padding:0 12px;font-size:15.5px;font-weight:500;overflow-wrap:anywhere}
.mcard .mb{margin:8px 12px;padding:10px;border-radius:4px;background:var(--bg);display:flex;flex-direction:column;gap:6px;font-size:13.5px}
.mcard .mf{display:flex;align-items:center;gap:6px;padding:8px 12px;border-top:.5px solid var(--line);font-size:12px;color:var(--muted)}
.mic{display:grid;place-items:center;width:18px;height:18px;border-radius:5px;background:linear-gradient(160deg,#5A7DFF,#2A47CF);color:#fff;flex:none}
.mic svg{width:12px;height:12px}
.mcard .mb.artpeek{padding:0;height:270px;overflow:hidden;position:relative;background:#fff}
.artframe{display:block;border:0;background:#fff}
.artframe.peek{flex:none;width:360px;height:450px;transform:scale(.6);transform-origin:0 0;pointer-events:none}
.mopen{position:absolute;inset:0;width:100%;border-radius:6px;background:transparent}
.mopen:hover,.mopen:active{background:rgba(0,0,0,.04)}
.mopen:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* the page full screen: the demo's mini app sheet (.mini .mnav .capsule), sliding up over the app */
.mini{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;background:var(--bg);color:var(--ink);transform:translate3d(0,100%,0);transition:transform .38s var(--ease)}
.mini[open]{display:flex;flex-direction:column}
.mini.in{transform:none}
.mini::backdrop{background:var(--scrim)}
.mnav{flex:none;height:48px;box-sizing:content-box;padding-top:env(safe-area-inset-top);display:flex;align-items:center;justify-content:center;position:relative;background:var(--cell);border-bottom:.5px solid var(--line)}
.mnav .mtl{display:flex;align-items:center;gap:8px;max-width:calc(100% - 140px);min-width:0}
.mnav .mtl .mic{width:24px;height:24px;border-radius:6px}
.mnav .mtl .mic svg{width:15px;height:15px}
.mnav .mtt{min-width:0;font-size:17px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.2}
.mnav .mtt small{display:block;font-size:11px;font-weight:400;color:var(--muted);overflow:hidden;text-overflow:ellipsis}
.capsule{position:absolute;right:8px;top:calc(8px + env(safe-area-inset-top));height:32px;width:52px;border-radius:16px;border:.5px solid var(--cap-line);background:var(--cap-bg);display:flex;align-items:center}
.capsule button{flex:1;height:32px;display:grid;place-items:center;position:relative;color:var(--ink)}
.capsule button::after{content:"";position:absolute;inset:-6px 0}
.capsule button svg{width:20px;height:20px;stroke-width:2.2}
.mwhat{flex:none;margin:0;padding:8px 16px;font-size:12.5px;color:var(--muted);background:var(--cell);border-bottom:.5px solid var(--line);text-align:center}
.mini .mbox{position:relative;flex:1;min-height:0;overflow:hidden;background:#fff;padding-bottom:env(safe-area-inset-bottom)}
.mini .mbox .artframe{width:100%;height:100%}
@media (prefers-reduced-motion: reduce){.mini{transition:none}}

.jump{position:absolute;left:50%;bottom:12px;transform:translateX(-50%);min-height:38px;padding:0 16px;border-radius:19px;background:var(--accent);color:var(--accent-ink);font-size:14px;font-weight:600;box-shadow:var(--shadow)}
.jump[hidden]{display:none}

/* the typing bar, as in the demo: field, smiley, and Send once there is text */
.ibar{flex:none;display:flex;align-items:flex-end;gap:4px;padding:7px 6px 7px 10px;background:var(--bar);border-top:.5px solid var(--line);margin:0}
.ibar{padding-bottom:calc(7px + env(safe-area-inset-bottom))}
.ibar.popen{padding-bottom:7px}
.ibar .fieldw{flex:1;min-width:0;display:flex;align-self:center}
.ibar textarea{flex:1;min-width:0;height:40px;min-height:40px;max-height:140px;border:0;border-radius:5px;background:var(--field);padding:9px 10px;font-size:16px;line-height:1.4;resize:none;outline:none}
.ibar textarea:focus-visible{outline:none}
.ibar textarea::placeholder{color:var(--muted)}
.ibar .ib{width:44px;height:44px;display:grid;place-items:center;flex:none;border-radius:8px}
.ibar .ib svg{width:30px;height:30px;stroke-width:1.5}
.ibar .sendbtn{display:none;height:36px;padding:0 14px;margin:0 4px 4px 2px;border-radius:5px;background:var(--accent);color:var(--accent-ink);font-weight:600;font-size:15px;flex:none}
.ibar.has-text .sendbtn{display:block}
.ipanel{flex:none;height:0;overflow:hidden;background:var(--bar);transition:height .24s var(--ease)}
.ipanel.open{height:248px;border-top:.5px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}
.egrid{display:grid;grid-template-columns:repeat(8,1fr);padding:14px 8px;gap:4px;height:100%;overflow-y:auto}
.egrid button{height:42px;font-size:26px;display:grid;place-items:center;border-radius:6px}
.egrid button:active,.egrid button:hover{background:var(--press)}

.nochat{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;color:var(--muted);text-align:center;padding:24px}
.nochat svg{width:44px;height:44px;stroke-width:1.4}
.nochat p{margin:0;font-size:15px}

/* ---------- wide screens: list and chat side by side ---------- */
.wide body{background:var(--quote)}
.wide .app{max-width:1280px;margin:0 auto;border-left:.5px solid var(--line);border-right:.5px solid var(--line)}
.wide .shell .pane-list{display:flex;flex:none;width:360px;border-right:.5px solid var(--line)}
.wide .shell .pane-chat{display:flex}
.wide .chead .back{visibility:hidden}
.wide .front{background:var(--bg)}
.wide .front-in{background:var(--cell);border-radius:16px;margin:48px 0;height:max-content;min-height:0;padding:40px 36px;box-shadow:0 2px 12px rgba(0,0,0,.05)}
.wide .front .sp{flex:none;min-height:20px}
.wide .tpage{max-width:560px;margin:0 auto;border-left:.5px solid var(--line);border-right:.5px solid var(--line)}
.wide .mcol{max-width:min(560px,calc(100% - 100px))}

/* ---------- toast and the profile sheet ---------- */
.toast{position:fixed;left:50%;top:40%;transform:translate(-50%,-50%);z-index:80;max-width:min(320px,80vw);padding:14px 18px;border-radius:10px;background:var(--toast);color:#fff;font-size:15px;text-align:center;pointer-events:none;opacity:0;transition:opacity .18s ease}
.toast.show{opacity:1}
.toast[hidden]{display:none}

.dlg{border:0;padding:0;margin:auto auto 0;width:100%;max-width:480px;max-height:90vh;background:var(--bg);color:var(--ink);border-radius:12px 12px 0 0;box-shadow:var(--shadow)}
.dlg::backdrop{background:var(--scrim)}
.wide .dlg{margin:auto;border-radius:12px}
.dlg[open]{animation:sheetin .28s var(--ease)}
@keyframes sheetin{from{transform:translateY(30px);opacity:0}}
.sheet{display:flex;flex-direction:column;max-height:90vh;padding-bottom:calc(16px + env(safe-area-inset-bottom))}
.sheet .hh{flex:none;display:grid;grid-template-columns:52px 1fr 52px;align-items:center;height:52px;background:var(--cell);border-bottom:.5px solid var(--line);border-radius:12px 12px 0 0}
.sheet .hh h2{margin:0;text-align:center;font-size:16.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sheet .hh h2:focus{outline:none}
.sheetbody{flex:1;min-height:0;overflow-y:auto}
.sheet .mehead{padding:20px 16px}
.iconbtn{width:48px;height:48px;display:grid;place-items:center;border-radius:8px}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}
.listhint{margin:0;padding:14px 20px;text-align:center;color:var(--muted);font-size:13.5px}
.listhint[hidden]{display:none}
.msg.still{animation:none}
.older{display:block;margin:10px auto 2px;min-height:36px;padding:0 16px;border-radius:18px;background:var(--cell);color:var(--accent-text);font-size:14px;font-weight:600;border:.5px solid var(--line)}
.older[hidden]{display:none}
.sheet .note.err{color:var(--red)}
.sheet .note.err[hidden]{display:none}
.sheet .linkbtn.sheetlink{display:block;margin:8px auto 0}

/* ---------- your own picture and name: the first-time setup and My profile (the demo's .mypic and .namef) ---------- */
.av.xl{width:96px;height:96px;border-radius:12px}
button.mehead{width:100%;text-align:left;color:inherit}
button.mehead:active,button.mehead:hover{background:var(--press)}
.mehead .chev{color:var(--muted2);display:grid}
.mehead small.mehint{color:var(--accent-text);font-size:13.5px}
.mypic{display:flex;flex-direction:column;align-items:center;gap:16px;padding:28px 16px 22px;background:var(--cell)}
.mypic .btn{gap:6px}
.mypic .btn:disabled{opacity:.5}
.mypic .linkbtn{margin-top:-8px}
.mypic .linkbtn[hidden]{display:none}
.namef{padding:14px 16px 8px}
.namef label{display:block;font-size:14px;font-weight:600;margin-bottom:6px}
.namef input{width:100%;height:46px;border-radius:8px;border:.5px solid var(--line);background:var(--cell);padding:0 12px;font-size:17px;outline:none}
.namef input:focus-visible{outline:2px solid var(--accent);outline-offset:0}
.namef .hint{display:block;font-size:12.5px;color:var(--muted);margin-top:6px}
.tlede{margin:0;padding:0 16px 14px;color:var(--muted);font-size:15px}
.setup .tfoot .err{padding:8px 16px 0}
.setup .tfoot .err[hidden]{display:none}
.sheet .namef + .note.err{padding-top:4px}
