/* THE OFFICE CHAT IN B (18 Nov 2026, his pick "B, the chat"). Drawn by js/chat.js.
   The approved look: design-gallery/tries/chat-b (chat.css there). Chats listed like the
   phone's chat apps (one big face with the second person tucked under it, the name, the last
   word said, the time, a green count), a chat with the send bar pinned at the foot.
   ⚠ EVERY RULE IS FENCED BEHIND .cbh, the one host chat.js hangs off <body> (test/projects-scope.js
     checks). The host carries kt and sp, so the kit's parts and its light and dark tokens reach in.
   ⚠ THE HOST HAS NO POSITION OF ITS OWN: the dock (laptop) and the full screen (phone) are its
     .cb child, the menus and the kit's boxes are siblings of it, each at its own height:
     dock 290 (under the top bar's own menus), phone screen 900, menus 1050, boxes 1000 (over the
     top bar, page dimmed). The app's question box (2100) and toasts (2200) stay above.
   Words 28 / 18 / 16 / 14, never under 14. Laptop in Inter (the CRM's own face). */
.cbh.cbh-dock { --sp-font: 'Inter', system-ui, sans-serif; }
.cbh .cb { --cb-gut: 16px; display: grid; min-height: 0; color: var(--sp-ink); font-family: var(--sp-font); font-size: 16px; line-height: 1.45; }
.cbh .cb[hidden] { display: none; }
.cbh .cb button { font-family: inherit; }
.cbh .cb .k-ic { width: 40px; height: 40px; flex: none; }
.cbh .cb svg, .cbh .cb-menu svg, .cbh .pp-ov svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cbh .cb .k-ic svg { width: 20px; height: 20px; }
.cbh .cb-f { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .01em; background-size: cover; background-position: center; overflow: hidden; }
.cbh .cb-f.has-av { color: transparent; }
.cbh .cb-one { display: block; min-width: 0; overflow: hidden; white-space: nowrap; }
.cbh .cb-one.is-cut { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.cbh .cb-tip { position: fixed; z-index: 1200; max-width: min(340px, calc(100vw - 24px)); padding: 8px 12px; border-radius: 12px; background: var(--sp-ink); color: var(--sp-bg); font: 500 14px/1.4 var(--sp-font); transform: translateY(-100%); opacity: 0; pointer-events: none; transition: opacity 140ms ease; }
.cbh .cb-tip.is-on { opacity: 1; }
.cbh .cb-clipcopy { position: fixed; left: -9999px; top: 0; opacity: 0; }

/* ── the list ── */
.cbh .cb-list { position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--sp-bg); }
.cbh .cb-lh { display: flex; align-items: center; gap: 8px; min-height: 64px; padding: 12px 12px 4px var(--cb-gut); }
.cbh .cb-h { flex: 1; margin: 0; font-size: 28px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.cbh .cb-new { min-height: 40px; padding: 0 14px 0 10px; gap: 6px; font-size: 15px; font-weight: 600; }
.cbh .cb-new svg { width: 18px; height: 18px; }
.cbh .cb-tools { display: grid; gap: 10px; padding: 8px var(--cb-gut) 12px; }
.cbh .cb-find { position: relative; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 6px 0 14px; border-radius: 999px; background: var(--sp-wash); color: var(--sp-grey); transition: background-color 150ms ease, box-shadow 150ms ease; }
.cbh .cb-find:focus-within { background: var(--sp-bg); box-shadow: inset 0 0 0 1.5px var(--sp-line); }
.cbh .cb-find > svg { width: 18px; height: 18px; flex: none; }
.cbh .cb-find input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; box-shadow: none; color: var(--sp-ink); font: 400 16px var(--sp-font); outline: none; }
.cbh .cb-find input::placeholder { color: var(--sp-grey); opacity: 1; }
.cbh .cb-qx { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: var(--sp-soft); color: var(--sp-ink); cursor: pointer; transition: transform 140ms var(--sp-ease-out); }
.cbh .cb-qx svg { width: 14px; height: 14px; stroke-width: 2.2; }
.cbh .cb-qx:active { transform: scale(.92); }
.cbh .cb-qx[hidden] { display: none; }
.cbh .cb-filt .tb-tab { height: 36px; font-size: 15px; }
.cbh .cb-rows { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px var(--cb-gut) 24px; scrollbar-width: thin; }
.cbh .cb-sec { margin: 14px 0 6px 4px; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--sp-grey); }
.cbh .cb-sec:first-child { margin-top: 4px; }
.cbh .cb-grp { display: grid; gap: 0; padding: 4px; border-radius: 18px; background: var(--sp-wash); }
.cbh .cb-none { margin: 24px 4px; font-size: 16px; color: var(--sp-grey); }

