/* S2 fix round (24 Nov): Visitors page matches approved mockup 01 (CR-1818) without the summary
   cards and live strip (CR-1815). Loaded last; overrides only what the CRs change. */

/* ---- CR-1815: only the "not updating" warning remains of the live strip ---- */
.vb-stale-strip[hidden]{display:none!important}

/* ---- Header: site next to the title, dark-mode toggle, bell with the unread count ---- */
.header-titleline{display:flex;align-items:baseline;gap:10px;min-width:0}
.header-titleline h1{margin:0}
.header-site{color:#667085;font-size:13px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
body:not(:has(#inbox.active.board-view)) .header-site{display:none}
.header-tools{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.hdr-icon{position:relative;display:inline-grid;place-items:center;width:36px;height:36px;border:1px solid #d7dde5;border-radius:10px;background:#fff;color:#344054;cursor:pointer;padding:0}
.hdr-icon:hover{background:#f5f3ff;color:#5b21b6}
.hdr-icon:focus-visible{outline:2px solid #6d43dd;outline-offset:2px}
.hdr-icon[aria-pressed="true"]{background:#1f2433;color:#fde68a;border-color:#1f2433}
.hdr-count{position:absolute;top:-6px;right:-6px;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:#dc2626;color:#fff;font-size:10.5px;font-weight:700;line-height:18px;text-align:center}
.hdr-count[hidden]{display:none}
@media(max-width:640px){
  .header-site{display:none}
  .header-tools{gap:5px}
  .hdr-icon{width:32px;height:32px}
}

/* Dark mode: an inverted, hue-preserving palette for the whole console; media keep true colours. */
html[data-theme="dark"]{filter:invert(.92) hue-rotate(180deg);background:#0b0f19}
html[data-theme="dark"] img,html[data-theme="dark"] video,html[data-theme="dark"] .vb-flag,html[data-theme="dark"] .vb-br,html[data-theme="dark"] .dk-flag{filter:invert(1) hue-rotate(180deg)}

/* ---- CR-1818: labelled sidebar from 768 px (replaces the icon rail) ---- */
@media(min-width:768px) and (max-width:1399px){
  .shell{grid-template-columns:208px minmax(0,1fr)}
  .shell>aside{padding:16px 10px}
  .shell>aside .brand{padding:0 6px 14px}
  .shell>aside nav{display:flex;flex-direction:column;gap:2px;overflow:visible}
  .shell>aside .nav-group{display:block}
  .shell>aside nav button{justify-content:flex-start;min-height:34px;padding:6px 10px;font-size:13px;text-align:left}
  .shell>aside .nav-group>span,.shell>aside .nav-group-heading{display:flex!important}
  .shell>aside nav .nav-label{position:static;width:auto;height:auto;overflow:hidden;clip:auto;white-space:nowrap}
  .shell>aside nav .nav-badge{display:inline-block}
  .shell>aside .account{display:flex!important}
  .shell>aside .workspace-context{display:none!important}
}
@media(min-width:768px) and (max-width:1100px){
  .shell{grid-template-columns:176px minmax(0,1fr)}
  .shell>aside nav button{padding:6px 8px}
}

/* ---- CR-1818: every column of the mockup at every desktop/tablet width ---- */
@media(min-width:768px) and (max-width:1399px){
  .vb-body{overflow-x:auto}
  .vb-table td,.vb-table th{padding-left:8px;padding-right:8px}
  .vb-c-act{width:112px}
  .vb-desc{display:flex;font-size:11.5px}
}
@media(min-width:768px) and (max-width:1100px){
  .vb-sh{flex-wrap:wrap;row-gap:2px}
  .vb-desc{flex-basis:100%;margin-left:30px;text-align:left}
  /* Fit every column without a horizontal scroll: tags wrap under the name, long texts truncate. */
  .vb-table{font-size:12.5px}
  .vb-table td,.vb-table th{padding-left:6px;padding-right:6px}
  .vb-vis{flex-wrap:wrap;row-gap:3px}
  .vb-chip{font-size:11px}
  .vb-page{max-width:104px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .vb-agent-name{max-width:84px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;vertical-align:middle}
  .vb-ref{max-width:112px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .vb-c-act{width:auto}
  .vb-open{padding:4px 7px}
  .vb-c-online,.vb-c-visits,.vb-c-chats{white-space:nowrap}
  .vb-c-act{white-space:normal;max-width:96px}
  .vb-act{flex-wrap:wrap;justify-content:flex-end}
  .vb-leftnote,.vb-removal{white-space:normal;text-align:right;font-size:11px;line-height:1.25}
  .vb-dev{display:none}
  .header-titleline .header-site{max-width:140px}
}

/* ---- Phones: rows stay cards; Referrer is always shown, Visits and Chats move to the detail line ---- */
@media(max-width:767px){
  .vb-sh{row-gap:2px}
  .vb-desc{display:block;flex-basis:100%;margin-left:0;text-align:left;font-size:11.5px}
  .vb-desc svg{display:none}
  .vb-table tr.vb-row{grid-template-columns:minmax(0,1fr) auto auto}
  .vb-c-status{grid-column:1}
  .vb-c-online{grid-column:2/-1}
  .vb-c-ref{display:block!important;grid-column:1;font-size:12px;min-width:0}
  .vb-c-ref .vb-ref{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .vb-c-visits,.vb-c-chats{display:block!important;font-size:12px;color:var(--vb-muted);text-align:right;white-space:nowrap}
  .vb-c-visits{grid-column:2}.vb-c-chats{grid-column:3}
  .vb-c-visits::before{content:"Visits ";color:var(--vb-muted)}
  .vb-c-chats::before{content:"· Chats ";color:var(--vb-muted)}
}
/* Phones: the page title keeps its room; dark mode stays available from 481 px up. */
@media(max-width:480px){#theme-toggle{display:none}}

/* F4d: staff bubble timestamps reach 4.5:1 on the violet bubble; profile contact fields show focus. */
.bubble.assistant .message-head time,.previous-session-message.assistant .message-head time{color:#475467}
#visitor-detail .dk-fld:focus-within{outline:2px solid #6d43dd;outline-offset:1px;box-shadow:0 0 0 4px rgba(109,67,221,.18);border-color:#6d43dd}
#visitor-detail .dk-fld input:focus-visible{outline:none}
