/* Medial Control — Support (js/screens/support.js, support-thread.js). The dashboard's own tokens, tables, cards, tabs and .seg;
   the chat bubbles are the product's unit-chat look (mockups/assets/screens/network.css, .nw-*) under the sp- prefix. No dark theme
   (the dashboard has none, BUILD-PROMPT section 2). */

/* inbox */
.fbar .sp-seg{flex:none;padding:2px}
.fbar .sp-seg button{padding:3px 10px;font-size:.82rem}
.sp-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--info);margin-inline-end:7px;vertical-align:1px}
.ct-tbl tr.sp-unread td b,.ct-tbl tr.sp-unread .sp-subj{font-weight:700;color:var(--ink)}
.ct-tbl tr.sp-unread .sp-last{color:var(--ink-2)}
/* the message / announcement column takes the room left and cuts its text with "…" (no sideways scroll at 1280) */
.sp-list .ct-tbl td.ct-w{max-width:0;width:44%}
.sp-subj{display:block;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tbl .sp-last{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sp-cust .ct-kv,.sp-side .sp-cust .ct-kv{grid-template-columns:minmax(0,1fr)}
.sp-side .ct-kv .ltr{white-space:normal;overflow-wrap:anywhere}
.sp-wait{font-variant-numeric:tabular-nums;white-space:nowrap}
.sp-wait.ct-warn-t{font-weight:600}

/* one conversation: chat on the start side, the customer on the end side */
.sp-head{margin-bottom:10px}
.sp-grid{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:12px;align-items:start}
.sp-side .card-b{padding:10px 14px 12px}
.sp-side .ct-kv{grid-template-columns:repeat(2,minmax(0,1fr))}
.sp-side .ct-kv dd{font-weight:400}
.sp-ulink{display:inline-flex;align-items:center;gap:6px;text-decoration:none}
.sp-ulink span{text-decoration:underline;text-underline-offset:3px}
.sp-ulink .og-ti{width:16px;height:16px}
.sp-ulink .og-ti svg{width:14px;height:14px}
.sp-lic{display:block;color:var(--muted);font-size:.8rem;margin-top:2px}

.sp-conv{display:flex;flex-direction:column;height:calc(100dvh - 166px);min-height:460px;overflow:hidden}
/* bottom-anchored: the newest message stays in view */
.sp-body{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column-reverse;padding:14px 18px;scrollbar-width:thin;scrollbar-color:var(--line) transparent}
.sp-in{display:flex;flex-direction:column;gap:10px}
.sp-in:has(>.sp-none){margin-block:auto}
.sp-none{text-align:center;color:var(--muted);font-size:.88rem;padding:24px 0}
.sp-day{align-self:center;font-size:.74rem;color:var(--muted);padding:0 9px;line-height:1.8;border:1px solid var(--line-2);border-radius:6px;background:var(--surface-2)}
.sp-m{display:flex;flex-direction:column;align-items:flex-start;align-self:flex-start;max-width:min(72%,620px)}
.sp-m.me{align-self:flex-end;align-items:flex-end}
.sp-bub{border:1px solid var(--line);background:var(--surface-2);border-radius:10px;padding:8px 12px;font-size:.92rem;line-height:1.7;overflow-wrap:anywhere}
.sp-bub>span{white-space:pre-wrap}
.sp-m.me .sp-bub{background:var(--accent-soft);border-color:color-mix(in srgb,var(--accent) 24%,transparent)}
.sp-meta{display:flex;align-items:center;gap:5px;margin-top:3px;font-size:.72rem;color:var(--muted)}
.sp-tick{display:inline-flex}
.sp-tick svg{width:14px;height:14px}
.sp-tick.sp-rd svg{color:var(--info)}
.sp-pic{display:block;padding:0;border:1px solid var(--line);border-radius:10px;background:var(--surface-2);overflow:hidden;cursor:zoom-in;margin-bottom:4px;line-height:0}
.sp-pic img{display:block;max-width:300px;max-height:220px;min-width:120px;min-height:80px;object-fit:contain}
.sp-pic.sp-pic-x{cursor:default}
.sp-pic.sp-pic-x img{min-width:160px;min-height:60px;line-height:1.4;font-size:.8rem;color:var(--muted);padding:8px}
.sp-full{display:block;max-width:100%;height:auto;margin:0 auto;border:1px solid var(--line);border-radius:8px}

.sp-comp{flex:none;border-top:1px solid var(--line-2);padding:10px 14px 12px}
.sp-att{display:flex;align-items:center;gap:10px;margin-bottom:8px}
.sp-att[hidden]{display:none}
.sp-thumb{display:block;width:56px;height:42px;border:1px solid var(--line);border-radius:7px;overflow:hidden;background:var(--surface-2)}
.sp-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.sp-send{display:flex;align-items:stretch;gap:8px}
.sp-send textarea{flex:1;min-width:0;resize:none;min-height:46px;max-height:180px;padding:9px 12px;font:inherit;font-size:.92rem}
.sp-send .btn{height:auto;min-height:46px}
.sp-send .sp-clip{width:46px;padding:0;justify-content:center}
[dir=rtl] .sp-go svg{transform:scaleX(-1)}

/* announcements and contact details */
.sp-nbody{margin:14px 0 0;white-space:pre-wrap;font-size:.92rem;line-height:1.8;max-width:70ch}
.sp-contact{max-width:980px}
.sp-cform{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.6fr);gap:12px 14px;align-items:end}
.sp-cform .og-f>span:first-child{font-size:.8rem}
.sp-csave{grid-column:1/-1;display:flex;align-items:center;gap:10px}
.sp-csave .og-note{flex:1;margin:0}
.sp-csave .og-note[hidden]{display:none}
.sp-csave .btn{margin-inline-start:auto}

@container content (max-width:1100px){
  .sp-grid{grid-template-columns:minmax(0,1fr) 300px}
  .sp-side .ct-kv{grid-template-columns:minmax(0,1fr)}
}
@container content (max-width:860px){
  .sp-grid{grid-template-columns:minmax(0,1fr)}
  .sp-conv{height:70vh}
  .sp-cform{grid-template-columns:minmax(0,1fr)}
}
/* the collapsed rail: the count sits on the icon's corner, cut out from the rail, never over the icon */
.shell.mini .nav-item[data-id="support"] .count{top:0;inset-inline-end:calc(50% - 17px);padding:0 3px;min-width:14px;text-align:center;font-size:.58rem;line-height:1.5;box-shadow:0 0 0 2px var(--side)}
/* the AI helper's answers (neutral, dashed, own label) and system lines (one small centred line) */
.sp-m.sp-ai{align-self:flex-end;align-items:flex-end}
.sp-m.sp-ai .sp-bub{background:var(--surface);border-style:dashed;border-color:var(--faint);color:var(--ink-2)}
.sp-ailab{font-weight:600;color:var(--ink-2)}
.sp-sys{align-self:center;max-width:80%;text-align:center;font-size:.76rem;color:var(--muted);line-height:1.6}