/* one chat: the big face with the second person tucked under it, the name and time, the last word and the count */
.cbh .cb-row { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 72px; padding: 10px 8px 10px 10px; border-radius: 14px; cursor: pointer; outline: none; transition: background-color 150ms ease, transform 160ms var(--sp-ease-out); -webkit-tap-highlight-color: transparent; }
.cbh .cb-row:active { transform: scale(.985); }
.cbh .cb-row:focus-visible { box-shadow: inset 0 0 0 2px var(--sp-ink); }
.cbh .cb-row.is-on { background: var(--sp-bg); box-shadow: 0 1px 2px var(--sp-shadow), inset 0 0 0 1px var(--sp-rule); }
.cbh .cb-rf { position: relative; width: 48px; height: 48px; }
.cbh .cb-rf > .cb-f { width: 48px; height: 48px; font-size: 15px; }
.cbh .cb-rf > .cb-f2 { position: absolute; right: -6px; bottom: -4px; width: 24px; height: 24px; font-size: 10px; box-shadow: 0 0 0 2.5px var(--sp-wash); }
.cbh .cb-row.is-on .cb-rf > .cb-f2 { box-shadow: 0 0 0 2.5px var(--sp-bg); }
.cbh .cb-mid { display: grid; gap: 2px; min-width: 0; }
.cbh .cb-l1, .cbh .cb-l2 { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.cbh .cb-nm { flex: 1; font-size: 16px; font-weight: 700; line-height: 1.3; }
.cbh .cb-w { flex: none; font-size: 14px; color: var(--sp-grey); }
.cbh .cb-row.is-un:not(.is-mu) .cb-w { color: var(--sp-ok); font-weight: 600; }
.cbh .cb-ll { flex: 1; font-size: 15px; line-height: 1.35; color: var(--sp-grey); }
.cbh .cb-row.is-un .cb-ll { color: var(--sp-ink); }
.cbh .cb-r2 { display: flex; align-items: center; gap: 6px; flex: none; align-self: center; }
.cbh .cb-ri { width: 16px; height: 16px; color: var(--sp-grey); }
.cbh .cb-n { min-width: 24px; height: 24px; padding: 0 7px; display: grid; place-items: center; border-radius: 999px; background: #1d7a45; color: #fff; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cbh .cb-row.is-mu .cb-n { background: var(--sp-soft); color: var(--sp-grey); }
.cbh .cb-jobs { justify-self: start; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; margin: 4px 0 -4px -8px; padding: 0 10px 0 8px; border: 0; border-radius: 999px; background: none; color: var(--sp-ink); font-size: 14px; font-weight: 600; cursor: pointer; transition: background-color 150ms ease, transform 140ms var(--sp-ease-out); }
.cbh .cb-jobs svg { width: 16px; height: 16px; transition: transform 240ms var(--sp-ease-out); }
.cbh .cb-jobs.is-open svg { transform: rotate(180deg); }
.cbh .cb-jobs:active { transform: scale(.96); }
.cbh .cb-kids { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 260ms var(--sp-ease-out); }
.cbh .cb-kids > div { min-height: 0; overflow: hidden; }
.cbh .cb-kids.is-open { grid-template-rows: 1fr; }
.cbh .cb-row.is-nest { grid-template-columns: 36px minmax(0, 1fr); min-height: 60px; margin-left: 16px; }
.cbh .cb-row.is-nest .cb-rf, .cbh .cb-row.is-nest .cb-rf > .cb-f { width: 36px; height: 36px; font-size: 13px; }
.cbh .cb-row.is-nest .cb-rf > .cb-f2 { width: 20px; height: 20px; font-size: 9px; }
.cbh .cb-row.is-nest .cb-nm { font-size: 15px; font-weight: 600; }
.cbh .cb-rmore { position: absolute; right: 6px; top: 50%; margin-top: -20px; background: var(--sp-soft); opacity: 0; transition: opacity 140ms ease; color: var(--sp-grey); }
.cbh .cb-row.is-on .cb-rmore { background: var(--sp-bg); }
.cbh .cb-row:focus-within .cb-rmore, .cbh .cb-rmore[aria-expanded="true"] { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .cbh .cb-row:hover { background: var(--sp-soft); }
  .cbh .cb-row:hover .cb-rf > .cb-f2 { box-shadow: 0 0 0 2.5px var(--sp-soft); }
  .cbh .cb-jobs:hover { background: var(--sp-bg); }
  .cbh .cb-row:hover .cb-rmore { opacity: 1; }
  .cbh .cb-rmore:hover { color: var(--sp-ink); background: var(--sp-wash); }
}

/* ── one chat ── */
.cbh .cb-room { position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--sp-page); }
.cbh .cb-room[hidden] { display: none; }
.cbh .cb-rh { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 10px 10px 10px var(--cb-gut); border-bottom: 1px solid var(--sp-rule); background: var(--sp-bg); }
.cbh .cb-rf.is-big, .cbh .cb-rf.is-big > .cb-f:not(.cb-f2) { width: 44px; height: 44px; }
.cbh .cb-rf.is-big > .cb-f2 { box-shadow: 0 0 0 2.5px var(--sp-bg); }
.cbh .cb-title { flex: 1; min-width: 0; display: grid; gap: 1px; padding: 6px 8px; margin: -6px 0 -6px -8px; border: 0; border-radius: 12px; background: none; color: var(--sp-ink); text-align: left; cursor: pointer; transition: background-color 150ms ease; }
.cbh .cb-title:active { background: var(--sp-soft); }
.cbh .cb-tn { font-size: 18px; font-weight: 700; line-height: 1.3; }
.cbh .cb-ts { font-size: 14px; color: var(--sp-grey); line-height: 1.35; }
.cbh .cb-pinhost:empty { display: none; }
.cbh .cb-pinbar { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 var(--cb-gut); border: 0; border-bottom: 1px solid var(--sp-rule); background: var(--sp-bg); color: var(--sp-ink); font-size: 15px; text-align: left; cursor: pointer; transition: background-color 150ms ease; }
.cbh .cb-pinbar svg { width: 16px; height: 16px; flex: none; color: var(--sp-grey); }
.cbh .cb-pl { flex: none; font-weight: 600; }
.cbh .cb-pt { flex: 1; color: var(--sp-grey); }
@media (hover: hover) and (pointer: fine) { .cbh .cb-title:hover, .cbh .cb-pinbar:hover { background: var(--sp-wash); } }

.cbh .cb-th { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px var(--cb-gut) 12px; outline: none; scrollbar-width: thin; }
.cbh .cb-wait { display: grid; place-items: center; min-height: 120px; color: var(--sp-grey); }
.cbh .cb-day { display: flex; justify-content: center; margin: 14px 0 12px; }
.cbh .cb-day:first-child { margin-top: 0; }
.cbh .cb-day span { padding: 4px 12px; border-radius: 999px; background: var(--sp-wash); font-size: 14px; color: var(--sp-grey); }
.cbh .cb-unl { display: flex; align-items: center; gap: 12px; margin: 14px 0; font-size: 14px; font-weight: 600; color: var(--sp-ok); }
.cbh .cb-unl::before, .cbh .cb-unl::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--sp-ok) 45%, transparent); }

