/* The communication center (inbox.html, assets/inbox.js), on top of ui.css and shell.css.
   Four panes, right to left: the inbox's menu (views, type, channels, labels), the conversations, the conversation,
   and the customer's details. Narrower screens fold the menu into a drawer, phones show one pane at a time. */

.ib-main{background:var(--surface)}
.ib{--nav-w:236px;--list-w:350px;--info-w:300px;flex:1;min-height:0;display:grid;grid-template-columns:var(--nav-w) var(--list-w) minmax(0,1fr);position:relative}
.ib.info-open{grid-template-columns:var(--nav-w) var(--list-w) minmax(0,1fr) var(--info-w)}

/* channel colours and marks */
.chm{--c:var(--primary);width:22px;height:22px;border-radius:7px;display:inline-grid;place-items:center;color:#fff;background:var(--c);flex:none}
.chm svg{width:13px;height:13px}
.chm.whatsapp{--c:#22C35E}
.chm.instagram{background:linear-gradient(45deg,#F58529,#DD2A7B 50%,#8134AF)}
.chm.facebook{--c:#0866FF}
.chm.sm{width:18px;height:18px;border-radius:6px}
.chm.sm svg{width:11px;height:11px}

/* ---------- the menu ---------- */
.ib-nav{display:flex;flex-direction:column;min-height:0;background:var(--side-bg);border-left:1px solid var(--line)}
.nav-h{display:flex;align-items:center;gap:6px;height:var(--head-h);padding:0 14px 0 8px;flex:none}
.nav-h h1{font-size:16.5px;font-weight:700;flex:1;letter-spacing:-.005em}
.nav-h .side-open{margin-inline-start:-6px}
.nav-close{display:none}
.nav-scroll{flex:1;min-height:0;overflow-y:auto;padding:2px 10px 12px}
.nv{position:relative;display:flex;align-items:center;gap:10px;width:100%;height:34px;padding:0 10px;border:0;border-radius:var(--r-md);background:transparent;color:var(--ink-2);
  font-size:13.5px;font-weight:500;text-align:start;transition:background-color var(--t-fast),color var(--t-fast)}
.nv>svg{width:17px;height:17px;flex:none;color:var(--stone)}
.nv:hover{background:var(--hover);color:var(--ink)}
.nv[aria-current="true"]{background:var(--primary-soft);color:var(--primary-ink);font-weight:600}
.nv[aria-current="true"]>svg{color:var(--primary)}
.nv .t{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nv .ct{font-size:11.5px;font-weight:600;color:var(--faint);font-variant-numeric:tabular-nums}
.nv .ct.warn,.nv .ct.ai{min-width:20px;height:20px;padding:0 6px;border-radius:var(--r-full);display:grid;place-items:center}
.nv .ct.warn{background:var(--warn-soft);color:var(--warn);box-shadow:inset 0 0 0 1px var(--warn-line)}
.nv .ct.ai{background:var(--primary-soft);color:var(--primary-ink);box-shadow:inset 0 0 0 1px var(--primary-line)}
.nv.off{color:var(--faint)}
.nv.off .chm{filter:grayscale(1);opacity:.5}
.nv .add{font-size:11.5px;font-weight:600;color:var(--faint)}
.nv.off:hover .add{color:var(--primary-ink)}
.lbl-chips{display:flex;flex-wrap:wrap;gap:6px;padding:2px 8px 6px}
.lchip{height:26px;padding:0 10px;border-radius:var(--r-full);border:0;font-size:12px;font-weight:600;background:color-mix(in srgb,var(--lc) 11%,#fff);color:color-mix(in srgb,var(--lc) 78%,#000);transition:box-shadow var(--t-fast)}
.lchip:hover{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--lc) 40%,#fff)}
.lchip[aria-pressed="true"]{box-shadow:inset 0 0 0 1.5px var(--lc)}
.nv-sec{font-size:11.5px;font-weight:600;color:var(--faint);padding:16px 10px 5px;letter-spacing:.01em}
.nav-f{flex:none;padding:10px;border-top:1px solid var(--line)}
/* the assistant, at the bottom of the menu: the card opens its settings, the switch turns it on or off */
.ai-card{display:flex;align-items:center;gap:10px;padding:8px 12px 8px 8px;border-radius:var(--r-lg);background:var(--surface);
  box-shadow:inset 0 0 0 1px var(--sand),var(--sh-xs);transition:box-shadow var(--t-fast)}
.ai-card:hover{box-shadow:inset 0 0 0 1px var(--primary-line),var(--sh-sm)}
.ai-main{display:flex;align-items:center;gap:10px;flex:1;min-width:0;border:0;background:none;padding:0;text-align:start}
.ai-t{min-width:0}
.ai-card .spk{width:30px;height:30px;border-radius:9px;display:grid;place-items:center;flex:none;color:#fff;background:var(--grad);box-shadow:0 4px 10px -4px rgba(139,61,255,.6)}
.ai-card .spk svg{width:16px;height:16px}
.ai-card.off .spk{background:var(--soft-2);color:var(--stone);box-shadow:none}
.ai-card b{display:block;font-size:13px;font-weight:600;color:var(--ink)}
.ai-card small{display:block;font-size:11.5px;color:var(--stone);line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* switches */
.sw{position:relative;width:36px;height:20px;border-radius:99px;background:var(--line-strong);flex:none;transition:background-color var(--t)}
.sw::after{content:"";position:absolute;top:2px;right:2px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.25);transition:transform var(--t) var(--ease)}
.sw.on{background:var(--primary)}
.sw.on::after{transform:translateX(-16px)}
button.sw{border:0;padding:0}

/* ---------- the list ---------- */
.ib-list{display:flex;flex-direction:column;min-height:0;border-left:1px solid var(--line);background:var(--surface)}
.list-h{flex:none;padding:10px 12px 0;border-bottom:1px solid var(--line)}
.list-top{display:flex;align-items:center;gap:6px}
.nav-open{display:none}
.list-search{flex:1;display:flex;align-items:center;gap:8px;height:38px;padding:0 10px;border-radius:var(--r-md);border:1px solid var(--sand);background:var(--surface);box-shadow:var(--sh-xs);
  transition:border-color var(--t-fast),box-shadow var(--t-fast);min-width:0}
.list-search:focus-within{border-color:var(--primary);box-shadow:var(--ring)}
.list-search svg{width:16px;height:16px;color:var(--faint);flex:none}
.list-search input{flex:1;min-width:0;border:0;outline:0;background:transparent;font-size:13.5px;height:100%}
.list-search input::-webkit-search-cancel-button{cursor:pointer}
.list-search kbd{flex:none}
.list-search:focus-within kbd{display:none}
.chips{display:flex;align-items:center;gap:6px;overflow-x:auto;padding:10px 0;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.type-seg{flex:none}
.type-seg button{display:inline-flex;align-items:center;gap:5px}
.type-seg .n{font-size:11px;font-weight:600;color:var(--primary-ink);font-variant-numeric:tabular-nums}
.fchip{flex:none;display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 8px 0 10px;border-radius:var(--r-full);border:0;background:var(--primary-soft);
  color:var(--primary-ink);font-size:12.5px;font-weight:600;white-space:nowrap}
.fchip>svg{width:13px;height:13px;opacity:.7}
.fchip:hover>svg{opacity:1}
.fchip .lbl-dot{width:9px;height:9px;border-radius:3px;background:var(--lc)}
.list-note{flex:none;display:flex;align-items:flex-start;gap:10px;margin:10px 12px 0;padding:10px 12px;border-radius:var(--r-md);font-size:12.5px;line-height:1.6;background:var(--warn-soft);color:var(--warn);box-shadow:inset 0 0 0 1px var(--warn-line)}
.list-note svg{width:16px;height:16px;flex:none;margin-top:2px}
.list-note b{font-weight:600}
.list-note a,.list-note button{color:inherit;font-weight:600;text-decoration:underline;background:none;border:0;padding:0;font-size:inherit}
.list-note.info{background:var(--primary-soft);color:var(--primary-ink);box-shadow:inset 0 0 0 1px var(--primary-line)}
.rows{flex:1;min-height:0;overflow-y:auto;outline:0;padding:4px 0}
.cv{position:relative;display:flex;gap:11px;width:100%;padding:11px 14px 11px 12px;border:0;background:transparent;text-align:start;cursor:pointer;transition:background-color var(--t-fast)}
.cv+.cv::before{content:"";position:absolute;top:0;right:62px;left:14px;height:1px;background:var(--line)}
.cv:hover{background:#FAFAFB}
.cv[aria-selected="true"]{background:var(--primary-soft)}
.cv[aria-selected="true"]::before,.cv[aria-selected="true"]+.cv::before{opacity:0}
.cv.unread .cv-nm{font-weight:700;color:var(--ink)}
.cv.unread .snip{color:var(--ink-2);font-weight:500}
.ava{--h:260;position:relative;width:40px;height:40px;border-radius:50%;flex:none;display:grid;place-items:center;font-size:15px;font-weight:700;
  color:hsl(var(--h) 42% 36%);background:hsl(var(--h) 72% 93%)}
.ava .chm{position:absolute;bottom:-3px;left:-3px;width:18px;height:18px;border-radius:6px;box-shadow:0 0 0 2px var(--surface)}
.ava .chm svg{width:10px;height:10px}
.cv[aria-selected="true"] .ava .chm{box-shadow:0 0 0 2px var(--primary-soft)}
.ava.lg{width:64px;height:64px;font-size:24px}
.ava.lg .chm{width:24px;height:24px;border-radius:8px}
.ava.lg .chm svg{width:13px;height:13px}
.cv-main{flex:1;min-width:0;display:grid;gap:3px}
.cv-top{display:flex;align-items:center;gap:6px;min-width:0}
.cv-nm{font-size:14px;font-weight:600;color:var(--ink);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cv-top time{margin-inline-start:auto;font-size:11.5px;color:var(--faint);white-space:nowrap;font-variant-numeric:tabular-nums}
.cv.unread .cv-top time{color:var(--primary-ink);font-weight:600}
.cv-top .star{width:13px;height:13px;color:#F2A100;flex:none}
.cv-bot{display:flex;align-items:center;gap:8px;min-width:0}
.snip{flex:1;min-width:0;font-size:13px;color:var(--stone);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.5}
.snip .who{color:var(--ink-3);font-weight:500}
.snip .who.ai{color:var(--primary-ink)}
.badge-n{min-width:20px;height:20px;padding:0 6px;border-radius:var(--r-full);display:grid;place-items:center;background:var(--primary);color:#fff;font-size:11px;font-weight:700;flex:none;font-variant-numeric:tabular-nums}
.tags{display:flex;flex-wrap:wrap;gap:4px;margin-top:3px}
.tg{display:inline-flex;align-items:center;gap:4px;height:20px;padding:0 7px;border-radius:6px;font-size:11px;font-weight:600;background:var(--soft);color:var(--ink-3);white-space:nowrap}
.tg svg{width:11px;height:11px}
.tg.human{background:var(--warn-soft);color:var(--warn)}
.tg.draft{background:var(--primary-soft);color:var(--primary-ink)}
.tg.comment{background:var(--info-soft);color:var(--info)}
.tg.window{background:var(--bad-soft);color:var(--bad)}
.tg.snooze{background:var(--soft);color:var(--stone)}
.tg.lbl{background:color-mix(in srgb,var(--lc) 12%,#fff);color:color-mix(in srgb,var(--lc) 80%,#000)}
.rows .more{display:block;margin:8px auto 14px}
.rows .empty{display:grid;justify-items:center;gap:6px;text-align:center;padding:56px 24px;color:var(--stone)}
.empty .em-ic{width:52px;height:52px;border-radius:50%;display:grid;place-items:center;background:var(--soft);color:var(--faint);margin-bottom:6px;box-shadow:0 0 0 6px #FAFAFB}
.empty .em-ic svg{width:22px;height:22px}
.empty b{font-size:14px;color:var(--ink)}
.empty p{margin:0;font-size:13px;line-height:1.7;max-width:300px}
.empty .btn{margin-top:10px}
.skel-row{display:flex;gap:11px;padding:12px 14px}
.skel-row .skel:first-child{width:40px;height:40px;border-radius:50%;flex:none}
.skel-row div{flex:1;display:grid;gap:8px;align-content:center}

/* label colours */
[data-lc="violet"]{--lc:#7232F2}[data-lc="blue"]{--lc:#2F55E4}[data-lc="green"]{--lc:#0F8A5F}[data-lc="amber"]{--lc:#C27803}
[data-lc="red"]{--lc:#D0312D}[data-lc="pink"]{--lc:#D6337A}[data-lc="teal"]{--lc:#0E8C8C}[data-lc="gray"]{--lc:#6B6B75}

/* ---------- the conversation ---------- */
.ib-thread{display:flex;flex-direction:column;min-height:0;min-width:0;background:var(--app)}
.th-empty{flex:1;display:grid;place-content:center;justify-items:center;text-align:center;gap:6px;padding:24px;color:var(--stone)}
.th-empty kbd{margin:0 2px}
.th-head{flex:none;display:flex;align-items:center;gap:10px;min-height:var(--head-h);padding:8px 16px;background:rgba(255,255,255,.92);border-bottom:1px solid var(--line);
  backdrop-filter:saturate(1.6) blur(10px);-webkit-backdrop-filter:saturate(1.6) blur(10px);position:relative;z-index:3}
.th-back{display:none}
.th-who{display:flex;align-items:center;gap:10px;min-width:0;flex:1;border:0;background:none;padding:2px 4px;border-radius:var(--r-md);text-align:start}
.th-who:hover{background:var(--hover)}
.th-who .ava{width:36px;height:36px;font-size:14px}
.th-who .who-t{flex:1;min-width:0}
.th-who b{display:block;font-size:14.5px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.th-who small{display:block;font-size:12px;color:var(--stone);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.th-who small .chm{display:inline-grid;width:15px;height:15px;border-radius:5px;vertical-align:-3px;margin-inline-end:5px}
.th-who small .chm svg{width:9px;height:9px}
.th-acts{display:flex;align-items:center;gap:2px;flex:none}
.th-acts .ic-btn[aria-pressed="true"]{color:#E59A00}
.th-acts .sep{width:1px;height:20px;background:var(--line);margin:0 4px}
.ai-pill{display:inline-flex;align-items:center;gap:7px;height:32px;padding:0 11px 0 9px;border-radius:var(--r-full);border:0;font-size:12.5px;font-weight:600;
  background:var(--soft);color:var(--ink-3);transition:background-color var(--t-fast),box-shadow var(--t-fast);white-space:nowrap}
.ai-pill svg{width:15px;height:15px}
.ai-pill .d{width:7px;height:7px;border-radius:50%;background:var(--ghost)}
.ai-pill.auto{background:linear-gradient(135deg,#F4F0FF,#FCEFF8);color:var(--primary-ink);box-shadow:inset 0 0 0 1px var(--primary-line)}
.ai-pill.auto .d{background:var(--ok);box-shadow:0 0 0 3px rgba(15,123,85,.15);animation:pulse 2s infinite}
.ai-pill.draft{background:var(--info-soft);color:var(--info)}
.ai-pill.draft .d{background:var(--info)}
.ai-pill:hover{filter:brightness(.98)}
@keyframes pulse{50%{box-shadow:0 0 0 5px rgba(15,123,85,0)}}

.th-strip{flex:none;display:flex;align-items:center;gap:10px;padding:9px 16px;font-size:12.5px;line-height:1.55;border-bottom:1px solid var(--line)}
.th-strip svg{width:16px;height:16px;flex:none}
.th-strip .tx{flex:1;min-width:0}
.th-strip .btn{height:28px;font-size:12px;padding:0 10px}
.th-strip.human{background:var(--warn-soft);color:var(--warn);border-color:var(--warn-line)}
.th-strip.paused{background:var(--soft);color:var(--ink-3)}
.th-strip.window{background:var(--bad-soft);color:var(--bad);border-color:var(--bad-line)}
.th-strip.soon{background:#FFF9EC;color:var(--warn)}

.th-scroll{flex:1;min-height:0;overflow-y:auto;padding:18px 22px 8px;scroll-behavior:auto}
.th-post{display:flex;gap:12px;align-items:center;max-width:560px;margin:0 auto 18px;padding:10px;border-radius:var(--r-lg);background:var(--surface);box-shadow:0 0 0 1px var(--line),var(--sh-xs)}
.th-post img,.th-post .ph{width:56px;height:56px;border-radius:var(--r-md);object-fit:cover;flex:none;background:var(--soft)}
.th-post .ph{display:grid;place-items:center;color:var(--faint)}
.th-post .ph svg{width:20px;height:20px}
.th-post div{min-width:0;flex:1}
.th-post small{display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--faint);font-weight:600}
.th-post small svg{width:13px;height:13px;flex:none}
.th-post p{margin:2px 0 0;font-size:13px;color:var(--ink-2);overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;line-height:1.55}
.th-post a{font-size:12px;font-weight:600;white-space:nowrap}
.daysep{display:flex;justify-content:center;margin:14px 0 10px}
.daysep span{font-size:11.5px;font-weight:600;color:var(--stone);background:var(--surface);padding:3px 10px;border-radius:var(--r-full);box-shadow:0 0 0 1px var(--line)}

.msg{display:flex;flex-direction:column;align-items:flex-start;margin:3px 0;max-width:100%}
.msg.out{align-items:flex-end}
.msg+.msg.gap{margin-top:12px}
.bub{position:relative;max-width:min(560px,78%);padding:8px 12px 6px;border-radius:16px;font-size:14px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere;
  background:var(--surface);color:var(--ink);box-shadow:0 0 0 1px var(--line),0 1px 1px rgba(18,18,28,.03)}
.msg.in .bub{border-start-start-radius:6px}
.msg.out .bub{background:#EEE8FF;box-shadow:none;border-start-end-radius:6px}
.msg.ai .bub{background:linear-gradient(140deg,#F3EEFF 0%,#FBEFF8 100%);box-shadow:inset 0 0 0 1px #E4D8FF}
.msg.private .bub{background:#E8F1FF}
.bub .att{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;color:var(--stone);font-weight:500}
.bub .att+.tx{display:block;margin-top:4px}
.msg-meta{display:flex;align-items:center;gap:6px;margin-top:3px;padding:0 6px;font-size:11px;color:var(--faint);white-space:nowrap}
.msg-meta .by{display:inline-flex;align-items:center;gap:4px;font-weight:600;color:var(--ink-3)}
.msg-meta .by.ai{color:var(--primary-ink)}
.msg-meta .by svg{width:12px;height:12px}
.msg-meta .bad{color:var(--bad);font-weight:600}
.msg-meta .hid{color:var(--warn);font-weight:600}
.msg-meta button{border:0;background:none;padding:0 2px;font-size:11px;font-weight:600;color:var(--primary-ink);cursor:pointer}
.msg-meta button:hover{text-decoration:underline}
.msg.removed .bub,.msg.hidden .bub{opacity:.55}
.msg.removed .bub .tx{text-decoration:line-through}
.msg.failed .bub{box-shadow:inset 0 0 0 1px var(--bad-line);background:var(--bad-soft)}
.msg .cm-acts{display:none;gap:2px;margin-top:2px}
.msg.in:hover .cm-acts,.msg.in:focus-within .cm-acts{display:flex}
.cm-acts button{height:24px;padding:0 8px;border-radius:6px;border:0;background:var(--surface);box-shadow:0 0 0 1px var(--line);font-size:11.5px;font-weight:600;color:var(--ink-3)}
.cm-acts button:hover{background:var(--soft);color:var(--ink)}
/* the assistant's draft, waiting for the owner */
.msg.draft .bub{background:var(--surface);box-shadow:none;border:1.5px dashed var(--primary-line);border-start-end-radius:6px}
.draft-h{display:flex;align-items:center;gap:6px;font-size:11.5px;font-weight:700;color:var(--primary-ink);margin-bottom:4px}
.draft-h svg{width:13px;height:13px}
.draft-h .why{font-weight:500;color:var(--warn)}
.draft-acts{display:flex;gap:6px;margin-top:6px;flex-wrap:wrap;justify-content:flex-end}
.draft-acts .btn{height:28px;font-size:12px;padding:0 10px}
/* lines from the system */
.sysnote{display:flex;justify-content:center;margin:12px 0}
.sysnote span{display:inline-flex;align-items:center;gap:7px;max-width:min(520px,92%);font-size:12px;line-height:1.55;color:var(--ink-3);background:var(--surface);
  padding:5px 12px;border-radius:var(--r-full);box-shadow:0 0 0 1px var(--line);text-align:center}
.sysnote.warn span{color:var(--warn);background:var(--warn-soft);box-shadow:0 0 0 1px var(--warn-line)}
.sysnote.ai span{color:var(--primary-ink);background:var(--primary-soft);box-shadow:0 0 0 1px var(--primary-line)}
.sysnote svg{width:14px;height:14px;flex:none}
.typing{display:flex;align-items:center;gap:8px;margin:10px 0 4px;font-size:12px;color:var(--primary-ink);font-weight:600}
.typing i{display:inline-flex;gap:3px}
.typing i b{width:5px;height:5px;border-radius:50%;background:currentColor;animation:dot 1.2s infinite}
.typing i b:nth-child(2){animation-delay:.15s}.typing i b:nth-child(3){animation-delay:.3s}
@keyframes dot{0%,80%,100%{opacity:.25;transform:none}40%{opacity:1;transform:translateY(-2px)}}

/* the composer */
.composer{flex:none;padding:10px 16px 14px;background:var(--app)}
.cmp{position:relative;border-radius:var(--r-xl);background:var(--surface);box-shadow:0 0 0 1px var(--sand),var(--sh-sm);transition:box-shadow var(--t-fast)}
.cmp:focus-within{box-shadow:0 0 0 1px var(--primary),var(--ring),var(--sh-sm)}
.cmp.private{box-shadow:0 0 0 1px #9DBBFF,var(--sh-sm)}
.cmp-top{display:flex;align-items:center;gap:8px;padding:8px 10px 0}
.seg{display:inline-flex;gap:2px;padding:3px;border-radius:var(--r-md);background:var(--soft)}
.seg button{height:26px;padding:0 10px;border:0;border-radius:var(--r-sm);background:transparent;font-size:12px;font-weight:600;color:var(--ink-3);white-space:nowrap}
.seg button[aria-selected="true"],.seg button[aria-pressed="true"]{background:var(--surface);color:var(--ink);box-shadow:var(--sh-sm)}
.cmp-edit{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:600;color:var(--primary-ink)}
.cmp-edit svg{width:13px;height:13px}
.cmp-edit button{border:0;background:none;color:var(--stone);font-size:12px;padding:0 4px;text-decoration:underline}
.cmp textarea{display:block;width:100%;min-height:52px;max-height:220px;resize:none;border:0;outline:0;background:transparent;padding:10px 14px 4px;font-size:14px;line-height:1.65}
.cmp-bar{display:flex;align-items:center;gap:4px;padding:4px 8px 8px}
.cmp-bar .ic-btn{width:32px;height:32px}
.cmp-bar .tool{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 10px;border-radius:var(--r-sm);border:0;background:transparent;font-size:12.5px;font-weight:600;color:var(--ink-3);white-space:nowrap}
.cmp-bar .tool svg{width:16px;height:16px}
.cmp-bar .tool:hover{background:var(--hover);color:var(--ink)}
.cmp-bar .tool.magic{color:var(--primary-ink)}
.cmp-bar .tool.magic:hover{background:var(--primary-soft)}
.cmp-bar .tool[aria-busy="true"]{pointer-events:none;opacity:.7}
.cmp-bar .tool[aria-busy="true"] svg{animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.cmp-bar .hint{margin-inline-start:auto;font-size:11px;color:var(--faint);white-space:nowrap}
.cmp-bar .count{font-size:11px;color:var(--faint);font-variant-numeric:tabular-nums}
.cmp-bar .count.over{color:var(--bad);font-weight:600}
.send{width:36px;height:36px;border-radius:50%;border:0;display:grid;place-items:center;background:var(--primary);color:#fff;flex:none;
  box-shadow:0 4px 12px -4px rgba(114,50,242,.6);transition:background-color var(--t-fast),transform var(--t-fast)}
.send svg{width:17px;height:17px;transform:scaleX(-1)}
.send:hover:not(:disabled){background:var(--primary-h)}
.send:active:not(:disabled){transform:scale(.96)}
.send:disabled{background:var(--soft-2);color:var(--faint);box-shadow:none}
.cmp-closed{display:flex;align-items:center;gap:10px;padding:14px;border-radius:var(--r-xl);background:var(--surface);box-shadow:0 0 0 1px var(--line);font-size:13px;color:var(--stone);line-height:1.6}
.cmp-closed svg{width:18px;height:18px;flex:none;color:var(--faint)}
/* saved replies picker (typing "/" or the button) */
.picker{position:absolute;bottom:calc(100% + 8px);right:0;left:0;max-height:300px;overflow-y:auto;background:var(--surface);border-radius:var(--r-lg);box-shadow:var(--sh-pop);padding:6px;z-index:10}
.picker .pk{display:grid;gap:2px;width:100%;padding:8px 10px;border:0;border-radius:var(--r-sm);background:transparent;text-align:start}
.picker .pk b{font-size:13px;font-weight:600}
.picker .pk span{font-size:12px;color:var(--stone);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.picker .pk:hover,.picker .pk.on{background:var(--soft)}
.picker .pk-empty{padding:12px;font-size:12.5px;color:var(--stone);text-align:center}
.picker .pk-foot{display:flex;justify-content:center;padding:6px;border-top:1px solid var(--line);margin-top:4px}

/* ---------- the customer ---------- */
.ib-info{display:flex;flex-direction:column;min-height:0;background:var(--surface);border-right:1px solid var(--line)}
.ib-info[hidden]{display:none!important}
.in-h{display:flex;align-items:center;gap:8px;height:var(--head-h);padding:0 14px;border-bottom:1px solid var(--line);flex:none}
.in-h h2{font-size:14.5px;font-weight:700;flex:1}
.in-b{flex:1;overflow-y:auto;padding:18px 16px 24px;display:grid;gap:18px;align-content:start}
.in-who{display:grid;justify-items:center;gap:6px;text-align:center}
.in-who b{font-size:15.5px;font-weight:700}
.in-who small{font-size:12.5px;color:var(--stone);direction:ltr}
.in-sec{display:grid;gap:8px}
.in-sec h3{font-size:12px;font-weight:600;color:var(--faint)}
.kv{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px}
.kv span:first-child{color:var(--stone)}
.kv span:last-child{font-weight:500;text-align:end}
.in-tags{display:flex;flex-wrap:wrap;gap:6px}
.in-tags .tg{height:24px;font-size:12px;padding:0 9px}
.add-tag{height:24px;padding:0 9px;border-radius:6px;border:1px dashed var(--line-strong);background:transparent;font-size:12px;font-weight:600;color:var(--stone)}
.add-tag:hover{border-color:var(--primary);color:var(--primary-ink)}
.in-note{width:100%;min-height:88px;resize:vertical;border-radius:var(--r-md);border:1px solid var(--sand);padding:9px 11px;font-size:13px;line-height:1.6;outline:0;background:#FFFDF5}
.in-note:focus{border-color:var(--primary);box-shadow:var(--ring)}
.rel{display:flex;align-items:center;gap:8px;width:100%;padding:8px 10px;border-radius:var(--r-md);border:0;background:var(--soft);text-align:start;font-size:12.5px}
.rel:hover{background:var(--soft-2)}
.rel span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink-2)}
.rel time{font-size:11px;color:var(--faint)}
.ai-read{display:flex;align-items:flex-start;gap:8px;padding:10px 12px;border-radius:var(--r-md);background:linear-gradient(140deg,#F6F2FF,#FDF3FA);font-size:12.5px;line-height:1.6;color:var(--ink-2)}
.ai-read b{color:var(--primary-ink);font-weight:600}

/* ---------- popovers ---------- */
.pop{position:fixed;z-index:70;min-width:220px;max-width:300px;background:var(--surface);border-radius:var(--r-lg);padding:6px;box-shadow:var(--sh-pop);direction:rtl}
.pop .mi{height:34px;font-size:13.5px}
.pop .mi .ck{margin-inline-start:auto;width:15px;height:15px;color:var(--primary);flex:none}
.pop .mi .lbl-dot{width:10px;height:10px;border-radius:3px;flex:none;background:var(--lc)}
.pop hr{border:0;border-top:1px solid var(--line);margin:5px 4px}
.pop .pop-h{font-size:11.5px;font-weight:600;color:var(--faint);padding:6px 10px 4px}
.pop .pop-in{display:flex;gap:6px;padding:6px}
.pop .pop-in input{flex:1;min-width:0;height:32px;border-radius:var(--r-sm);border:1px solid var(--sand);padding:0 9px;font-size:13px;outline:0}
.pop .pop-in input:focus{border-color:var(--primary);box-shadow:var(--ring)}
.pop .mi small{margin-inline-start:auto}

/* ---------- dialogs ---------- */
.ib-dlg{border:0;padding:0;border-radius:var(--r-2xl);background:var(--surface);color:var(--ink);box-shadow:var(--sh-xl);width:min(560px,calc(100vw - 32px));max-height:calc(100dvh - 48px);
  overflow:hidden;flex-direction:column}
.ib-dlg[open]{display:flex}
.ib-dlg.wide{width:min(860px,calc(100vw - 32px))}
.ib-dlg.small{width:min(420px,calc(100vw - 32px))}
.ib-dlg::backdrop{background:rgba(18,18,28,.38);backdrop-filter:blur(2px)}
.ib-dlg.drawer{margin:0;inset:0 auto 0 0;height:100dvh;max-height:100dvh;width:min(620px,100vw);border-radius:0}
.ib-dlg.drawer[open]{animation:drawerIn .26s var(--ease)}
@keyframes drawerIn{from{transform:translateX(-24px);opacity:.4}}
.ib-dlg form{display:flex;flex-direction:column;min-height:0;flex:1}
.dlg-h{display:flex;align-items:flex-start;gap:12px;padding:18px 20px 14px;border-bottom:1px solid var(--line);flex:none}
.dlg-h>div{flex:1;min-width:0}
.dlg-h h2{font-size:17px;font-weight:700}
.dlg-h p{margin:3px 0 0;font-size:13px;color:var(--stone);line-height:1.6}
.dlg-h .seg{margin-top:2px}
.dlg-b{flex:1;min-height:0;overflow-y:auto;padding:18px 20px;display:grid;gap:16px;align-content:start}
.dlg-b h3{font-size:16px;font-weight:700}
.dlg-b>p{margin:0;font-size:13.5px;color:var(--stone);line-height:1.7}
.dlg-f{flex:none;display:flex;align-items:center;gap:8px;padding:12px 20px;border-top:1px solid var(--line);background:#FCFCFD}
.dlg-f .sp{flex:1}
.dlg-f .cost{font-size:12.5px;color:var(--stone)}

/* channel cards */
.chc-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.chc{display:grid;gap:12px;align-content:start;padding:16px;border-radius:var(--r-xl);background:var(--surface);box-shadow:0 0 0 1px var(--line),var(--sh-xs)}
.chc-h{display:flex;align-items:center;gap:12px}
.chc-h .chm{width:40px;height:40px;border-radius:12px}
.chc-h .chm svg{width:21px;height:21px}
.chc-h b{display:block;font-size:14.5px;font-weight:700}
.chc-h small{display:block;font-size:12px;color:var(--stone);line-height:1.5}
.chc ul{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.chc li{display:flex;align-items:center;gap:8px;padding:7px 10px;border-radius:var(--r-md);background:var(--soft);font-size:13px}
.chc li .nm2{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}
.chc li small{color:var(--stone);font-size:11.5px;direction:ltr;white-space:nowrap}
.chc li .ic-btn{width:26px;height:26px}
.chc li .ic-btn svg{width:14px;height:14px}
.chc .st{flex:none}
.chc-acts{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.chc-acts .soon{font-size:12px;color:var(--faint)}
.perm-note{font-size:12px;color:var(--stone);line-height:1.6;padding:10px 12px;border-radius:var(--r-md);background:var(--soft)}

/* the assistant's settings */
.ai-hero{display:flex;align-items:center;gap:14px;padding:16px;border-radius:var(--r-xl);background:linear-gradient(135deg,#F5F0FF,#FDF1F8);box-shadow:inset 0 0 0 1px #E8DCFF}
.ai-hero .spk{width:44px;height:44px;border-radius:13px;display:grid;place-items:center;color:#fff;background:var(--grad);flex:none;box-shadow:0 8px 18px -8px rgba(139,61,255,.7)}
.ai-hero .spk svg{width:22px;height:22px}
.ai-hero.off{background:var(--soft);box-shadow:inset 0 0 0 1px var(--line)}
.ai-hero.off .spk{background:var(--soft-2);color:var(--stone);box-shadow:none}
.ai-hero div{flex:1;min-width:0}
.ai-hero b{display:block;font-size:15px;font-weight:700}
.ai-hero small{display:block;font-size:12.5px;color:var(--ink-3);line-height:1.6}
.ai-hero .sw{transform:scale(1.15)}
.sec-t{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.sec-t h4{font-size:14px;font-weight:700}
.sec-t small{font-size:12px;color:var(--stone)}
.modes{display:grid;gap:6px}
.mode-row{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:var(--r-md);background:var(--soft)}
.mode-row .t{flex:1;min-width:0;font-size:13px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mode-row .t small{color:var(--stone);font-weight:400;margin-inline-start:6px;direction:ltr;display:inline-block}
.mode-row .seg{background:var(--surface);box-shadow:inset 0 0 0 1px var(--line)}
.mode-row .seg button[aria-pressed="true"]{background:var(--ink);color:#fff}
.mode-row .seg button[data-m="auto"][aria-pressed="true"]{background:var(--primary)}
.mode-help{font-size:12px;color:var(--stone);line-height:1.6;display:grid;gap:3px}
.mode-help b{color:var(--ink-2);font-weight:600}
.kn{display:grid;gap:12px}
.kn .field textarea{min-height:76px}
.kn .field small b{font-weight:600;color:var(--ink-3)}
.kn-2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.chip-pick{display:flex;flex-wrap:wrap;gap:6px}
.chip-pick button{height:30px;padding:0 12px;border-radius:var(--r-full);border:0;background:var(--surface);box-shadow:inset 0 0 0 1px var(--sand);font-size:12.5px;font-weight:600;color:var(--ink-3)}
.chip-pick button[aria-pressed="true"]{background:var(--primary-soft);color:var(--primary-ink);box-shadow:inset 0 0 0 1.5px var(--primary)}
.toggle-row{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:var(--r-md);background:var(--soft);font-size:13px}
.toggle-row div{flex:1;min-width:0}
.toggle-row small{display:block;font-size:12px;color:var(--stone);line-height:1.5}
.kit-note{display:flex;gap:10px;padding:10px 12px;border-radius:var(--r-md);background:var(--info-soft);color:var(--info);font-size:12.5px;line-height:1.65}
.kit-note svg{width:16px;height:16px;flex:none;margin-top:3px}
.kit-note a{color:inherit;font-weight:600}
/* try the assistant */
.try{display:grid;gap:10px;padding:14px;border-radius:var(--r-xl);box-shadow:0 0 0 1px var(--line);background:var(--app)}
.try-in{display:flex;gap:8px}
.try-in input{flex:1;min-width:0;height:38px;border-radius:var(--r-md);border:1px solid var(--sand);padding:0 12px;font-size:13.5px;outline:0;background:var(--surface)}
.try-in input:focus{border-color:var(--primary);box-shadow:var(--ring)}
.try-out{display:grid;gap:8px}
.try-out .msg .bub{max-width:92%}
.try-out .why{font-size:12px;color:var(--stone)}

/* saved replies */
.rp-list{display:grid;gap:8px}
.rp{display:flex;gap:10px;align-items:flex-start;padding:12px;border-radius:var(--r-lg);background:var(--soft)}
.rp div{flex:1;min-width:0}
.rp b{display:block;font-size:13.5px;font-weight:600}
.rp p{margin:3px 0 0;font-size:12.5px;color:var(--ink-3);line-height:1.6;white-space:pre-wrap}
.rp .uses{font-size:11px;color:var(--faint)}
.rp-form{display:grid;gap:10px;padding:14px;border-radius:var(--r-lg);box-shadow:0 0 0 1px var(--line)}
.rp-form .acts{display:flex;gap:8px;justify-content:flex-end}

/* the numbers */
.kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.kpi{padding:14px;border-radius:var(--r-lg);background:var(--surface);box-shadow:0 0 0 1px var(--line)}
.kpi small{display:block;font-size:12px;color:var(--stone);font-weight:500}
.kpi b{display:block;font-size:24px;font-weight:700;letter-spacing:-.01em;margin-top:2px;font-variant-numeric:tabular-nums}
.kpi .d{font-size:11.5px;font-weight:600;color:var(--faint)}
.kpi .d.up{color:var(--ok)}
.kpi .d.down{color:var(--bad)}
.kpi.ai{background:linear-gradient(140deg,#F6F2FF,#FDF3FA);box-shadow:inset 0 0 0 1px #E8DCFF}
.st-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.st-card{padding:14px 16px;border-radius:var(--r-lg);box-shadow:0 0 0 1px var(--line);display:grid;gap:10px;align-content:start}
.st-card h4{font-size:13.5px;font-weight:700}
.bars{display:grid;gap:8px}
.bar{display:grid;grid-template-columns:110px 1fr 40px;align-items:center;gap:10px;font-size:12.5px}
.bar .lb{display:flex;align-items:center;gap:6px;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--ink-2)}
.bar .tr{height:8px;border-radius:99px;background:var(--soft);overflow:hidden}
.bar .tr i{display:block;height:100%;border-radius:99px;background:var(--primary)}
.bar .v{text-align:end;font-weight:600;font-variant-numeric:tabular-nums;color:var(--ink-3)}
.hours{display:grid;grid-template-columns:repeat(24,1fr);align-items:end;gap:3px;height:96px;padding-top:6px}
.hours i{display:block;border-radius:3px 3px 1px 1px;background:var(--primary-line);min-height:2px}
.hours i.top{background:var(--primary)}
.hours-x{display:grid;grid-template-columns:repeat(4,1fr);font-size:10.5px;color:var(--faint);direction:ltr}
.hours-x span:nth-child(n+2){text-align:center}
.hours-x span:last-child{text-align:right}
.st-empty{font-size:12.5px;color:var(--faint)}
.swatches{display:flex;gap:8px;flex-wrap:wrap}
.swatches button{width:28px;height:28px;border-radius:9px;border:0;background:var(--lc);box-shadow:inset 0 0 0 1px rgba(0,0,0,.08)}
.swatches button[aria-checked="true"]{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--lc)}
#ask h3{font-size:16px;font-weight:700}
#ask p{margin:4px 0 0;font-size:13.5px;color:var(--stone);line-height:1.7}

/* ---------- narrower screens ---------- */
@media (max-width:1440px){
  .th-acts .hide-l{display:none}
  .ib.info-open{grid-template-columns:var(--nav-w) var(--list-w) minmax(0,1fr)}
  .ib-info{position:absolute;top:0;bottom:0;left:0;width:var(--info-w);z-index:8;box-shadow:18px 0 40px -18px rgba(18,18,28,.28)}
}
@media (max-width:1200px){
  .ib,.ib.info-open{grid-template-columns:var(--list-w) minmax(0,1fr)}
  .ib-nav{position:absolute;top:0;bottom:0;right:0;width:280px;z-index:12;transform:translateX(102%);visibility:hidden;transition:transform .24s var(--ease),visibility 0s .24s;
    box-shadow:-18px 0 40px -18px rgba(18,18,28,.3)}
  .ib.nav-open .ib-nav{transform:none;visibility:visible;transition:transform .24s var(--ease)}
  .ib.nav-open::after{content:"";position:absolute;inset:0;background:rgba(18,18,28,.22);z-index:11;animation:veilIn .2s ease both}
  .nav-open,.nav-close{display:grid}
  .nav-h .side-open{display:none}
  .kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:900px){
  .ib,.ib.info-open{grid-template-columns:minmax(0,1fr)}
  .ib-list,.ib-thread{grid-area:1/1}
  .ib[data-pane="list"] .ib-thread,.ib[data-pane="thread"] .ib-list{display:none}
  .th-back{display:grid}
  .th-head{padding:8px 10px}
  .ai-pill .lb{display:none}
  .th-who small:has([dir="ltr"]) .chn{display:none}
  .th-scroll{padding:14px 12px 6px}
  .bub{max-width:86%}
  .composer{padding:8px 10px 10px}
  .cmp-bar .hint,.cmp-bar .hide-s{display:none}
  .ib-info{position:fixed;inset:0;width:auto;z-index:50;border:0}
  .chc-grid,.st-grid,.kn-2{grid-template-columns:minmax(0,1fr)}
  .ib-dlg{max-height:calc(100dvh - 16px);width:calc(100vw - 16px)}
  .ib-dlg.wide{width:calc(100vw - 16px)}
  .ib-dlg.drawer{width:100vw}
  .dlg-h{padding:14px 16px 12px;flex-wrap:wrap}
  .dlg-b{padding:14px 16px}
  .dlg-f{padding:10px 16px}
}
@media (max-width:480px){
  .kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .bar{grid-template-columns:90px 1fr 34px}
  .mode-row{flex-wrap:wrap}
  .mode-row .seg{width:100%}
  .mode-row .seg button{flex:1}
}
