/* Xpace Chat — one stylesheet. Blue + white, Inter. Desktop ≥1024 three columns; phone <768 stacked with bottom bar. */
:root{
  --blue:#1657D6;--blue-dk:#0F3FA3;--blue-bg:#EAF0FF;--blue-line:#C9D7F6;--blue-soft:#DCEBFF;--blue-ava:#D7E2FA;
  --ink:#141A2B;--ink2:#3B4252;--muted:#5B6475;--line:#E3E8F0;--line2:#F0F2F6;--ground:#F3F5F9;--card:#FFFFFF;--soft:#F7F9FC;
  --green-bg:#E9F9EE;--green:#0B6B33;--green-dot:#1C9A4F;--red-bg:#FDE8E8;--red:#A3261F;--amber-bg:#FFF4E0;--amber:#8A5A00;--amber-dot:#E0A100;
  --grey-bg:#E3E8F0;--purple-bg:#F3E8FF;--purple:#6B2FB3;--orange-bg:#FFF1E6;--orange:#9A4B00;--teal-bg:#E6F4EA;
  --r:12px;--r-lg:16px;--font:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{font:14px/1.45 var(--font);color:var(--ink);background:var(--ground);-webkit-font-smoothing:antialiased}
a{color:var(--blue);text-decoration:none}a:hover{color:var(--blue-dk)}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;border:0;background:none;padding:0}
button:disabled{opacity:.5;cursor:default}
:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
h1,h2,h3{margin:0}
.boot{padding:40px;color:var(--muted);text-align:center}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:40px;padding:0 16px;border-radius:10px;font-weight:600;border:1px solid var(--line);background:var(--card);color:var(--ink);white-space:nowrap}
.btn:hover{background:var(--soft)}
.btn.primary{background:var(--blue);color:#fff;border-color:var(--blue)}.btn.primary:hover{background:var(--blue-dk)}
.btn.outline{border-color:var(--blue);color:var(--blue)}.btn.outline:hover{background:var(--blue-bg)}
.btn.ghost{border-color:transparent;color:var(--muted)}.btn.ghost:hover{background:var(--soft)}
.btn.sm{height:32px;padding:0 12px;font-size:12px;border-radius:8px}
.btn.lg{height:46px;font-size:15px;font-weight:700;border-radius:12px}
.btn.fb{background:#1877F2;color:#fff;border-color:#1877F2;height:44px}
.btn.block{width:100%}
.pill{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 10px;border-radius:999px;border:1px solid var(--line);background:var(--card);color:var(--muted);font-weight:600;font-size:12px;white-space:nowrap}
.pill.on{border-color:var(--blue);background:var(--blue-bg);color:var(--blue)}
.pill.green{border-color:var(--green-dot);background:var(--green-bg);color:var(--green)}
.tag{display:inline-flex;align-items:center;gap:4px;font-size:11px;padding:2px 8px;border-radius:999px;font-weight:600;white-space:nowrap}
.tag.red{background:var(--red-bg);color:var(--red)}.tag.amber{background:var(--amber-bg);color:var(--amber)}
.tag.blue{background:var(--blue-bg);color:var(--blue)}.tag.green{background:var(--green-bg);color:var(--green)}
.tag.grey{background:var(--grey-bg);color:var(--ink2)}.tag.strong{font-weight:700}
.dot{width:8px;height:8px;border-radius:50%;display:inline-block;background:var(--green-dot)}
.dot.amber{background:var(--amber-dot)}.dot.grey{background:#C9D1DE}
.ava{width:40px;height:40px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-weight:600;flex-shrink:0;background:var(--blue-ava);color:var(--blue);font-size:13px}
.ava.sm{width:32px;height:32px;font-size:12px}.ava.ink{background:var(--ink);color:#fff}.ava.blue{background:var(--blue);color:#fff}
.ava.c1{background:var(--teal-bg);color:var(--green)}.ava.c2{background:var(--purple-bg);color:var(--purple)}.ava.c3{background:var(--orange-bg);color:var(--orange)}.ava.c4{background:var(--grey-bg);color:var(--ink2)}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--r-lg)}
.card.pad{padding:18px 20px}
.kicker{font-size:12px;font-weight:700;color:var(--muted);letter-spacing:.04em;text-transform:uppercase}
.kicker.blue{color:var(--blue)}
.muted{color:var(--muted)}.small{font-size:12px}.b{font-weight:600}.bb{font-weight:700}
.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.col{display:flex;flex-direction:column;gap:10px}
.sb{display:flex;justify-content:space-between;align-items:center;gap:8px}
.input,textarea.input,select.input{width:100%;height:42px;border:1px solid var(--line);border-radius:10px;padding:0 12px;background:#fff}
textarea.input{height:auto;padding:10px 12px;line-height:1.5;resize:vertical}
label.f{display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--muted);font-weight:600}
label.f .input{font-weight:400;color:var(--ink);font-size:14px}
.table{width:100%;border-collapse:collapse;font-size:13px}
.table th{text-align:left;font-weight:600;color:var(--muted);padding:10px 12px;background:var(--soft)}
.table td{padding:12px;border-top:1px solid var(--line2);vertical-align:middle}
.empty{padding:28px 20px;color:var(--muted);text-align:center;line-height:1.5}
.banner{padding:10px 14px;border-radius:10px;font-size:13px}
.banner.amber{background:var(--amber-bg);color:var(--amber)}.banner.red{background:var(--red-bg);color:var(--red)}.banner.blue{background:var(--blue-bg);color:var(--blue)}.banner.grey{background:var(--soft);color:var(--muted)}

/* shell */
.app{min-height:100%;display:flex;flex-direction:column}
.topbar{height:56px;background:var(--card);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:16px;padding:0 20px;position:sticky;top:0;z-index:20}
.brand{display:flex;align-items:center;gap:10px;font-weight:700;font-size:16px;color:var(--ink)}
.ver{font-size:11px;font-weight:600;color:var(--muted);background:var(--soft);border-radius:999px;padding:1px 7px;white-space:nowrap}
.tmwrap{position:relative;display:inline-flex}
.tmtag{border:0;cursor:pointer;font-family:inherit}
.tmtag:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.tmq{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;border-radius:50%;border:1.5px solid currentColor;font-size:9px;line-height:1;margin-left:2px}
.tmpop{position:absolute;right:0;top:calc(100% + 10px);width:min(340px,calc(100vw - 24px));background:var(--card);border:1px solid var(--line);border-radius:12px;box-shadow:0 8px 24px rgba(20,26,43,.16);padding:14px;z-index:40;display:flex;flex-direction:column;gap:8px;font-size:13px;line-height:1.45;color:var(--ink);font-weight:400;white-space:normal}
.tmpop[hidden]{display:none}
.tmpop p{margin:0}
.logo{width:28px;height:28px;border-radius:8px;background:var(--blue);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:13px;font-weight:700}
.topnav{display:flex;gap:4px;margin-left:16px}
.topnav a{padding:8px 12px;border-radius:8px;color:var(--muted);font-weight:500}
.topnav a.on{background:var(--blue-bg);color:var(--blue);font-weight:600}
.topright{margin-left:auto;display:flex;align-items:center;gap:12px}
.main{flex:1;display:flex;flex-direction:column;min-height:0}
.page{max-width:1240px;width:100%;margin:0 auto;padding:28px 24px 48px;display:flex;flex-direction:column;gap:22px}
.page.narrow{max-width:900px}
.three{display:flex;flex:1;min-height:0;height:calc(100vh - 56px)}
.three>.left{flex:0 0 340px;background:var(--card);border-right:1px solid var(--line);display:flex;flex-direction:column;overflow:auto}
.three>.mid{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--ground)}
.three>.right{flex:0 0 320px;background:var(--card);border-left:1px solid var(--line);padding:18px;display:flex;flex-direction:column;gap:18px;overflow:auto}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
.grid4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.kpi{padding:16px 18px}.kpi .v{font-size:28px;font-weight:700;margin-top:6px}

/* chat list */
.chatlist .item{display:flex;gap:12px;padding:12px 16px;border-top:1px solid var(--line2);color:var(--ink);width:100%;text-align:left;border-left:3px solid transparent}
.chatlist .item:first-child{border-top:0}
.chatlist .item.on{background:var(--blue-bg);border-left-color:var(--blue)}
.chatlist .item:hover{background:var(--soft)}
.chatlist .body{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.chatlist .t{display:flex;justify-content:space-between;gap:8px}
.chatlist .prev{font-size:13px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chatlist .tags{display:flex;gap:6px;margin-top:3px;flex-wrap:wrap}
.filters{padding:14px 16px 10px;display:flex;flex-direction:column;gap:10px;border-bottom:1px solid var(--line2)}
.filters .row{overflow-x:auto;flex-wrap:nowrap}
.group-h{padding:10px 16px 4px;font-size:11px;font-weight:700;color:var(--muted);letter-spacing:.04em}
.group-h.red{color:var(--red)}

/* conversation */
.convo-h{min-height:56px;background:var(--card);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:12px;padding:8px 20px;flex-wrap:wrap}
.back svg,.btn svg{width:20px;height:20px}
.convo{flex:1;overflow:auto;padding:20px;display:flex;flex-direction:column;gap:12px}
.daysep{align-self:center;font-size:12px;color:var(--muted)}
.sys{align-self:center;font-size:12px;color:var(--muted);background:var(--grey-bg);padding:4px 12px;border-radius:999px;text-align:center}
.msg{max-width:70%;display:flex;flex-direction:column;gap:4px}
.msg.in{align-self:flex-start}.msg.out{align-self:flex-end;align-items:flex-end}
.msg .who{font-size:11px;color:var(--muted);display:flex;gap:6px;align-items:center}
.msg .who b{color:var(--ink)}
.bubble{padding:10px 14px;border-radius:14px;background:var(--card);border:1px solid var(--line);white-space:pre-wrap;word-break:break-word}
.msg.in .bubble{border-bottom-left-radius:4px}
.msg.out .bubble{background:var(--blue-soft);border-color:var(--blue-soft);border-bottom-right-radius:4px}
.bubble.team{border-style:dashed;border-color:#B8C2D3}
.bubble .meta{font-size:11px;color:var(--muted);margin-top:4px}
.msg.out .bubble .meta{text-align:right}
.bubble .tr{font-size:11px;color:var(--muted);margin-top:6px;border-top:1px solid var(--line2);padding-top:6px}
.bubble .tl{font-size:15px;line-height:1.4}
.bubble .orig{font-size:12px;color:var(--muted);margin-top:6px;border-top:1px solid var(--line2);padding-top:6px;line-height:1.4}
.bubble .tgl{font-size:11px;padding:2px 0;min-height:24px;display:block}
.bubble .trnote{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:11px;margin-top:4px}
.bubble .trnote .tag{font-size:10px;padding:1px 7px}
.bubble .trnote .linkbtn{font-size:11px;padding:2px 0;min-height:24px;font-weight:500}
.trswitch{display:flex;align-items:center;gap:6px;margin-left:auto}
.trswitch .trsel{height:30px;padding:0 8px;font-size:12px;width:auto;border-radius:8px}
.trflag{border:1px solid var(--line);border-radius:10px;padding:10px 12px;display:flex;flex-direction:column;gap:4px;font-size:13px}
.trflag.done{opacity:.6}
.draftcard{background:var(--card);border:1px solid var(--blue-line);border-radius:14px;padding:14px 16px;display:flex;flex-direction:column;gap:10px;box-shadow:0 1px 2px rgba(20,26,43,.04)}
.draftcard p{margin:0;line-height:1.5}
.composer{padding:12px 20px 16px;background:var(--card);border-top:1px solid var(--line);display:flex;flex-direction:column;gap:10px}
.composer .line{display:flex;gap:10px;align-items:center}
.composer .line label{flex:1;min-width:0}
.composer .input{height:44px;border-radius:12px}
.popover{position:absolute;bottom:64px;left:20px;right:20px;max-width:520px;background:var(--card);border:1px solid var(--line);border-radius:12px;box-shadow:0 8px 24px rgba(20,26,43,.12);padding:8px;z-index:5;max-height:300px;overflow:auto}
.popover button{display:block;width:100%;text-align:left;padding:10px 12px;border-radius:8px}
.popover button:hover{background:var(--soft)}
.kv{display:grid;grid-template-columns:auto 1fr;gap:10px 12px;font-size:13px}
.kv .k{color:var(--muted)}
.panel-box{border:1px solid var(--line);border-radius:12px;padding:12px;display:flex;flex-direction:column;gap:8px}

/* connect tiles */
.tile{padding:22px;display:flex;flex-direction:column;gap:14px;min-width:0}
.tile.req{border:2px solid var(--blue)}
.qrbox{border:1px solid var(--line);border-radius:12px;padding:14px;display:flex;gap:14px;align-items:center}
.qr{width:112px;height:112px;border-radius:8px;flex-shrink:0;border:6px solid #fff;outline:1px solid var(--line);background:#fff;display:flex;align-items:center;justify-content:center;overflow:hidden}
.qr img{width:100%;height:100%}
.qr.ph{background:repeating-conic-gradient(#141A2B 0 25%,#fff 0 50%) 0 0/16px 16px}
.acct{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;border-radius:10px;background:var(--soft);gap:8px;flex-wrap:wrap}
.acct .row{gap:6px}
.sb>.muted{white-space:nowrap;margin-right:8px}
.steps{display:flex;gap:10px;flex-wrap:wrap}
.step{display:inline-flex;align-items:center;gap:6px;padding:8px 12px;border-radius:10px;font-weight:600;font-size:13px;background:var(--amber-bg);color:var(--amber)}
.step.done{background:var(--green-bg);color:var(--green)}
.radio{border:1px solid var(--line);border-radius:12px;padding:12px;display:flex;gap:10px;align-items:flex-start;cursor:pointer}
.radio.on{border:2px solid var(--blue);background:#F8FAFF}
.radio input{margin-top:3px}

/* internal */
.sugg{border:1px solid var(--blue-line);background:#F8FAFF;border-radius:12px;padding:10px 12px;display:flex;flex-direction:column;gap:8px;font-size:13px;margin-top:4px}
.task{display:flex;gap:10px;align-items:flex-start;padding:10px;border:1px solid var(--line);border-radius:10px}
.task.done .tt{text-decoration:line-through;color:var(--muted)}

/* toasts */
.toasts{position:fixed;right:16px;bottom:16px;display:flex;flex-direction:column;gap:8px;z-index:50}
.toast{background:var(--ink);color:#fff;padding:10px 14px;border-radius:10px;font-size:13px;box-shadow:0 8px 24px rgba(0,0,0,.2);max-width:360px}
.toast.err{background:var(--red)}.toast.ok{background:var(--green)}

/* login */
.login{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px}
.login .card{width:100%;max-width:400px;padding:28px;display:flex;flex-direction:column;gap:14px}

/* mobile */
.bottombar{display:none}
.back{display:none}
.phone-only{display:none}
@media (max-width:1023px){
  .three>.right{display:none}
  .three>.right.open{display:flex;position:fixed;inset:56px 0 0 0;z-index:30;overflow:auto}
  .three>.left{flex:0 0 300px}
  .grid3{grid-template-columns:1fr}.grid4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .phone-only{display:inline-flex}
}
@media (max-width:767px){
  .topnav,.topright .hide-m{display:none}
  .tmwrap{position:static}
  .tmpop{position:fixed;left:12px;right:12px;top:64px;width:auto}
  .topbar{padding:0 16px}
  .main{padding-bottom:84px}
  .three{height:auto;min-height:calc(100vh - 140px);flex-direction:column}
  .three>.left{flex:1;border-right:0}
  .three>.mid{display:none}
  .three.showmid>.left{display:none}
  .three.showmid>.mid{display:flex;position:fixed;left:0;right:0;top:56px;bottom:84px;z-index:15}
  .three.showmid>.right.open{inset:56px 0 84px 0}
  .hide-m{display:none !important}
  .convo-h{padding:8px 12px;gap:8px}
  .convo-h .tag{font-size:11px}
  .back{display:inline-flex}
  .msg{max-width:86%}
  .page{padding:16px 16px 40px;gap:16px}
  .grid2{grid-template-columns:1fr}.grid4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .bottombar{display:grid;position:fixed;left:0;right:0;bottom:0;height:84px;background:var(--card);border-top:1px solid var(--line);grid-template-columns:repeat(5,minmax(0,1fr));padding:8px 8px calc(16px + env(safe-area-inset-bottom));z-index:20}
  .bottombar a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;font-size:11px;font-weight:600;color:var(--muted);border-radius:10px;min-height:44px}
  .bottombar a.on{color:var(--blue);background:var(--blue-bg);font-weight:700}
  .bottombar svg{width:22px;height:22px}
  .draftcard .row .btn{flex:1}
  .composer{padding:10px 14px 14px}
  .composer .line{flex-wrap:wrap}
  .composer .line label{flex:1 1 100%}
  .composer .line .btn{flex:1}
  .popover{left:12px;right:12px}
  .table-wrap{overflow-x:auto}
}

/* calendar picker */
.dp-overlay{position:fixed;inset:0;background:rgba(20,26,43,.45);display:flex;align-items:center;justify-content:center;z-index:50;padding:16px}
.dp-box{background:var(--card);border-radius:16px;box-shadow:0 16px 48px rgba(20,26,43,.28);width:100%;max-width:360px;max-height:100%;overflow:auto;padding:16px;display:flex;flex-direction:column;gap:12px}
.dp-head{display:flex;align-items:center;justify-content:space-between;font-size:16px}
.dp-quick{display:flex;gap:8px;flex-wrap:wrap}
.dp-nav{display:flex;align-items:center;justify-content:space-between}
.dp-month{text-transform:capitalize}
.dp-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
.dp-dow{text-align:center;padding:4px 0}
.dp-day{height:40px;border-radius:10px;border:1px solid transparent;background:var(--card);font:inherit;color:var(--ink);cursor:pointer}
.dp-day:hover:not([disabled]){background:var(--blue-bg)}
.dp-day[disabled]{color:#B5BCC9;cursor:not-allowed}
.dp-day.today{border-color:var(--blue-line)}
.dp-day.sel{background:var(--blue);color:#fff;border-color:var(--blue)}
.dp-day:focus-visible,.dp-sel:focus-visible{outline:2px solid var(--blue-dk);outline-offset:2px}
.dp-time{gap:8px;align-items:center;flex-wrap:nowrap}
select.input.dp-sel{width:auto;min-width:84px}
.dp-chosen{font-size:13px}
.dp-warn{color:var(--red);min-height:18px}
.dp-actions{justify-content:flex-end;gap:8px}
@media (max-width:480px){.dp-overlay{align-items:flex-end;padding:0}.dp-box{max-width:none;border-radius:16px 16px 0 0}.dp-day{height:44px}}

/* 0.6.0: the "what to do next" line at the top of each page, the went-live notice, the Scheduled list */
.nextbar{display:flex;gap:10px;align-items:baseline;padding:9px 24px;background:var(--blue-bg);color:var(--ink);font-size:13px;line-height:1.45;border-bottom:1px solid var(--blue-line)}
.nextbar .nb-k{font-weight:700;color:var(--blue);white-space:nowrap}
.main.hasnext .three{height:calc(100vh - 56px - 38px)}
@media (max-width:767px){.nextbar{padding:8px 16px}.main.hasnext .three{height:auto}}
.sch-row{display:flex;gap:12px;align-items:flex-start;flex-wrap:wrap}
.sch-row .grow{flex:1 1 260px;min-width:0}
.sch-actions{display:flex;gap:8px;flex-wrap:wrap}
.guide{counter-reset:g;list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.guide>li{counter-increment:g;display:flex;gap:10px;align-items:flex-start;line-height:1.5}
.guide>li::before{content:counter(g);flex:0 0 24px;height:24px;border-radius:50%;background:var(--blue-bg);color:var(--blue);font-weight:700;font-size:12px;display:flex;align-items:center;justify-content:center;margin-top:1px}
.copyrow{display:flex;gap:8px;align-items:center}.copyrow .input{flex:1;min-width:0;font-family:ui-monospace,monospace;font-size:13px}
.route{display:inline-flex;gap:0;border:1px solid var(--line);border-radius:10px;overflow:hidden}
.route button{border:0;background:var(--card);padding:7px 12px;font:inherit;font-size:13px;cursor:pointer;color:var(--ink)}
.route button.on{background:var(--blue);color:#fff}
.route button:focus-visible{outline:2px solid var(--blue);outline-offset:-2px}

.helplink{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;border:1px solid var(--line);color:var(--muted);font-weight:700;margin-right:8px}
.helplink.on,.helplink:hover{background:var(--blue-bg);color:var(--blue);border-color:var(--blue-line)}
.helpq summary{cursor:pointer;font-weight:600;padding:2px 0}
.helpq p,.helpq li{line-height:1.6}

/* 0.6.1: show-password eye, sign-in links, page footer */
.pwwrap{position:relative;display:block;width:100%}
.pwwrap>.input{padding-right:46px}
.pweye{position:absolute;top:0;right:0;width:44px;height:100%;min-height:42px;display:flex;align-items:center;justify-content:center;background:none;border:0;color:var(--muted);cursor:pointer;border-radius:0 10px 10px 0}
.pweye:hover,.pweye[aria-pressed=true]{color:var(--blue)}
.linkbtn{background:none;border:0;padding:6px 2px;min-height:32px;color:var(--blue);font:inherit;font-weight:600;cursor:pointer;align-self:center}
.linkbtn:hover{color:var(--blue-dk);text-decoration:underline}.linkbtn:disabled{color:var(--muted);cursor:default;text-decoration:none}
.input.code{font-size:22px;letter-spacing:.35em;text-align:center;font-weight:700;font-variant-numeric:tabular-nums}
.banner.green{background:var(--green-bg);color:var(--green)}
.login{flex-direction:column;gap:14px}
.appfoot{flex:0 0 auto;padding:8px 16px;text-align:center;font-size:12px;line-height:16px;color:var(--muted)}
.main>.appfoot{border-top:1px solid var(--line);background:var(--ground)}
@media (min-width:1024px){.main:has(>.appfoot) .three{height:calc(100vh - 56px - 33px)}}

/* 0.8.6: the app stays inside the screen. Lists scroll inside their own box, not the whole page. */
@supports (height:100dvh){
  .three{height:calc(100dvh - 56px)}
  .main.hasnext .three{height:calc(100dvh - 56px - 38px)}
}
@media (min-width:1024px){@supports (height:100dvh){.main:has(>.appfoot) .three{height:calc(100dvh - 56px - 33px)}}}
@media (max-width:767px){
  .three,.main.hasnext .three{height:calc(100vh - 56px - 84px);min-height:0}
  .main.hasnext .three{height:calc(100vh - 56px - 84px - 38px)}
  @supports (height:100dvh){.three{height:calc(100dvh - 56px - 84px)}.main.hasnext .three{height:calc(100dvh - 56px - 84px - 38px)}}
  .three>.left{min-height:0;overflow:auto;-webkit-overflow-scrolling:touch}
}
.table-wrap.fit{max-height:calc(100vh - 140px);min-height:260px;overflow:auto}
@supports (height:100dvh){.table-wrap.fit{max-height:calc(100dvh - 140px)}}
.table-wrap.fit thead th{position:sticky;top:0;background:var(--card);z-index:1}

/* 0.8.7: the chat window itself stays inside the screen: messages scroll in the middle, the text box stays at the bottom */
.three{flex:0 0 auto}
.three>.left,.three>.mid,.three>.right{min-height:0}
.three>.mid{overflow:hidden}
.convo{min-height:0}
@media (max-width:767px){
  .main:has(.three.showmid)>.appfoot{display:none}
  html:has(.three.showmid),body:has(.three.showmid){overflow:hidden;height:100%}
}
.three>.right>*{flex-shrink:0}
/* 0.9.9: pictures in the chat, in the composer and in the picker */
.bubble img.pic{display:block;max-width:240px;max-height:300px;border-radius:10px;margin-top:6px}
.chip-pic{width:22px;height:22px;object-fit:cover;border-radius:4px;vertical-align:middle;margin-right:4px}
.picker{position:fixed;inset:0;background:rgba(20,26,43,.45);z-index:60;display:flex;align-items:center;justify-content:center;padding:16px}
.picker-card{background:var(--card);border-radius:14px;max-width:760px;width:100%;max-height:88vh;display:flex;flex-direction:column;padding:16px}
.picker-body{overflow:auto;flex:1;min-height:120px}
.pgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:8px}
.pcell{position:relative;display:flex;flex-direction:column;gap:2px;border:2px solid var(--line);border-radius:10px;padding:4px;cursor:pointer}
.pcell.on{border-color:var(--blue,#2563eb)}
.pcell input{position:absolute;top:8px;left:8px;width:18px;height:18px}
.pcell img{width:100%;aspect-ratio:3/4;object-fit:cover;border-radius:6px}
.pdel{position:absolute;top:6px;right:6px;width:22px;height:22px;border-radius:50%;border:0;background:rgba(0,0,0,.6);color:#fff;cursor:pointer;line-height:1}