.cbh .cb-m { position: relative; display: grid; grid-template-columns: 32px minmax(0, auto); gap: 8px; align-items: end; justify-content: start; max-width: min(84%, 560px); margin-top: 12px; border-radius: 20px; }
.cbh .cb-m.is-run { margin-top: 4px; }
.cbh .cb-m.is-me { grid-template-columns: minmax(0, auto); margin-left: auto; justify-content: end; }
.cbh .cb-mf { width: 32px; height: 32px; font-size: 12px; }
.cbh .cb-bub { position: relative; min-width: 0; padding: 8px 14px 10px; border-radius: 18px; background: var(--sp-wash); }
.cbh .cb-m:not(.is-me).is-tail .cb-bub { border-bottom-left-radius: 6px; }
.cbh .cb-m.is-me .cb-bub { background: var(--sp-soft); }
.cbh .cb-m.is-me.is-tail .cb-bub { border-bottom-right-radius: 6px; }
.cbh .cb-meta { display: flex; align-items: center; gap: 4px; min-height: 20px; font-size: 14px; color: var(--sp-grey); white-space: nowrap; }
.cbh .cb-meta b { font-weight: 500; }
.cbh .cb-pm { width: 14px; height: 14px; }
.cbh .cb-tx { margin: 2px 0 0; font-size: 16px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; text-wrap: pretty; }
.cbh .cb-tx .men { font-weight: 600; color: var(--sp-info); }
.cbh .cb-tx .men.me { padding: 0 4px; border-radius: 6px; background: var(--sp-bad-bg); color: var(--sp-red); }
.cbh .cb-seen { display: inline-grid; place-items: center; width: 28px; height: 22px; margin: -2px -6px -2px 0; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--sp-grey); cursor: pointer; }
.cbh .cb-tk { width: 20px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cbh .cb-tk.is-seen { color: var(--sp-ok); }
.cbh .cb-tk.is-wait { width: 16px; height: 14px; stroke-width: 1.5; }
.cbh .cb-fail { margin-left: 4px; font-weight: 600; color: var(--sp-red); }
.cbh .cb-q { display: grid; gap: 1px; width: 100%; min-width: 180px; margin: 6px 0 2px; padding: 6px 10px 7px 12px; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--qc) 10%, var(--sp-bg)); box-shadow: inset 3px 0 0 var(--qc); color: var(--sp-ink); text-align: left; cursor: pointer; transition: transform 140ms var(--sp-ease-out); }
.cbh .cb-q b { font-size: 14px; font-weight: 600; color: color-mix(in srgb, var(--qc) 70%, var(--sp-ink)); }
.cbh .cb-qt { font-size: 14px; color: var(--sp-grey); }
.cbh .cb-q:active { transform: scale(.98); }
.cbh .cb-img { position: relative; display: block; width: min(280px, 100%); margin: 6px 0 2px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--sp-bg); cursor: zoom-in; }
.cbh .cb-img img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 300ms var(--sp-ease-out), opacity 200ms ease; }
.cbh .cb-img.is-sending img { opacity: .6; }
@media (hover: hover) and (pointer: fine) { .cbh .cb-img:hover img { transform: scale(1.02); } }
.cbh .cb-file { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 10px; min-width: 220px; margin: 6px 0 2px; padding: 8px 12px 8px 8px; border-radius: 12px; background: var(--sp-bg); color: var(--sp-ink); text-decoration: none; transition: transform 140ms var(--sp-ease-out); overflow: hidden; }
.cbh .cb-file > svg { width: 40px; height: 40px; padding: 9px; border-radius: 10px; background: var(--sp-wash); color: var(--sp-grey); }
.cbh .cb-file:active { transform: scale(.98); }
.cbh .cb-fn { display: grid; min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.3; }
.cbh .cb-fs { font-size: 14px; font-weight: 400; color: var(--sp-grey); }
.cbh .cb-up { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--sp-soft); }
.cbh .cb-up i { display: block; width: 4%; height: 100%; background: var(--sp-ink); transition: width 240ms linear; }
.cbh .cb-rx { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.cbh .cb-rxb { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px 0 8px; border: 0; border-radius: 999px; background: var(--sp-bg); box-shadow: inset 0 0 0 1px var(--sp-rule); color: var(--sp-ink); font-size: 15px; cursor: pointer; transition: transform 140ms var(--sp-ease-out), box-shadow 150ms ease; }
.cbh .cb-rxb span { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cbh .cb-rxb.is-mine { color: var(--sp-red); box-shadow: inset 0 0 0 1.5px var(--sp-red); }
/* the reactions are our own line icons (thumbs up, tick, eye), never system emoji: text colour, yours in the accent with the ring */
.cbh .cb-rxi { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cbh .cb-rxb .cb-rxi { width: 16px; height: 16px; }
.cbh .cb-rxb:active { transform: scale(.94); }
.cbh .cb-m.is-flash .cb-bub { animation: cbh-flash 1.2s ease; }
@keyframes cbh-flash { 0%, 40% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--sp-info) 55%, transparent); } 100% { box-shadow: 0 0 0 3px transparent; } }
.cbh .cb-m.is-failed .cb-bub { box-shadow: inset 0 0 0 1.5px var(--sp-red); }

/* the pill on a line (laptop): a thumbs up, Reply, the rest under the dots, grown in place */
.cbh .cb-acts { position: absolute; top: 0; left: calc(100% + 6px); z-index: 2; display: flex; padding: 2px; border-radius: 999px; background: var(--sp-bg); box-shadow: 0 0 0 1px var(--sp-rule), 0 6px 16px -8px var(--sp-shadow); white-space: nowrap; opacity: 0; transform: translateY(4px) scale(.97); transition: opacity 140ms ease, transform 160ms var(--sp-ease-out); pointer-events: none; }
.cbh .cb-m.is-me .cb-acts { left: auto; right: calc(100% + 6px); }
/* the line's hover area runs on past the bubble, so the pill beside it is reached without losing the hover */
.cbh .cb:not(.cb-phone) .cb-m { width: fit-content; max-width: min(100%, 680px); padding-right: 116px; }
.cbh .cb:not(.cb-phone) .cb-m.is-me { padding-right: 0; padding-left: 116px; }
.cbh .cb-acts .k-ic { width: 34px; height: 34px; color: var(--sp-grey); }
.cbh .cb-a0, .cbh .cb-a1, .cbh .cb-aemo, .cbh .cb-awords { display: flex; align-items: center; gap: 2px; }
.cbh .cb-a1:empty { display: none; }
.cbh .cb-m.is-grown .cb-a0 { display: none; }
.cbh .cb-acts .cb-emo { color: var(--sp-ink); }
.cbh .cb-acts .cb-emo .cb-rxi { width: 18px; height: 18px; }
.cbh .cb-acts .cb-emo.is-mine { color: var(--sp-red); box-shadow: inset 0 0 0 1.5px var(--sp-red); }
.cbh .cb-asep { width: 1px; height: 20px; margin: 0 4px; background: var(--sp-rule); }
.cbh .cb-aw { height: 34px; padding: 0 10px; border: 0; border-radius: 999px; background: none; color: var(--sp-ink); font: 500 14px var(--sp-font); cursor: pointer; transition: background-color 140ms ease, transform 140ms var(--sp-ease-out); }
.cbh .cb-aw:active { transform: scale(.95); }
.cbh .cb-aw:focus-visible, .cbh .cb-acts .k-ic:focus-visible { outline: 2px solid var(--sp-ink); outline-offset: -2px; }
.cbh .cb-m.is-grown { z-index: 3; }
.cbh .cb-m.is-grown .cb-acts { opacity: 1; transform: none; pointer-events: auto; }
.cbh .cb-th.has-grown .cb-m:not(.is-grown) .cb-acts { opacity: 0 !important; pointer-events: none !important; }
.cbh .cb-acts .k-ic svg { width: 18px; height: 18px; }
.cbh .cb-m:focus-within .cb-acts, .cbh .cb-acts:has([aria-expanded="true"]) { opacity: 1; transform: none; pointer-events: auto; }
@media (hover: hover) and (pointer: fine) {
  .cbh .cb-m:hover .cb-acts { opacity: 1; transform: none; pointer-events: auto; }
  .cbh .cb-acts .k-ic:hover { color: var(--sp-ink); background: var(--sp-wash); }
  .cbh .cb-aw:hover { background: var(--sp-wash); }
}
/* grown: a row, or a column when only the narrow side of the chat is free */
.cbh .cb-acts.is-col { border-radius: 18px; padding: 4px; }
.cbh .cb-acts.is-col .cb-a1 { flex-direction: column; align-items: stretch; gap: 2px; }
.cbh .cb-acts.is-col .cb-awords { flex-direction: column; align-items: stretch; }
.cbh .cb-acts.is-col .cb-asep { width: auto; height: 1px; margin: 2px 6px; }
.cbh .cb-acts.is-col .cb-aw { text-align: left; border-radius: 10px; }

/* ── the foot: reply line, @ list, the box ── */
.cbh .cb-foot { position: relative; flex: none; padding: 8px 12px 12px; background: var(--sp-page); box-shadow: 0 -10px 20px -18px var(--sp-shadow); }
.cbh .cb-reply { display: flex; align-items: center; gap: 8px; padding: 0 0 8px; overflow: hidden; }
.cbh .cb-reply[hidden] { display: none; }
.cbh .cb-rq { flex: 1; display: grid; min-width: 0; padding: 6px 12px; border-radius: 12px; background: var(--sp-wash); box-shadow: inset 3px 0 0 var(--qc); }
.cbh .cb-rq b { font-size: 14px; font-weight: 600; }
.cbh .cb-atl { position: absolute; left: 12px; bottom: calc(100% - 2px); z-index: 4; display: grid; min-width: 240px; padding: 6px; border-radius: 16px; background: var(--sp-bg); box-shadow: 0 0 0 1px var(--sp-rule), 0 12px 28px -12px var(--sp-shadow); transform-origin: 20px 100%; }
.cbh .cb-atl[hidden] { display: none; }
.cbh .cb-ato { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 10px; min-height: 44px; padding: 4px 10px 4px 6px; border: 0; border-radius: 10px; background: none; color: var(--sp-ink); font-size: 15px; text-align: left; cursor: pointer; }
.cbh .cb-ato b { font-weight: 600; }
.cbh .cb-ato.is-on { background: var(--sp-soft); }
.cbh .cb-say { display: grid; grid-template-columns: 44px minmax(0, 1fr) 48px; align-items: end; gap: 6px; margin: 0; }
.cbh .cb-clip { width: 44px !important; height: 48px !important; color: var(--sp-grey); }
.cbh .cb-clip svg { width: 22px !important; height: 22px !important; }
/* the real file input: never drawn, opened by the clip button */
.cbh .cb-file-in { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; opacity: 0; }
.cbh .cb-box { display: block; width: 100%; min-height: 48px; max-height: 132px; padding: 12px 16px; border: 1px solid transparent; border-radius: 24px; background: var(--sp-wash); box-shadow: none; color: var(--sp-ink); font: 400 16px/1.4 var(--sp-font); resize: none; outline: none; transition: border-color 150ms ease, background-color 150ms ease; }
.cbh .cb-box::placeholder { color: var(--sp-grey); opacity: 1; }
.cbh .cb-box:focus { background: var(--sp-bg); border-color: var(--sp-line); }
.cbh .cb-send { width: 48px; min-height: 48px; padding: 0; transition: opacity 160ms ease, transform 140ms var(--sp-ease-out); }
.cbh .cb-send svg { width: 20px; height: 20px; }
.cbh .cb-send:disabled { opacity: .4; }
.cbh .cb-drop { position: absolute; inset: 8px; z-index: 6; display: grid; place-items: center; border-radius: 18px; background: color-mix(in srgb, var(--sp-bg) 88%, transparent); box-shadow: inset 0 0 0 2px var(--sp-ink); font-size: 18px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity 160ms ease; }
.cbh .cb.is-drop .cb-drop { opacity: 1; }

/* small menu, grows from its button */
.cbh .cb-menu { position: fixed; z-index: 1050; min-width: 200px; padding: 6px; border-radius: 14px; background: var(--sp-bg); color: var(--sp-ink); box-shadow: 0 0 0 1px var(--sp-rule), 0 16px 32px -14px var(--sp-shadow); font-family: var(--sp-font); }
.cbh .cb-menu > button { display: flex; align-items: center; width: 100%; min-height: 40px; padding: 0 12px; border: 0; border-radius: 9px; background: none; color: inherit; font: 500 15px var(--sp-font); text-align: left; cursor: pointer; }
.cbh .cb-menu > button:focus-visible { outline: 2px solid var(--sp-ink); outline-offset: -2px; }
.cbh .cb-menu > button:active { background: var(--sp-soft); }
@media (hover: hover) and (pointer: fine) { .cbh .cb-menu > button:hover { background: var(--sp-wash); } }
.cbh .cb-menu hr { height: 1px; margin: 6px 4px; border: 0; background: var(--sp-rule); }

/* the kit's boxes and sheets here: over the top bar, page dimmed */
.cbh .pp-ov { z-index: 1000; }
.cbh .pp-m { margin-top: 2px; font-size: 14px; color: var(--sp-grey); }
/* phone hold sheet: short, reactions on top at their normal size, then a tight list of words */
.cbh .cb-msheet .pp-hd { padding-top: 4px; padding-bottom: 4px; }
.cbh .cb-msheet .pp-t { font-size: 15px !important; font-weight: 500; color: var(--sp-grey); }
.cbh .cb-msheet .pp-bd { padding-top: 4px; }
.cbh .cb-mrx { display: flex; gap: 8px; padding: 0 0 10px; }
.cbh .cb-memo { width: 52px; height: 44px; padding: 0; border: 0; border-radius: 999px; background: var(--sp-wash); color: var(--sp-ink); display: inline-grid; place-items: center; cursor: pointer; transition: transform 140ms var(--sp-ease-out); }
.cbh .cb-memo .cb-rxi { width: 18px; height: 18px; }
.cbh .cb-memo:active { transform: scale(.92); }
.cbh .cb-memo.is-mine { color: var(--sp-red); box-shadow: inset 0 0 0 1.5px var(--sp-red); }
.cbh .cb-mlist { display: grid; padding: 4px; border-radius: 16px; background: var(--sp-wash); }
.cbh .cb-mw { min-height: 48px; padding: 0 12px; border: 0; border-radius: 12px; background: none; color: var(--sp-ink); font: 500 16px var(--sp-font); text-align: left; cursor: pointer; transition: background-color 140ms ease, transform 140ms var(--sp-ease-out); }
.cbh .cb-mw:active { transform: scale(.98); background: var(--sp-soft); }
.cbh .pp-ov.is-sheet .pp-bd { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }

/* group box */
.cbh .cb-gbox .pp-box { width: min(520px, calc(100vw - 32px)); }
.cbh .cb-gbox .pp-bd { display: grid; gap: 8px; max-height: min(64vh, 600px); overflow-y: auto; overscroll-behavior: contain; }
.cbh .cb-label { display: block; font-size: 14px; font-weight: 600; color: var(--sp-grey); }
.cbh .cb-gl { margin-top: 12px; }
.cbh .cb-in { display: block; width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--sp-line); border-radius: 12px; background: var(--sp-bg); box-shadow: none; color: var(--sp-ink); font: 400 16px var(--sp-font); outline: none; transition: border-color 150ms ease, box-shadow 150ms ease; }
.cbh .cb-in:focus { border-color: var(--sp-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sp-ink) 12%, transparent); }
.cbh .cb-in::placeholder { color: var(--sp-grey); opacity: 1; }
.cbh .cb-pfind { height: 40px; }
.cbh .cb-pick { display: grid; overflow-y: auto; overscroll-behavior: contain; padding: 4px; border-radius: 14px; background: var(--sp-wash); }
.cbh .cb-pick[data-list="jobs"] { max-height: 244px; }
.cbh .cb-pick .cb-none { margin: 12px 8px; font-size: 15px; }
.cbh .cb-opt { display: grid; grid-template-columns: minmax(0, 1fr) auto 22px; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px; border: 0; border-radius: 10px; background: none; color: var(--sp-ink); font-size: 15px; text-align: left; cursor: pointer; transition: background-color 140ms ease; }
.cbh .cb-opt.has-av { grid-template-columns: 32px minmax(0, 1fr) auto 22px; }
.cbh .cb-opt[hidden] { display: none; }
.cbh .cb-opt b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cbh .cb-os { font-size: 14px; color: var(--sp-grey); white-space: nowrap; }
.cbh .cb-otk { width: 22px; height: 22px; padding: 3px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--sp-line); color: transparent; stroke-width: 2.4; transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease; }
.cbh .cb-opt[aria-checked="true"] .cb-otk { background: var(--sp-ink); box-shadow: none; color: var(--sp-bg); }
.cbh .cb-opt[aria-disabled="true"] { cursor: default; }
.cbh .cb-opt[aria-disabled="true"] .cb-otk { opacity: .5; }
@media (hover: hover) and (pointer: fine) { .cbh .cb-opt:not([aria-disabled="true"]):hover { background: var(--sp-bg); } }
.cbh .cb-gbox .pp-ft { align-items: center; gap: 8px; }
.cbh .cb-gbox .pp-ft .k-btn { min-height: 44px; }
.cbh .cb-gbox .pp-ft [data-leave] { margin-left: -10px; }
.cbh .cb-redw { color: var(--sp-red); }
.cbh .cb-gerr { flex: 1; font-size: 14px; color: var(--sp-red); }
.cbh .cb-askp { margin: 0; font-size: 16px; line-height: 1.5; color: var(--sp-grey); }
.cbh .cb-view .pp-box { width: min(760px, calc(100vw - 32px)); }
.cbh .cb-view .pp-bd img { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: 12px; }
.cbh .cb-view .pp-ft a.k-btn { text-decoration: none; }

/* ═════ layouts ═════ */
/* the dock: at the work area's right edge (placed by chat.js), over the page, its own height */
.cbh .cb-dock { position: fixed; z-index: 290; grid-template-columns: 100%; grid-template-rows: 100%; overflow: hidden; background: var(--sp-bg); box-shadow: -1px 0 0 var(--sp-rule), -24px 0 40px -28px var(--sp-shadow); }
.cbh .cb-dock .cb-list, .cbh .cb-dock .cb-room { grid-area: 1 / 1; }
.cbh .cb-dock .cb-room { margin-left: 72px; box-shadow: -1px 0 0 var(--sp-rule), -16px 0 28px -24px var(--sp-shadow); }
.cbh .cb-dock .cb-x { color: var(--sp-grey); }
.cbh .cb-strip { grid-area: 1 / 1; z-index: 1; display: flex; flex-direction: column; align-items: center; width: 72px; min-height: 0; padding: 14px 0 12px; background: var(--sp-bg); opacity: 0; pointer-events: none; transition: opacity 180ms ease; }
.cbh .cb-dock.is-room .cb-strip { opacity: 1; pointer-events: auto; }
.cbh .cb-all { flex: none; margin-bottom: 10px; background: var(--sp-wash); }
.cbh .cb-sf { display: grid; gap: 8px; justify-items: center; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 0 8px; scrollbar-width: none; }
.cbh .cb-sf::-webkit-scrollbar { display: none; }
.cbh .cb-sb { position: relative; display: grid; place-items: center; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; transition: transform 140ms var(--sp-ease-out), background-color 150ms ease; }
.cbh .cb-sb .cb-rf, .cbh .cb-sb .cb-rf > .cb-f:not(.cb-f2) { width: 44px; height: 44px; font-size: 14px; }
.cbh .cb-sb .cb-rf > .cb-f2 { width: 20px; height: 20px; font-size: 9px; box-shadow: 0 0 0 2px var(--sp-bg); }
.cbh .cb-sb:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) { .cbh .cb-sb:hover { background: var(--sp-wash); } }
.cbh .cb-sb.is-on { box-shadow: inset 0 0 0 2px var(--sp-ink); }
.cbh .cb-sb.is-un::after { content: ""; position: absolute; top: 5px; right: 5px; width: 12px; height: 12px; border-radius: 50%; background: #1d7a45; box-shadow: 0 0 0 2.5px var(--sp-bg); }
.cbh .cb-dock .cb-list { transition: opacity 180ms ease; }
.cbh .cb-dock.is-room .cb-list { opacity: 0; pointer-events: none; }

/* the phone: two full screens over the app */
.cbh .cb-phone { position: fixed; inset: 0; z-index: 900; grid-template-columns: 100%; grid-template-rows: 100%; background: var(--sp-page); padding-top: env(safe-area-inset-top, 0px); }
.cbh .cb-phone .cb-list, .cbh .cb-phone .cb-room { grid-area: 1 / 1; }
.cbh .cb-phone .cb-list { background: var(--sp-page); }
.cbh .cb-phone .cb-lh { min-height: 60px; padding: 8px 12px 0 4px; }
.cbh .cb-phone .cb-back { width: 44px; height: 44px; }
.cbh .cb-phone .cb-back svg { width: 24px; height: 24px; }
.cbh .cb-phone .cb-room { z-index: 2; box-shadow: -20px 0 30px -26px var(--sp-shadow); }
.cbh .cb-phone .cb-rh { gap: 10px; padding: 8px 6px 8px 2px; min-height: 64px; }
.cbh .cb-phone .cb-rows { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.cbh .cb-phone .cb-foot { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
.cbh .cb-phone .cb-m { max-width: 88%; touch-action: pan-y; transition: none; }
.cbh .cb-phone .cb-m::before { content: ""; position: absolute; left: -36px; top: 50%; width: 28px; height: 28px; margin-top: -14px; border-radius: 50%; background: var(--sp-wash); opacity: 0; transition: opacity 120ms ease; }
.cbh .cb-phone .cb-m.is-swipe::before { opacity: 1; }
.cbh .cb-phone .cb-bub { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.cbh .cb-phone .cb-rx .cb-rxb { height: 32px; }
/* on a phone the app's corner pills stand over the chat, just above its send bar */
body:has(.cbh.cbh-phone.is-open) .k-tell .m-pile { position: fixed; z-index: 1100; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }

@media (prefers-reduced-motion: reduce) {
  .cbh .cb *, .cbh .cb-menu { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}
