/* =============================================================================
   Agent workspace layout (index.html dashboard). Loaded after styles.css,
   features.css and themes.css. Uses the agent colour variables (--bg, --bg1,
   --accent, --t1 ...) so all 8 themes and the agent's custom colours apply.
   Soft tints use color-mix() with a plain fallback for older browsers.
   ============================================================================= */
body.agent-app #dashboard-screen.active { display:block; position:fixed; inset:0; height:auto; overflow:hidden; background:var(--bg); }
.ws-legacy { display:none !important; }
.wsi { width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; flex:none; }
.wsi.sm { width:15px; height:15px; }
.ws-k { display:inline-grid; place-items:center; min-width:18px; height:18px; padding:0 5px; border-radius:5px; border:1px solid var(--border2); color:var(--t3); font:700 10.5px/1 var(--font); background:transparent; }
.ws-noshort .ws-k, .ws-noshort #ws-help-btn { display:none !important; }
.ws-nochat [data-ws="chat"], .ws-nochat [data-chat] { display:none !important; }

/* ---------- grid ---------- */
.ws-app { display:grid; height:100%; grid-template-columns:76px minmax(0,1fr) 316px; grid-template-rows:60px minmax(0,1fr); grid-template-areas:"top top top" "rail main dial"; background:var(--bg); color:var(--t1); font-family:var(--font); }
.ws-app.ws-dialer-collapsed { grid-template-columns:76px minmax(0,1fr) 72px; }
.ws-top { grid-area:top; } .ws-rail { grid-area:rail; } .ws-main { grid-area:main; } .ws-dialer, .ws-slim { grid-area:dial; }
.ws-slim { display:none; }
.ws-app.ws-dialer-collapsed .ws-dialer { display:none; }
.ws-app.ws-dialer-collapsed .ws-slim { display:flex; }

/* ---------- top bar ---------- */
.ws-top { display:flex; align-items:center; gap:14px; padding:0 16px 0 14px; background:var(--bg1); border-bottom:1px solid var(--border); position:relative; z-index:30; }
.ws-brand { display:flex; align-items:center; gap:10px; min-width:0; width:240px; flex:none; }
.ws-brand .al-logo { width:36px; height:36px; border-radius:10px; flex:none; }
.ws-brand-t { min-width:0; } .ws-brand-t b { display:block; font-size:14px; color:var(--c-heading,var(--t1)); white-space:nowrap; }
.ws-brand-t small { display:block; font-size:11px; color:var(--t2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:190px; }
.ws-search { flex:1; max-width:520px; display:flex; align-items:center; gap:9px; height:38px; padding:0 10px 0 12px; border:1px solid var(--border2); border-radius:10px; background:var(--bg2); color:var(--t2); cursor:text; }
.ws-search input { flex:1; min-width:0; border:0; outline:0; background:transparent; color:var(--t1); font:inherit; font-size:13px; height:100%; }
.ws-search:focus-within { border-color:var(--accent); box-shadow:0 0 0 3px var(--c-accent-soft,rgba(79,140,255,.15)); }
.ws-top-r { margin-left:auto; display:flex; align-items:center; gap:8px; }
.ws-ico { width:38px; height:38px; border-radius:10px; display:grid; place-items:center; color:var(--c-text2,var(--t1)); border:1px solid var(--border); background:transparent; cursor:pointer; flex:none; }
.ws-ico:hover { background:var(--bg2); color:var(--t1); }
.ws-ico.ws-sm { width:28px; height:28px; border-radius:8px; }
body.agent-app .ws-top #theme-btn { width:38px; height:38px; border-radius:10px; border:1px solid var(--border); background:transparent; }
body.agent-app .ws-top .theme-picker { position:absolute; top:56px; right:150px; z-index:60;
  /* Never run off the bottom of the window — scroll inside the panel instead,
     so every section (ringtone, theme, custom colours, buttons) is reachable. */
  max-height:calc(100vh - 72px); max-height:calc(100dvh - 72px); overflow-y:auto; overscroll-behavior:contain; }
body.agent-app .theme-picker .theme-picker-sub.rt-first { border-top:0; padding-top:0; margin-top:0; }
.ws-top .agent-badge { display:flex; align-items:center; gap:9px; padding-left:4px; }
.ws-top .agent-avatar { width:36px; height:36px; font-size:13px; }

.ws-status-wrap { position:relative; }
.ws-status { display:flex; align-items:center; gap:8px; height:38px; padding:0 10px 0 12px; border-radius:999px; border:1px solid var(--border2); background:var(--bg2); color:var(--t1); font:600 13px var(--font); cursor:pointer; white-space:nowrap; }
.ws-status-time { color:var(--t2); font-weight:500; font-variant-numeric:tabular-nums; }
.ws-dot { width:9px; height:9px; border-radius:50%; background:var(--t3); flex:none; }
[data-ws-state="available"] .ws-dot { background:var(--green); box-shadow:0 0 0 4px var(--c-ok-soft,rgba(46,204,113,.15)); }
[data-ws-state="oncall"] .ws-dot, [data-ws-state="ringing"] .ws-dot { background:var(--red); box-shadow:0 0 0 4px var(--c-bad-soft,rgba(255,90,95,.15)); }
[data-ws-state="wrap"] .ws-dot { background:var(--purple); box-shadow:0 0 0 4px rgba(124,92,255,.18); }
[data-ws-state="break"] .ws-dot, [data-ws-state="dnd"] .ws-dot { background:var(--amber); box-shadow:0 0 0 4px var(--c-warn-soft,rgba(245,165,36,.15)); }
[data-ws-state="dnd"] .ws-dot { background:var(--red); }
.ws-menu { position:absolute; right:0; top:46px; width:272px; padding:6px; border-radius:14px; background:var(--bg1); border:1px solid var(--border2); box-shadow:var(--c-shadow,0 20px 50px rgba(0,0,0,.45)); z-index:70; }
.ws-menu .status-bar { display:flex; flex-direction:column; gap:2px; background:none; border:0; padding:0; }
.ws-menu .status-btn { display:flex; align-items:center; gap:11px; width:100%; padding:9px 10px; border-radius:9px; border:0; background:transparent; color:var(--t1); text-align:left; cursor:pointer; height:auto; }
.ws-menu .status-btn:hover { background:var(--bg2); }
.ws-menu .status-btn.active { background:var(--bg2); }
.ws-menu .status-btn.active::after { content:"✓"; margin-left:auto; color:var(--accent); font-weight:700; }
.ws-menu .status-btn:disabled { opacity:.45; cursor:not-allowed; }
.ws-sb-txt { display:flex; flex-direction:column; } .ws-sb-txt .status-label { font-weight:600; font-size:13px; display:inline !important; } .ws-sb-txt small { color:var(--t2); font-size:11.5px; }
.ws-menu .dot { width:10px; height:10px; border-radius:50%; flex:none; }
.ws-menu-sep { height:1px; background:var(--border); margin:6px 4px; }
.ws-menu #btn-offline { color:var(--red); } .ws-menu #btn-offline .status-label { color:var(--red); }

/* ---------- side menu ---------- */
.ws-rail { display:flex; flex-direction:column; gap:3px; padding:10px 8px; background:var(--bg1); border-right:1px solid var(--border); overflow-y:auto; overflow-x:hidden; scrollbar-width:thin; scrollbar-color:var(--border2) transparent; }
.ws-rail::-webkit-scrollbar { width:6px; }
.ws-rail::-webkit-scrollbar-thumb { background:var(--border2); border-radius:3px; }
.ws-rail::-webkit-scrollbar-track { background:transparent; }
/* rail items never shrink/overlap, even on short screens or in Firefox/Safari */
.ws-rail > * { flex-shrink:0; }
.ws-ri { position:relative; flex-shrink:0; display:flex; flex-direction:column; align-items:center; gap:4px; padding:9px 2px; border:0; border-radius:12px; background:transparent; color:var(--t2); font:600 10.5px var(--font); cursor:pointer; }
.ws-ri:hover { color:var(--t1); background:var(--bg2); }
.ws-ri.on { color:var(--accent); background:var(--c-accent-soft,rgba(79,140,255,.13)); }
.ws-ri .wsi { width:21px; height:21px; }
.ws-ri-l { white-space:nowrap; }
.ws-rail-sp { flex:1; min-height:8px; }
.ws-badge { position:absolute; top:4px; right:9px; min-width:17px; height:17px; padding:0 4px; border-radius:9px; background:var(--accent); color:var(--c-on-accent,#fff); font:700 10px/17px var(--font); text-align:center; display:inline-block; }
.ws-badge-warn { background:var(--amber); color:#1a1200; }
.ws-badge.ws-zero, .ws-zero { display:none !important; }

/* ---------- main ---------- */
.ws-main { overflow-y:auto; padding:20px 22px 28px; display:flex; flex-direction:column; gap:16px; min-width:0; }
.ws-main > .view-panel { padding:0; background:none; border:0; display:flex; flex-direction:column; gap:14px; }
.ws-main > .view-panel.hidden { display:none; }
.ws-main .panel-title { font-size:20px; font-weight:700; letter-spacing:-.01em; text-transform:none; color:var(--c-heading,var(--t1)); margin:0; padding:0; border:0; display:flex; align-items:center; gap:10px; }
.ws-main .panel-title .btn-primary { margin-left:auto; }
.ws-sub { color:var(--t2); font-size:13px; margin:2px 0 0; }
.ws-sub-under { margin-top:-8px; }
.ws-page-head { display:flex; align-items:flex-start; gap:12px; flex-wrap:wrap; }
.ws-h1 { font-size:20px; font-weight:700; margin:0; letter-spacing:-.01em; color:var(--c-heading,var(--t1)); }
.ws-head-actions { margin-left:auto; display:flex; gap:8px; flex-wrap:wrap; }
.ws-btn { height:36px; padding:0 13px; border-radius:9px; border:1px solid var(--border2); background:var(--bg2); color:var(--t1); font:600 13px var(--font); display:inline-flex; align-items:center; gap:7px; cursor:pointer; white-space:nowrap; }
.ws-btn:hover { border-color:var(--accent); }
.ws-pri { background:var(--accent); border-color:var(--accent); color:var(--c-on-accent,#fff); }
.ws-card { background:var(--bg1); border:1px solid var(--border); border-radius:14px; overflow:hidden; }
.ws-card-h { display:flex; align-items:center; justify-content:space-between; padding:13px 16px; border-bottom:1px solid var(--border); }
.ws-card-h b { font-size:14px; }
.ws-link { background:none; border:0; color:var(--accent); font:600 12.5px var(--font); cursor:pointer; }
.ws-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.ws-kpi { padding:14px 16px; }
.ws-kpi-l { display:flex; align-items:center; gap:8px; color:var(--t2); font-size:12px; }
.ws-kpi-i { width:28px; height:28px; border-radius:8px; display:grid; place-items:center; }
.ws-kpi-i.accent { color:var(--accent); background:var(--c-accent-soft,rgba(79,140,255,.13)); }
.ws-kpi-i.ok { color:var(--green); background:var(--c-ok-soft,rgba(46,204,113,.13)); }
.ws-kpi-i.bad { color:var(--red); background:var(--c-bad-soft,rgba(255,90,95,.12)); }
.ws-kpi-i.warn { color:var(--amber); background:var(--c-warn-soft,rgba(245,165,36,.13)); }
.ws-kpi-v { font-size:24px; font-weight:700; margin-top:8px; letter-spacing:-.02em; font-variant-numeric:tabular-nums; }
.ws-grid2 { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(0,1fr); gap:16px; align-items:start; }
.ws-row { display:flex; align-items:center; gap:12px; padding:11px 16px; border-bottom:1px solid var(--border); width:100%; background:none; border-left:0; border-right:0; border-top:0; color:inherit; text-align:left; font:inherit; }
.ws-row:last-child { border-bottom:0; }
.ws-row-btn { cursor:pointer; } .ws-row-btn:hover { background:var(--bg2); }
.ws-row-t { flex:1; min-width:0; } .ws-row-t b { display:block; font-weight:600; font-size:13.5px; } .ws-row-t small { display:block; color:var(--t2); font-size:12px; margin-top:1px; }
.ws-num { font-variant-numeric:tabular-nums; letter-spacing:.01em; }
.ws-dir { width:30px; height:30px; border-radius:9px; display:grid; place-items:center; flex:none; }
.ws-dir.in { color:var(--green); background:var(--c-ok-soft,rgba(46,204,113,.13)); }
.ws-dir.out { color:var(--accent); background:var(--c-accent-soft,rgba(79,140,255,.13)); }
.ws-dir.miss { color:var(--red); background:var(--c-bad-soft,rgba(255,90,95,.12)); }
.ws-chip { display:inline-flex; align-items:center; gap:6px; height:24px; padding:0 9px; border-radius:999px; font-size:11.5px; font-weight:600; background:var(--bg3); color:var(--c-text2,var(--t1)); white-space:nowrap; text-transform:capitalize; }
.ws-chip-in { color:var(--green); background:var(--c-ok-soft,rgba(46,204,113,.13)); }
.ws-chip-out { color:var(--accent); background:var(--c-accent-soft,rgba(79,140,255,.13)); }
.ws-chip-warn { color:var(--amber); background:var(--c-warn-soft,rgba(245,165,36,.13)); }
.ws-chip-ok { color:var(--green); background:var(--c-ok-soft,rgba(46,204,113,.13)); }
.ws-mini { width:32px; height:32px; border-radius:9px; display:grid; place-items:center; border:1px solid var(--border2); background:transparent; color:var(--t2); cursor:pointer; flex:none; }
.ws-mini:hover { color:var(--t1); border-color:var(--accent); }
.ws-mini-call { color:var(--green); } .ws-mini-call:hover { border-color:var(--green); color:var(--green); }
.ws-empty-sm { padding:18px 16px; color:var(--t2); font-size:13px; }
.ws-subtabs { display:inline-flex; gap:4px; padding:3px; border-radius:10px; background:var(--bg2); align-self:flex-start; }
.ws-subtabs button { border:0; background:transparent; color:var(--t2); font:600 12.5px var(--font); padding:6px 12px; border-radius:8px; cursor:pointer; }
.ws-subtabs button.on { background:var(--bg1); color:var(--t1); box-shadow:0 1px 2px rgba(0,0,0,.25); }

/* ---------- call card ---------- */
.ws-callcard.hidden { display:none !important; }
.ws-callcard { display:block !important; padding:0 !important; margin:0; border-radius:16px; border:1px solid var(--border); background:var(--bg1); overflow:hidden; flex:none; }
.ws-cc-head { display:flex; align-items:center; gap:16px; padding:18px 20px; background:var(--bg1); background:linear-gradient(120deg, color-mix(in srgb, var(--green) 13%, var(--bg1)) 0%, var(--bg1) 60%); }
.ws-callcard .call-avatar { width:54px; height:54px; border-radius:50%; font-size:17px; font-weight:700; display:grid; place-items:center; color:#fff; background:linear-gradient(135deg,#0ea5e9,#22c55e); flex:none; }
.ws-cc-info { min-width:0; }
.ws-callcard .call-peer { font-size:21px; font-weight:700; letter-spacing:-.01em; color:var(--c-heading,var(--t1)); font-variant-numeric:tabular-nums; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ws-cc-meta { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:6px; }
.ws-callcard .call-state { font-size:11.5px; color:var(--c-text2,var(--t1)); }
.ws-rec { display:inline-flex; align-items:center; gap:6px; color:var(--red); font-weight:600; font-size:12px; } .ws-rec i { width:8px; height:8px; border-radius:50%; background:var(--red); }
.ws-cc-timer { margin-left:auto; text-align:right; flex:none; }
.ws-callcard .call-timer { font-size:30px; font-weight:700; letter-spacing:-.02em; font-variant-numeric:tabular-nums; color:var(--c-heading,var(--t1)); display:block !important; font-family:var(--font); }
.ws-cc-timer small { color:var(--t2); font-size:12px; }
.ws-cc-ctrls { display:flex; flex-wrap:wrap; gap:8px; padding:14px 20px; border-top:1px solid var(--border); }
.ws-ctl { height:44px !important; width:auto !important; min-width:0 !important; padding:0 13px !important; border-radius:11px !important; display:inline-flex !important; align-items:center; gap:8px; font:600 13px var(--font) !important; background:var(--bg2) !important; border:1px solid var(--border2) !important; color:var(--t1) !important; cursor:pointer; box-shadow:none !important; }
.ws-ctl.hidden { display:none !important; }
.ws-ctl:hover { border-color:var(--accent) !important; }
.ws-ctl .wsi { width:17px; height:17px; }
.ws-ctl.ws-on, .ws-ctl.muted, .ws-ctl.on-hold { background:var(--c-warn-soft,rgba(245,165,36,.15)) !important; border-color:var(--amber) !important; color:var(--amber) !important; }
.ws-ctl.ws-end { margin-left:auto; background:var(--c-bad-solid,var(--red)) !important; border-color:var(--c-bad-solid,var(--red)) !important; color:#fff !important; padding:0 18px !important; }
.ws-ctl.ws-end .ws-k { color:rgba(255,255,255,.85); border-color:rgba(255,255,255,.4); }
.ws-cc-tabs { display:flex; gap:4px; padding:0 14px 12px; }
.ws-cct { display:inline-flex; align-items:center; gap:7px; border:0; background:transparent; color:var(--t2); font:600 12.5px var(--font); padding:7px 12px; border-radius:9px; cursor:pointer; }
.ws-cct.on, .ws-cct:hover { background:var(--bg2); color:var(--t1); }
body.agent-app .ws-main .wrap-badge:not(.hidden) { display:flex; align-items:center; gap:12px; padding:10px 14px; border-radius:12px; background:rgba(124,92,255,.14); border:1px solid rgba(124,92,255,.35); color:var(--purple); margin:0; }
body.agent-app .ws-main .callback-bar:not(.hidden) { border-radius:14px; margin:0; }

/* ---------- dialer column ---------- */
.ws-dialer { display:flex; flex-direction:column; background:var(--bg1); border-left:1px solid var(--border); overflow-y:auto; min-height:0; }
.ws-dial-head { display:flex; align-items:center; justify-content:space-between; padding:14px 16px 0; }
.ws-lbl { font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--t3); font-weight:700; display:flex; align-items:center; justify-content:space-between; gap:8px; }
.ws-lbl span { text-transform:none; letter-spacing:0; color:var(--green); font-weight:600; }
.ws-dialer #dialer-section { padding:10px 16px 16px; border-bottom:1px solid var(--border); }
.ws-dialer .dial-row { display:flex; gap:8px; align-items:center; margin-bottom:12px; }
.ws-dialer .dial-input { flex:1; height:48px; font-size:19px; font-weight:600; letter-spacing:.02em; border-radius:12px; }
.ws-dialer .btn-icon-sm { width:40px; height:48px; border-radius:12px; display:grid; place-items:center; }
.ws-dialer .keypad { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.ws-dialer .key { height:50px; border-radius:12px; font-size:19px; }
.ws-dialer .call-btns { margin-top:12px; display:block; }
.ws-dialer .ws-callbig { width:100% !important; height:50px !important; border-radius:12px !important; display:flex !important; align-items:center; justify-content:center; gap:10px; font:700 15px var(--font); color:#fff; }
.ws-dialer .ws-callbig.hidden { display:none !important; }
.ws-dialer .ws-callbig svg { width:20px; height:20px; }
.ws-team { padding:14px 16px; }
.ws-tm { display:flex; align-items:center; gap:10px; padding:8px 0; width:100%; background:none; border:0; color:inherit; text-align:left; font:inherit; }
.ws-tm-t { flex:1; min-width:0; } .ws-tm-t b { display:block; font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } .ws-tm-t small { display:block; color:var(--t2); font-size:11.5px; }
.ws-tm-t em { font-style:normal; color:var(--t3); font-weight:500; font-size:11.5px; }
.ws-av { position:relative; width:34px; height:34px; border-radius:50%; display:grid; place-items:center; font:700 12px var(--font); color:#fff; background:linear-gradient(135deg,#6366f1,#8b5cf6); flex:none; border:0; }
.ws-av::after { content:""; position:absolute; right:-1px; bottom:-1px; width:10px; height:10px; border-radius:50%; border:2px solid var(--bg1); background:var(--t3); }
.ws-av.st-online::after { background:var(--green); } .ws-av.st-in_call::after { background:var(--red); } .ws-av.st-break::after { background:var(--amber); } .ws-av.st-dnd::after { background:var(--red); }
.ws-av-room { background:linear-gradient(135deg,#0ea5e9,#6366f1); } .ws-av-room::after { display:none; }
.ws-slim { flex-direction:column; align-items:center; gap:8px; padding:12px 0; background:var(--bg1); border-left:1px solid var(--border); overflow-y:auto; }
.ws-slim small { font-size:10.5px; font-weight:600; color:var(--t2); display:flex; align-items:center; gap:4px; }
.ws-slim-dial { width:48px; height:48px; border-radius:15px; border:0; background:var(--c-ok-solid,var(--green)); color:#fff; display:grid; place-items:center; cursor:pointer; margin-top:4px; }
.ws-slim-sep { width:36px; height:1px; background:var(--border); margin:6px 0; }
#ws-slim-team { display:flex; flex-direction:column; gap:8px; align-items:center; }
#ws-slim-team .ws-av { width:38px; height:38px; cursor:pointer; }
.ws-fab { display:none; }

/* ---------- incoming call ---------- */
.ws-incoming.hidden { display:none !important; }
.ws-incoming { position:fixed !important; inset:0; z-index:90; display:flex !important; align-items:flex-start; justify-content:center; padding-top:84px; background:var(--c-overlay,rgba(3,5,9,.55)); margin:0 !important; border:0 !important; }
.ws-in-card { width:380px; max-width:calc(100vw - 32px); border-radius:22px; padding:24px 24px 22px; text-align:center; color:#fff; background:radial-gradient(120% 90% at 50% 0%,#1f4fd1 0%,#0f2a6b 55%,#0a1430 100%); box-shadow:0 30px 80px rgba(0,0,0,.55); animation:wsPop .18s ease-out; }
@keyframes wsPop { from { transform:translateY(-10px); opacity:0; } to { transform:none; opacity:1; } }
.ws-in-tag { display:inline-flex; align-items:center; gap:7px; padding:6px 12px; border-radius:999px; background:rgba(255,255,255,.13); font-weight:600; font-size:12.5px; }
.ws-in-ring { position:relative; width:96px; height:96px; margin:28px auto 0; border-radius:50%; display:grid; place-items:center; background:rgba(255,255,255,.14); font-size:28px; font-weight:700; }
.ws-in-ring::before, .ws-in-ring::after { content:""; position:absolute; inset:-12px; border-radius:50%; border:2px solid rgba(255,255,255,.2); animation:wsRing 1.6s ease-out infinite; }
.ws-in-ring::after { animation-delay:.8s; }
@keyframes wsRing { from { transform:scale(.85); opacity:1; } to { transform:scale(1.35); opacity:0; } }
.ws-incoming .incoming-label { display:none; }
.ws-incoming .incoming-num { margin-top:26px; font-size:26px; font-weight:700; letter-spacing:.01em; color:#fff; font-variant-numeric:tabular-nums; }
.ws-in-btns { display:flex; justify-content:space-around; margin-top:28px; }
.ws-in-btns > div { display:flex; flex-direction:column; align-items:center; gap:9px; font-weight:600; font-size:13px; }
.ws-in-btns .ws-k { color:rgba(255,255,255,.75); border-color:rgba(255,255,255,.35); }
.ws-incoming .call-action-btn { width:68px !important; height:68px !important; border-radius:50% !important; display:grid !important; place-items:center; border:0; color:#fff; cursor:pointer; }
.ws-incoming .call-action-btn svg { width:28px; height:28px; }
.ws-incoming .call-action-btn.answer { background:#22c55e !important; box-shadow:0 0 0 10px rgba(34,197,94,.2); }
.ws-incoming .call-action-btn.reject { background:#ef4444 !important; }

/* ---------- views polish ---------- */
.ws-main .search-bar input, .ws-main .search-bar { max-width:420px; }
.ws-main .call-log, .ws-main .ext-list, .ws-main .queue-list, .ws-main #cb-list-container, .ws-main .pending-disp-list, .ws-main .notice-list, .ws-main #fx-pb-list { background:var(--bg1); border:1px solid var(--border); border-radius:14px; overflow:hidden; max-height:none; }
.ws-main .log-item, .ws-main .ext-item { border-radius:0 !important; border:0 !important; border-bottom:1px solid var(--border) !important; margin:0 !important; padding:12px 16px !important; background:transparent !important; display:flex; align-items:center; gap:12px; }
.ws-main .log-item { transition:background .12s; }
.ws-main .log-item:hover { background:var(--bg2) !important; }
.ws-main .log-item .log-main { flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
.ws-main .log-item .log-num { font-weight:600; font-size:14px; font-variant-numeric:tabular-nums; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ws-main .log-item .log-meta { display:flex; gap:10px; align-items:center; color:var(--t2); font-size:12px; flex-wrap:wrap; }
.ws-main .log-item .log-when { color:var(--t3); }
.ws-main .log-item .log-status { color:var(--t2); background:var(--bg2); border:1px solid var(--border); border-radius:6px; padding:1px 7px; font-size:11px; }
.ws-main .log-item:hover .log-status { background:var(--bg3); }
/* direction badge (pill with arrow) — professional, colour-coded */
.ws-main .log-dir-badge { display:inline-flex; align-items:center; gap:5px; flex-shrink:0; min-width:92px; font-size:11.5px; font-weight:600; padding:4px 9px; border-radius:999px; border:1px solid transparent; letter-spacing:.01em; }
.ws-main .log-dir-badge .log-dir-ic { font-size:13px; line-height:1; }
.ws-main .log-dir-badge.log-in { color:var(--green); background:var(--c-ok-soft,rgba(46,204,113,.13)); border-color:var(--c-ok-soft,rgba(46,204,113,.22)); }
.ws-main .log-dir-badge.log-out { color:var(--accent); background:var(--c-accent-soft,rgba(79,140,255,.13)); border-color:var(--c-accent-soft,rgba(79,140,255,.22)); }
.ws-main .log-dir-badge.log-missed { color:var(--red); background:var(--c-bad-soft,rgba(255,90,95,.12)); border-color:var(--c-bad-soft,rgba(255,90,95,.22)); }
.ws-main .log-dir-badge.log-callback { color:var(--purple,#8b5cf6); background:rgba(139,92,246,.13); border-color:rgba(139,92,246,.22); }
.ws-main .log-call-btn, .ws-main .ext-call-btn { width:auto !important; padding:6px 14px !important; border-radius:9px !important; }
.ws-main .ext-item .ext-info { flex:1; } .ws-main .ext-item .ext-right { display:flex; align-items:center; gap:12px; }
.ws-main .pagination { justify-content:flex-end; }
.ws-main .empty-state { padding:28px 16px; }
.ws-main #view-summary .summary-grid { gap:12px; }

/* ---------- team chat ---------- */
.ws-chat { display:grid; grid-template-columns:300px minmax(0,1fr); height:calc(100vh - 170px); min-height:380px; border:1px solid var(--border); border-radius:16px; overflow:hidden; background:var(--bg1); }
.ws-chat.hidden { display:none; }
.ws-chat-list { border-right:1px solid var(--border); display:flex; flex-direction:column; min-height:0; }
.ws-chat-list .search-bar { padding:12px; margin:0; } .ws-chat-list .search-bar input { width:100%; }
.ws-chat-contacts { overflow-y:auto; flex:1; }
.ws-cc-item { position:relative; display:flex; align-items:center; gap:10px; width:100%; padding:10px 14px; border:0; background:transparent; color:inherit; text-align:left; font:inherit; cursor:pointer; border-bottom:1px solid var(--border); }
.ws-cc-item:hover { background:var(--bg2); } .ws-cc-item.on { background:var(--c-accent-soft,rgba(79,140,255,.13)); }
.ws-cc-item .ws-badge { position:static; }
.ws-cc-item small { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ws-chat-thread { display:flex; flex-direction:column; min-height:0; min-width:0; }
.ws-chat-head { display:flex; align-items:center; gap:10px; padding:12px 16px; border-bottom:1px solid var(--border); min-height:58px; }
.ws-chat-head b { display:block; font-size:14px; } .ws-chat-head small { display:block; color:var(--t2); font-size:12px; }
.ws-chat-head #ws-chat-title:not(:has(b)) { color:var(--t2); }
.ws-chat-back { display:none; }
.ws-chat-msgs { flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:8px; background:var(--bg); }
.ws-msg { max-width:72%; align-self:flex-start; display:flex; flex-direction:column; gap:3px; }
.ws-msg.mine { align-self:flex-end; align-items:flex-end; }
.ws-msg-b { padding:9px 13px; border-radius:14px 14px 14px 4px; background:var(--bg2); border:1px solid var(--border); line-height:1.45; font-size:13.5px; word-break:break-word; }
.ws-msg.mine .ws-msg-b { background:var(--accent); border-color:var(--accent); color:var(--c-on-accent,#fff); border-radius:14px 14px 4px 14px; }
.ws-msg-t, .ws-msg-n { font-size:11px; color:var(--t3); } .ws-msg-n { color:var(--t2); font-weight:600; }
.ws-chat-compose { display:flex; gap:8px; align-items:flex-end; padding:12px; border-top:1px solid var(--border); }
.ws-chat-compose textarea { flex:1; resize:none; min-height:42px; max-height:140px; padding:10px 12px; border-radius:11px; border:1px solid var(--border2); background:var(--bg2); color:var(--t1); font:inherit; font-size:13.5px; line-height:1.4; }
.ws-chat-compose textarea:focus { outline:0; border-color:var(--accent); }
.ws-chat-compose .ws-btn { height:42px; }
.ws-chat-compose :disabled { opacity:.5; cursor:not-allowed; }

/* ---------- pop-ups ---------- */
.ws-xfer-list { margin-top:12px; max-height:220px; overflow-y:auto; }
.ws-xfer-list .ws-lbl { margin-bottom:4px; }
.ws-xfer-opt { padding:7px 8px !important; border-radius:10px; cursor:pointer; }
.ws-xfer-opt:hover, .ws-xfer-opt.on { background:var(--c-accent-soft,rgba(79,140,255,.13)); }
#disposition-list .disp-item { position:relative; }
#disposition-list .disp-item .ws-k { margin-left:auto; }
.ws-sk { display:grid; grid-template-columns:1fr auto; gap:9px 18px; align-items:center; font-size:13px; }
.ws-sk > span { color:var(--c-text2,var(--t1)); }
.ws-sk > b { display:flex; gap:4px; justify-content:flex-end; align-items:center; flex-wrap:wrap; }
.ws-sk .ws-k { min-width:24px; height:24px; font-size:11.5px; color:var(--t1); background:var(--bg2); }
.ws-sk em { font-style:normal; color:var(--t3); font-size:11.5px; }

/* ---------- mobile tab bar / sheet (hidden on desktop) ---------- */
.ws-tabbar, .ws-sheet, .ws-sheet-dim { display:none; }

/* ============================ Laptop (1024–1279) ============================ */
@media (max-width:1279px) {
  .ws-brand { width:auto; } .ws-brand-t small { max-width:130px; }
  .ws-top .agent-info { display:none; }
  .ws-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ws-grid2 { grid-template-columns:minmax(0,1fr); }
}

/* ============================ Tablet (720–1023) ============================ */
@media (max-width:1023px) {
  .ws-app, .ws-app.ws-dialer-collapsed { grid-template-columns:72px minmax(0,1fr); grid-template-areas:"top top" "rail main"; }
  .ws-slim, .ws-app.ws-dialer-collapsed .ws-slim { display:none; }
  .ws-app .ws-dialer, .ws-app.ws-dialer-collapsed .ws-dialer { display:flex; position:fixed; top:60px; right:0; bottom:0; width:340px; max-width:100vw; z-index:80; transform:translateX(105%); transition:transform .2s ease; box-shadow:-20px 0 50px rgba(0,0,0,.4); }
  .ws-app.ws-dialer-open .ws-dialer { transform:none; }
  .ws-fab { display:grid; place-items:center; position:fixed; right:20px; bottom:20px; width:58px; height:58px; border-radius:18px; border:0; background:var(--accent); color:#fff; z-index:70; box-shadow:0 12px 30px rgba(0,0,0,.35); cursor:pointer; }
  .ws-fab .wsi { width:24px; height:24px; }
  .ws-app.ws-dialer-open .ws-fab { display:none; }
  .ws-main { padding:16px 16px 96px; }
  .ws-search { max-width:280px; }
  .ws-k { display:none; }
  .ws-sheet-dim { display:block; position:fixed; inset:0; background:var(--c-overlay,rgba(3,5,9,.55)); z-index:75; }
  .ws-sheet-dim.hidden { display:none; }
  .ws-chat { grid-template-columns:240px minmax(0,1fr); }
}

/* ============================ Phone (< 720) ============================ */
@media (max-width:719px) {
  .ws-app, .ws-app.ws-dialer-collapsed { grid-template-columns:minmax(0,1fr); grid-template-rows:56px minmax(0,1fr); grid-template-areas:"top" "main"; }
  .ws-rail, .ws-fab, .ws-search, .ws-brand-t, #ws-help-btn { display:none !important; }
  .ws-top { gap:8px; padding:0 12px; }
  .ws-brand { width:auto; }
  .ws-status { padding:0 10px; font-size:12.5px; } .ws-status-time { display:none; }
  .ws-top .agent-badge { padding-left:0; }
  /* Mobile: sit between the top bar and the bottom tab bar (66px + safe area),
     above the tab bar, and scroll inside — nothing hidden behind the nav. */
  body.agent-app .ws-top .theme-picker { position:fixed; right:8px; left:8px; top:60px; bottom:auto; width:auto; height:auto; z-index:75;
    max-height:calc(100vh - 60px - 66px - 20px); max-height:calc(100dvh - 60px - 66px - env(safe-area-inset-bottom) - 12px);
    overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
  .ws-menu { position:fixed; left:10px; right:10px; top:58px; width:auto; }
  .ws-main { padding:14px 12px 100px; gap:12px; }
  .ws-h1, .ws-main .panel-title { font-size:18px; }
  .ws-head-actions { margin-left:0; width:100%; } .ws-head-actions .ws-btn { flex:1; justify-content:center; padding:0 8px; font-size:12.5px; }
  .ws-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .ws-kpi { padding:12px; } .ws-kpi-v { font-size:20px; }
  .ws-row { padding:11px 12px; } .ws-row .ws-chip { display:none; }
  .ws-app .ws-dialer, .ws-app.ws-dialer-collapsed .ws-dialer { top:auto; left:0; right:0; bottom:0; width:auto; max-height:88vh; border-radius:22px 22px 0 0; border:0; transform:translateY(105%); box-shadow:0 -20px 60px rgba(0,0,0,.5); padding-bottom:env(safe-area-inset-bottom); }
  .ws-app.ws-dialer-open .ws-dialer { transform:none; }
  .ws-dialer .ws-team { display:none; }
  .ws-tabbar { display:grid; grid-template-columns:repeat(5,1fr); align-items:center; position:fixed; left:0; right:0; bottom:0; z-index:60; height:calc(66px + env(safe-area-inset-bottom)); padding:6px 6px env(safe-area-inset-bottom); background:var(--bg1); border-top:1px solid var(--border); }
  .ws-tabbar > button { position:relative; display:flex; flex-direction:column; align-items:center; gap:3px; border:0; background:none; color:var(--t2); font:600 10.5px var(--font); padding:4px 0; min-height:48px; cursor:pointer; }
  .ws-tabbar > button.on { color:var(--accent); }
  .ws-tabbar .wsi { width:22px; height:22px; }
  .ws-tb-key i { width:54px; height:54px; border-radius:18px; background:var(--accent); color:#fff; display:grid; place-items:center; margin-top:-24px; box-shadow:0 8px 22px rgba(0,0,0,.35); }
  .ws-tb-badge { position:absolute; top:0; left:calc(50% + 6px); min-width:16px; height:16px; padding:0 4px; border-radius:8px; background:var(--red); color:#fff; font:700 9.5px/16px var(--font); }
  .ws-sheet { display:block; position:fixed; left:0; right:0; bottom:0; z-index:85; padding:8px 12px calc(18px + env(safe-area-inset-bottom)); border-radius:22px 22px 0 0; background:var(--bg1); box-shadow:0 -20px 60px rgba(0,0,0,.5); }
  .ws-sheet.hidden { display:none; }
  .ws-grab { width:38px; height:4px; border-radius:2px; background:var(--border2); margin:2px auto 8px; }
  .ws-sheet > button { position:relative; display:flex; align-items:center; gap:14px; width:100%; min-height:50px; padding:0 10px; border:0; border-radius:12px; background:none; color:var(--t1); font:600 14.5px var(--font); text-align:left; cursor:pointer; }
  .ws-sheet > button:hover, .ws-sheet > button.on { background:var(--bg2); }
  .ws-sheet .ws-tb-badge { position:static; margin-left:auto; }
  .ws-app.ws-ringing .ws-tabbar, .ws-app.ws-incall .ws-tb-key { }
  /* call card: phone style */
  .ws-cc-head { flex-wrap:wrap; padding:16px; gap:12px; }
  .ws-callcard .call-avatar { width:46px; height:46px; font-size:15px; }
  .ws-callcard .call-peer { font-size:18px; }
  .ws-cc-timer { margin-left:auto; } .ws-callcard .call-timer { font-size:24px; }
  .ws-cc-ctrls { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; padding:12px; }
  .ws-ctl { flex-direction:column; justify-content:center; height:64px !important; padding:0 4px !important; gap:4px; font-size:12px !important; }
  .ws-ctl.ws-end { grid-column:1 / -1; margin-left:0; height:52px !important; flex-direction:row; font-size:14px !important; }
  .ws-cc-tabs { overflow-x:auto; }
  /* incoming: full screen */
  .ws-incoming { padding:0; align-items:stretch; background:none; }
  .ws-in-card { width:100%; max-width:none; border-radius:0; display:flex; flex-direction:column; align-items:center; padding:calc(60px + env(safe-area-inset-top)) 24px calc(46px + env(safe-area-inset-bottom)); }
  .ws-in-ring { width:120px; height:120px; margin-top:54px; font-size:36px; }
  .ws-incoming .incoming-num { font-size:30px; margin-top:40px; }
  .ws-in-btns { margin-top:auto; width:100%; }
  .ws-incoming .call-action-btn { width:76px !important; height:76px !important; }
  /* chat: list, then thread */
  .ws-chat { grid-template-columns:minmax(0,1fr); height:calc(100vh - 210px); }
  .ws-chat .ws-chat-thread { display:none; }
  .ws-chat.ws-thread-open .ws-chat-list { display:none; }
  .ws-chat.ws-thread-open .ws-chat-thread { display:flex; }
  .ws-chat-back { display:grid; }
  .ws-msg { max-width:86%; }
  .ws-main .log-item { flex-wrap:wrap; } .ws-main .log-item .log-num { min-width:0; }
  .ws-main .search-bar, .ws-main .search-bar input { max-width:none; }
  .modal .modal-box { width:calc(100vw - 24px) !important; max-width:none !important; max-height:86vh; overflow-y:auto; }
}
#ws-home { display:flex; flex-direction:column; gap:16px; }

.ws-main .panel-title { font-family:var(--font) !important; flex-wrap:wrap; }
.ws-main .panel-title > span:first-child { white-space:nowrap; }
.ws-main .panel-title .btn-primary { flex:none !important; width:auto !important; margin-left:auto !important; height:34px; padding:0 14px !important; border-radius:9px; font-size:13px !important; font-weight:600; display:inline-flex; align-items:center; gap:6px; }
.ws-main .log-item { flex-direction:row !important; text-align:left !important; justify-content:flex-start !important; }
.ws-main .log-item .log-num { text-align:left; font-family:var(--font); }
.ws-main .log-item .log-meta { justify-content:flex-start; text-transform:capitalize; }
.ws-main .log-item .log-call-btn { margin-left:auto; flex:none; }
.ws-main .ext-item .ext-num, .ws-main .ext-item .ext-pass { font-family:var(--font); }
.ws-callcard .call-peer { font-family:var(--font) !important; }
.ws-incall #view-active > .ws-page-head { display:none; }
.ws-incoming { flex-direction:row !important; align-items:flex-start !important; justify-content:center !important; background:var(--c-overlay,rgba(3,5,9,.55)) !important; border-radius:0 !important; padding:84px 16px 16px !important; gap:0 !important; }
/* Shortcuts cheat sheet — header + footer fixed, only the list scrolls;
   two columns where there is room, one on phones. */
#ws-shortcuts-modal .modal-box.ws-sk-box { max-width:760px; width:100%; padding:0; display:flex; flex-direction:column;
  max-height:calc(100vh - 32px); max-height:calc(100dvh - 32px); overflow:hidden; }
.ws-sk-head { display:flex; align-items:center; gap:12px; padding:18px 22px 14px; border-bottom:1px solid var(--border); flex:none; }
.ws-sk-head .modal-title { margin:0; font-size:17px; }
.ws-sk-x { margin-left:auto; width:34px; height:34px; display:grid; place-items:center; border:0; border-radius:9px; background:transparent;
  color:var(--t2); font-size:22px; line-height:1; cursor:pointer; }
.ws-sk-x:hover { background:var(--bg2); color:var(--t1); }
.ws-sk-x:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
.ws-sk-body { flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:16px 22px 6px;
  display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:4px 28px; align-content:start; }
.ws-sk-grp { min-width:0; margin-bottom:14px; }
.ws-sk-grp.ws-sk-wide { grid-column:1 / -1; }
.ws-sk-body > .ws-sk-grp:nth-child(1) { grid-column:1; grid-row:1; }
.ws-sk-body > .ws-sk-grp:nth-child(2) { grid-column:2; grid-row:1 / span 2; }
.ws-sk-body > .ws-sk-grp:nth-child(3) { grid-column:1; grid-row:2; }
.ws-sk-body > .ws-sk-grp:nth-child(4) { grid-row:3; }
.ws-sk-grp h4 { margin:0 0 8px; font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--t3); }
.ws-sk-grp .ws-sk { gap:7px 14px; }
.ws-sk-grp .ws-sk > span { min-width:0; line-height:1.35; }
.ws-sk-go { display:grid; grid-template-columns:repeat(5, minmax(0,1fr)); gap:8px; }
.ws-sk-gi { display:flex; align-items:center; gap:8px; min-width:0; padding:7px 9px; border:1px solid var(--border); border-radius:9px; background:var(--bg2); font-size:12.5px; }
.ws-sk-gi span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--c-text2,var(--t1)); }
#ws-shortcuts-modal .ws-k { display:inline-grid !important; }   /* the cheat sheet always shows its keys */
.ws-sk-gi .ws-k { min-width:24px; height:24px; font-size:11.5px; color:var(--t1); background:var(--bg1); flex:none; }
.ws-sk-foot { flex:none; display:flex; align-items:center; gap:14px; padding:12px 22px 16px; border-top:1px solid var(--border); }
.ws-sk-foot .ws-sub { margin:0; flex:1; min-width:0; }
.ws-sk-foot .btn-primary { flex:none; width:auto; min-width:110px; padding:0 20px; height:38px; }
@media (max-width:720px) {
  .ws-sk-body { grid-template-columns:minmax(0,1fr); padding:14px 16px 4px; }
  .ws-sk-body > .ws-sk-grp:nth-child(n) { grid-column:1; grid-row:auto; }
  .ws-sk-go { grid-template-columns:repeat(2, minmax(0,1fr)); }
  .ws-sk-head { padding:14px 16px 12px; }
  .ws-sk-foot { padding:10px 16px 14px; flex-wrap:wrap; }
  .ws-sk-foot .btn-primary { flex:1; height:44px; }
}
@media (max-height:520px) and (min-width:721px) { .ws-sk-go { grid-template-columns:repeat(5, minmax(0,1fr)); } }

/* Any pop-up taller than the screen: keep its top reachable (centred when it
   fits, otherwise starts at the top and the page scrolls) instead of being
   pushed above the screen edge where it cannot be scrolled to. */
.modal { align-items:flex-start; }
.modal > .modal-box { margin-top:auto; margin-bottom:auto; }
@media (max-width:600px) { .modal > .modal-box { margin-bottom:0; } }   /* phones keep the bottom sheet */
.ws-sk { grid-template-columns:minmax(0,1fr) auto; }
@media (max-width:719px) {
  .ws-incoming { padding:0 !important; align-items:stretch !important; background:none !important; }
}

/* =============================================================================
   v261 — compact call bar, customer form + caller panel, team for 100+ agents,
   transfer search, Scripts page with practice mode.
   ============================================================================= */
/* ---------- compact call bar ---------- */
.ws-callcard { display:flex !important; flex-wrap:wrap; align-items:center; border-radius:14px; }
.ws-callcard.hidden { display:none !important; }
.ws-callcard .ws-cc-head { flex:0 1 auto; min-width:0; padding:10px 14px; gap:12px; background:none; }
.ws-callcard .call-avatar { width:42px; height:42px; font-size:14px; }
.ws-callcard .call-peer { font-size:16.5px; }
.ws-callcard .ws-cc-meta { margin-top:3px; gap:6px; }
.ws-callcard .ws-chip { height:21px; font-size:11px; padding:0 8px; }
.ws-callcard .ws-cc-timer { margin-left:6px; padding-left:16px; border-left:1px solid var(--border); text-align:left; }
.ws-callcard .call-timer { font-size:22px; line-height:1.1; }
.ws-callcard .ws-cc-timer small { font-size:11px; }
.ws-callcard .ws-cc-ctrls { flex:1 1 520px; border-top:0; padding:10px 14px; gap:6px; justify-content:flex-end; }
.ws-callcard .ws-ctl { height:38px !important; padding:0 11px !important; border-radius:10px !important; font-size:12.5px !important; }
.ws-callcard .ws-ctl.ws-end { margin-left:6px; padding:0 15px !important; }
.ws-callcard .ws-cc-more { display:none !important; }
.ws-callcard .ws-cc-tabs { flex:1 0 100%; padding:0 10px; gap:2px; border-top:1px solid var(--border); }
.ws-callcard .ws-cct { border-radius:0; padding:10px 12px; border-bottom:2px solid transparent; margin-bottom:-1px; }
.ws-callcard .ws-cct.on { background:none; color:var(--accent); border-bottom-color:var(--accent); }
.ws-callcard .ws-cct:hover { background:none; color:var(--t1); }
.ws-callcard .ws-cct.on:hover { color:var(--accent); }

/* ---------- customer details + caller panel ---------- */
.ws-ci { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:16px; align-items:start; }
.ws-ci-main { display:flex; flex-direction:column; min-width:0; overflow:visible; }
.ws-ci-head { display:flex; align-items:center; gap:12px; padding:14px 18px; border-bottom:1px solid var(--border); flex-wrap:wrap; }
.ws-ci-head .panel-title { font-size:16px !important; }
.ws-ci-head #form-selector-wrap { margin-left:auto; align-items:center; gap:8px; }
.ws-ci-head #form-selector-wrap[style*="block"] { display:flex !important; }
.ws-ci-head #form-selector-wrap label { font-size:12px; color:var(--t2); margin:0; }
.ws-ci-head #form-selector { height:32px; padding:0 10px; border-radius:9px; border:1px solid var(--border2); background:var(--bg2); color:var(--t1); font:600 12.5px var(--font); max-width:240px; }
.ws-ci-strip { display:flex; align-items:center; gap:10px; margin:14px 18px 0; padding:10px 14px; border-radius:11px; background:var(--c-accent-soft,rgba(79,140,255,.12)); color:var(--c-text2,var(--t1)); font-size:13px; }
.ws-ci-strip.hidden { display:none; }
.ws-ci-strip b { color:var(--accent); }
.ws-ci-main > #clientinfo-subtitle { margin:12px 18px 0; font-size:12.5px; color:var(--t2); }
.ws-ci-main > #clientinfo-subtitle:empty { display:none; }
.ws-ci-body { padding:14px 18px 18px; }
.ws-ci-body #clientinfo-body { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 16px; }
.ws-ci-body #clientinfo-body > .empty-state, .ws-ci-body #clientinfo-body > iframe, .ws-ci-body #clientinfo-body > div:only-child { grid-column:1 / -1; }
.ws-ci-body .form-field-group { margin:0 !important; display:flex; flex-direction:column; gap:6px; min-width:0; }
.ws-ci-body .form-field-group.full-width { grid-column:1 / -1; }
.ws-ci-body .form-field-group > label { font-size:12.5px; font-weight:600; color:var(--t2); margin:0; }
.ws-ci-body .form-field-group input:not([type=radio]):not([type=checkbox]), .ws-ci-body .form-field-group select, .ws-ci-body .form-field-group textarea { width:100%; height:42px; padding:0 12px; border-radius:10px; border:1px solid var(--border2); background:var(--bg2); color:var(--t1); font:inherit; font-size:14px; box-sizing:border-box; }
.ws-ci-body .form-field-group textarea { height:auto; min-height:84px; padding:10px 12px; resize:vertical; }
.ws-ci-body .form-field-group input:focus, .ws-ci-body .form-field-group select:focus, .ws-ci-body .form-field-group textarea:focus { outline:0; border-color:var(--accent); box-shadow:0 0 0 3px var(--c-accent-soft,rgba(79,140,255,.15)); }
.ws-ci-body .radio-group, .ws-ci-body .checkbox-group { display:flex; flex-wrap:wrap; gap:8px 16px; padding-top:4px; }
.ws-ci-foot { position:sticky; bottom:-28px; display:flex; align-items:center; gap:8px; padding:12px 18px; margin:0 !important; border-top:1px solid var(--border); background:var(--bg1); border-radius:0 0 14px 14px; z-index:2; }
.ws-ci-foot .ws-ci-sp { flex:1; }
.ws-ci-foot .btn-primary, .ws-ci-foot .btn-secondary { width:auto !important; flex:none !important; height:38px; padding:0 16px !important; border-radius:10px; font-size:13px !important; }
.ws-ci-foot .btn-primary { padding:0 22px !important; }
.ws-ci-side { display:flex; flex-direction:column; gap:14px; position:sticky; top:0; }
.ws-ci-qa-btns { display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:12px 14px 14px; }
.ws-ci-qa-btns .ws-btn { justify-content:center; }
.ws-ci-qa-btns .ws-ci-wide { grid-column:1 / -1; }
.ws-ci-qa-btns .hidden { display:none; }

/* ---------- shared: search box, filter chips ---------- */
.ws-qbox { display:flex; align-items:center; gap:8px; height:38px; padding:0 12px; border-radius:10px; border:1px solid var(--border2); background:var(--bg2); color:var(--t2); cursor:text; min-width:0; }
.ws-qbox input { flex:1; min-width:0; border:0; outline:0; background:transparent; color:var(--t1); font:inherit; font-size:13px; height:100%; }
.ws-qbox:focus-within { border-color:var(--accent); }
.ws-chips { display:flex; flex-wrap:wrap; gap:6px; }
.ws-chips:empty { display:none; }
.ws-fchip { display:inline-flex; align-items:center; gap:6px; height:28px; padding:0 10px; border-radius:999px; border:1px solid var(--border2); background:transparent; color:var(--c-text2,var(--t1)); font:600 12px var(--font); cursor:pointer; white-space:nowrap; }
.ws-fchip:hover { border-color:var(--accent); }
.ws-fchip.on { border-color:var(--accent); color:var(--accent); background:var(--c-accent-soft,rgba(79,140,255,.13)); }
.ws-sd { width:8px; height:8px; border-radius:50%; background:var(--t3); flex:none; display:inline-block; }
.ws-sd.st-online { background:var(--green); } .ws-sd.st-in_call, .ws-sd.st-dnd { background:var(--red); } .ws-sd.st-break { background:var(--amber); }

/* ---------- dialer column: keypad toggle + team for 100 agents ---------- */
.ws-dialer { overflow:hidden; }
.ws-dialer #dialer-section { flex:none; }
.ws-kp-toggle { display:inline-flex; align-items:center; gap:6px; padding:0; margin:-2px 0 10px; }
.ws-dialer.ws-kp-hidden .keypad { display:none; }
.ws-dialer.ws-kp-hidden .call-btns { margin-top:0; }
.ws-team { flex:1; min-height:0; display:flex; flex-direction:column; gap:10px; padding:14px 0 0; }
.ws-team > .ws-lbl, .ws-team > .ws-qbox, .ws-team > .ws-chips { margin:0 16px; }
.ws-team .ws-lbl span { color:var(--t2); }
.ws-team .ws-fchip { height:26px; padding:0 9px; }
#ws-team-mini { flex:1; min-height:0; overflow-y:auto; padding-bottom:12px; }
.ws-tgroup { position:sticky; top:0; z-index:1; display:flex; justify-content:space-between; padding:7px 16px; background:var(--bg2); color:var(--t3); font:700 10.5px var(--font); letter-spacing:.07em; text-transform:uppercase; border-top:1px solid var(--border); border-bottom:1px solid var(--border); }
#ws-team-mini .ws-tm { padding:8px 16px; gap:10px; }
#ws-team-mini .ws-tm:hover { background:var(--bg2); }
#ws-team-mini .ws-mini { width:30px; height:30px; }
.ws-slim-counts { display:flex; flex-direction:column; gap:8px; align-items:center; }
.ws-scount { width:54px; padding:7px 0; border-radius:12px; border:0; background:var(--bg2); display:flex; flex-direction:column; align-items:center; cursor:pointer; color:var(--t3); }
.ws-scount b { font-size:16px; line-height:1.1; }
.ws-scount small { font-size:10px; color:var(--t2); }
.ws-scount.st-online b { color:var(--green); } .ws-scount.st-in_call b { color:var(--red); } .ws-scount.st-break b { color:var(--amber); }
.ws-scount:hover { outline:1px solid var(--accent); }

/* ---------- team page (table) ---------- */
.ws-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.ws-toolbar .ws-qbox { width:320px; max-width:100%; }
.ws-toolbar .ws-subtabs { align-self:center; }
.ws-tablewrap { overflow:auto; }
.ws-table { width:100%; border-collapse:collapse; font-size:13.5px; }
.ws-table th { text-align:left; padding:11px 16px; font:700 11px var(--font); letter-spacing:.06em; text-transform:uppercase; color:var(--t3); border-bottom:1px solid var(--border); position:sticky; top:0; background:var(--bg1); }
.ws-table td { padding:9px 16px; border-bottom:1px solid var(--border); vertical-align:middle; }
.ws-table tbody tr:last-child td { border-bottom:0; }
.ws-table tbody tr:hover td { background:var(--bg2); }
.ws-tcell { display:flex; align-items:center; gap:11px; }
.ws-tcell .ws-av { width:32px; height:32px; font-size:11.5px; }
.ws-t2 { color:var(--t2); }
.ws-st { text-transform:none; }
.ws-tact { text-align:right; white-space:nowrap; }
.ws-tact > * { display:inline-flex !important; vertical-align:middle; margin-left:6px; }
.ws-callbtn { height:32px; background:var(--c-ok-solid,var(--green)); border-color:transparent; color:#fff; }
.ws-callbtn:hover { border-color:transparent; filter:brightness(1.08); }
.ws-callbtn .wsi { width:14px; height:14px; }

/* ---------- transfer pop-up ---------- */
.ws-xfer .modal-box { width:640px !important; max-width:calc(100vw - 32px) !important; padding:0 !important; overflow:hidden; display:flex; flex-direction:column; max-height:calc(100vh - 60px); }
.ws-xf-head { display:flex; align-items:center; gap:10px; padding:16px 18px; border-bottom:1px solid var(--border); }
.ws-xf-head .modal-title { margin:0 !important; font-size:16px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ws-xf-head .ws-ico { margin-left:auto; }
.ws-xf-search { display:flex; align-items:center; gap:10px; margin:14px 18px 0; height:46px; padding:0 14px; border-radius:12px; border:2px solid var(--accent); background:var(--bg2); color:var(--t2); }
.ws-xf-search input { flex:1; min-width:0; border:0; outline:0; background:transparent; color:var(--t1); font:inherit; font-size:15px; height:100%; }
.ws-xf-tabs { display:flex; align-items:center; gap:6px; padding:12px 18px 10px; flex-wrap:wrap; }
.ws-xf-tabs [data-xt] { height:30px; padding:0 12px; border-radius:999px; border:1px solid var(--border2); background:transparent; color:var(--c-text2,var(--t1)); font:600 12.5px var(--font); cursor:pointer; }
.ws-xf-tabs [data-xt].on { border-color:var(--accent); color:var(--accent); background:var(--c-accent-soft,rgba(79,140,255,.13)); }
.ws-xf-tabs [data-xt] b { font-weight:600; }
.ws-switch { margin-left:auto; display:inline-flex; align-items:center; gap:8px; font-size:12.5px; color:var(--t2); cursor:pointer; user-select:none; }
.ws-switch input { position:absolute; opacity:0; width:1px; height:1px; }
.ws-switch i { width:34px; height:20px; border-radius:10px; background:var(--bg3); position:relative; transition:background .15s; }
.ws-switch i::after { content:""; position:absolute; top:3px; left:3px; width:14px; height:14px; border-radius:50%; background:#fff; transition:transform .15s; }
.ws-switch input:checked + i { background:var(--accent); }
.ws-switch input:checked + i::after { transform:translateX(14px); }
.ws-xfer .ws-xfer-list { margin:0; flex:1; min-height:120px; max-height:380px; overflow-y:auto; border-top:1px solid var(--border); border-bottom:1px solid var(--border); }
.ws-xfer .ws-xfer-opt { padding:9px 18px !important; border-radius:0; gap:12px; border-left:3px solid transparent !important; }
.ws-xfer .ws-xfer-opt.on { background:var(--c-accent-soft,rgba(79,140,255,.13)); border-left-color:var(--accent) !important; }
.ws-xfer .ws-xfer-opt .ws-chip { margin-left:auto; }
.ws-xfer mark { background:color-mix(in srgb, var(--amber) 35%, transparent); color:inherit; border-radius:3px; padding:0 1px; }
.ws-av-q { background:var(--bg3); color:var(--accent); } .ws-av-q::after { display:none; }
.ws-xf-target { display:none !important; }
.ws-xf-foot { display:flex; align-items:center; gap:12px; padding:12px 18px 0; flex-wrap:wrap; }
.ws-seg { display:inline-flex !important; flex-direction:row !important; gap:2px !important; padding:3px; border-radius:10px; background:var(--bg2); margin:0 !important; }
.ws-seg .transfer-type-opt { display:inline-flex !important; margin:0 !important; padding:0 !important; border:0 !important; background:none !important; cursor:pointer; }
.ws-seg .transfer-type-opt input { position:absolute; opacity:0; width:1px; height:1px; }
.ws-seg .transfer-type-label { display:block; padding:6px 14px; border-radius:8px; font:600 13px var(--font); color:var(--t2); }
.ws-seg .transfer-type-opt input:checked + .transfer-type-label { background:var(--bg1); color:var(--t1); box-shadow:0 1px 2px rgba(0,0,0,.25); }
.ws-seg .transfer-type-opt input:focus-visible + .transfer-type-label { outline:2px solid var(--accent); }
.ws-xf-desc { font-size:12.5px; color:var(--t2); }
.ws-xfer #transfer-status { margin:12px 18px 0; }
.ws-xfer #transfer-status.hidden { display:none; }
.ws-xfer .modal-btns { padding:14px 18px; margin:0 !important; display:flex; justify-content:flex-end; gap:8px; }
.ws-xfer .modal-btns > button { width:auto !important; flex:none !important; padding:0 18px !important; height:40px; }
.ws-xfer .modal-btns > button.hidden { display:none !important; }
.ws-xf-keys { display:flex; align-items:center; gap:6px; flex-wrap:wrap; padding:9px 18px; border-top:1px solid var(--border); font-size:11.5px; color:var(--t3); }
.ws-xf-keys .ws-k { margin-left:6px; } .ws-xf-keys .ws-k:first-child { margin-left:0; }

/* ---------- scripts page ---------- */
.ws-sc { display:grid; grid-template-columns:300px minmax(0,1fr); gap:16px; height:calc(100vh - 176px); min-height:420px; }
.ws-sc-list { display:flex; flex-direction:column; gap:10px; padding:14px 0 0; min-height:0; }
.ws-sc-list > .ws-qbox, .ws-sc-list > .ws-chips { margin:0 14px; }
.ws-sc-items { flex:1; min-height:0; overflow-y:auto; border-top:1px solid var(--border); }
.ws-sc-item { display:flex; align-items:center; gap:11px; width:100%; padding:11px 14px; border:0; border-bottom:1px solid var(--border); border-left:3px solid transparent; background:none; color:inherit; text-align:left; font:inherit; cursor:pointer; }
.ws-sc-item:hover { background:var(--bg2); }
.ws-sc-item.on { background:var(--c-accent-soft,rgba(79,140,255,.13)); border-left-color:var(--accent); }
.ws-sc-read { overflow-y:auto; min-height:0; --ws-sc-size:15px; }
.ws-sc-none { padding:28px; }
.ws-sc-h { display:flex; align-items:center; gap:12px; padding:14px 18px; border-bottom:1px solid var(--border); position:sticky; top:0; background:var(--bg1); z-index:1; }
.ws-sc-title { font-size:16px !important; }
.ws-sc-tools { margin-left:auto; display:flex; align-items:center; gap:8px; }
.ws-seg-sm { display:inline-flex; border-radius:9px; background:var(--bg2); padding:2px; }
.ws-seg-sm button { border:0; background:none; color:var(--t2); font:700 12px var(--font); padding:6px 9px; border-radius:7px; cursor:pointer; }
.ws-seg-sm button:hover { background:var(--bg1); color:var(--t1); }
.ws-sc-back { display:none !important; }
.ws-sc-steps { display:flex; flex-direction:column; gap:10px; padding:16px 18px 22px; }
.ws-step { display:flex; gap:12px; padding:14px 16px; border-radius:12px; border:1px solid var(--border); background:var(--bg2); }
.ws-step-n { width:24px; height:24px; border-radius:50%; flex:none; display:grid; place-items:center; font:700 12px var(--font); color:var(--accent); background:var(--c-accent-soft,rgba(79,140,255,.15)); margin-top:1px; }
.ws-step b { display:block; font-size:14px; }
.ws-step p { margin:5px 0 0; font-size:var(--ws-sc-size); line-height:1.6; color:var(--c-text2,var(--t1)); }
.ws-var { color:var(--c-heading,var(--t1)); font-weight:700; }
.ws-pr { min-height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:30px 28px; position:relative; }
.ws-pr .ws-sc-back { position:absolute; top:14px; left:14px; }
.ws-pr-meta { color:var(--t2); font-size:12.5px; }
.ws-pr-bar { display:flex; gap:5px; margin:12px 0 20px; }
.ws-pr-bar i { width:44px; height:5px; border-radius:3px; background:var(--bg3); }
.ws-pr-bar i.on { background:var(--accent); }
.ws-pr-t { font-size:24px; margin:0; letter-spacing:-.01em; color:var(--c-heading,var(--t1)); }
.ws-pr-b { max-width:640px; margin:14px 0 0; font-size:calc(var(--ws-sc-size) + 5px); line-height:1.6; color:var(--c-text2,var(--t1)); }
.ws-pr-btns { display:flex; gap:10px; margin-top:26px; }
.ws-pr-btns .ws-btn { height:44px; padding:0 20px; font-size:14px; }
.ws-pr-btns .ws-btn:disabled { opacity:.45; cursor:not-allowed; }
.ws-pr-keys { margin-top:14px; color:var(--t3); font-size:12px; }

/* ---------- laptop ---------- */
@media (max-width:1279px) {
  .ws-ci { grid-template-columns:minmax(0,1fr); }
  .ws-ci-side { position:static; display:grid; grid-template-columns:1fr 1fr; }
  .ws-sc { grid-template-columns:260px minmax(0,1fr); }
}
/* ---------- tablet ---------- */
@media (max-width:1023px) {
  .ws-callcard .ws-cc-ctrls { flex-basis:100%; justify-content:flex-start; border-top:1px solid var(--border); }
  .ws-xfer .modal-box { max-height:calc(100vh - 32px); }
  .ws-xf-keys { display:none; }
  .ws-sc { height:calc(100vh - 160px); }
}
/* ---------- phone ---------- */
@media (max-width:719px) {
  .ws-callcard { border-radius:14px; }
  .ws-callcard .ws-cc-head { flex:1 1 100%; flex-wrap:nowrap; padding:12px; }
  .ws-callcard .ws-cc-meta .call-state { display:none; }
  .ws-callcard .ws-cc-timer { margin-left:auto; border-left:0; padding-left:0; text-align:right; }
  .ws-callcard .call-timer { font-size:22px; }
  /* call controls sit at the bottom of the screen, like a phone call */
  .ws-incall .ws-tabbar { display:none; }
  .ws-callcard .ws-cc-ctrls { position:fixed; left:0; right:0; bottom:0; z-index:62; display:grid; grid-template-columns:repeat(5,1fr); gap:6px; padding:10px 10px calc(12px + env(safe-area-inset-bottom)); background:var(--bg1); border-top:1px solid var(--border); }
  .ws-callcard .ws-ctl { height:62px !important; flex-direction:column; justify-content:center; padding:0 2px !important; gap:4px; font-size:11.5px !important; border-radius:14px !important; }
  .ws-callcard .ws-ctl.ws-end { grid-column:auto; margin-left:0; height:62px !important; flex-direction:column; font-size:11.5px !important; padding:0 2px !important; }
  .ws-callcard #ws-keypad-btn, .ws-callcard #ws-sms-btn, .ws-callcard #ws-cb-btn { display:none !important; }
  .ws-callcard .ws-cc-more { display:inline-flex !important; }
  .ws-callcard .ws-cc-tabs { padding:0 4px; overflow-x:auto; }
  .ws-callcard .ws-cct { flex:1; justify-content:center; }
  .ws-incall .ws-main { padding-bottom:110px; }
  .ws-ci-head { padding:12px 14px; }
  .ws-ci-head #form-selector-wrap { margin-left:0; width:100%; } .ws-ci-head #form-selector { max-width:none; flex:1; }
  .ws-ci-strip { margin:12px 14px 0; }
  .ws-ci-body { padding:12px 14px 14px; }
  .ws-ci-body #clientinfo-body { grid-template-columns:minmax(0,1fr); }
  .ws-ci-foot { bottom:-100px; padding:10px 14px; flex-wrap:wrap; }
  .ws-ci-foot .btn-primary { flex:1 0 100% !important; order:-1; height:46px; }
  .ws-ci-foot .ws-ci-sp { display:none; }
  .ws-ci-foot .btn-secondary { flex:1 !important; }
  .ws-ci-side { grid-template-columns:minmax(0,1fr); }
  .ws-toolbar .ws-qbox { width:100%; }
  .ws-table thead { display:none; }
  .ws-table tr { display:flex; align-items:center; gap:8px; padding:9px 12px; border-bottom:1px solid var(--border); }
  .ws-table td { padding:0; border:0; }
  .ws-table td:nth-child(1) { flex:1; min-width:0; }
  .ws-table td:nth-child(2), .ws-table td:nth-child(4) { display:none; }
  .ws-table td:nth-child(3) .ws-chip { font-size:11px; }
  .ws-callbtn span { display:none; } .ws-callbtn { width:34px; padding:0; justify-content:center; }
  .ws-tcell b { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  /* transfer: full screen */
  .ws-xfer { padding:0 !important; align-items:stretch !important; }
  .ws-xfer .modal-box { width:100vw !important; max-width:none !important; height:100%; max-height:none !important; border-radius:0 !important; }
  .ws-xfer .ws-xfer-list { max-height:none; }
  .ws-xf-desc { flex:1 0 100%; }
  .ws-xfer .modal-btns > button { flex:1 !important; height:48px; }
  .ws-switch span { display:none; }
  /* scripts: list, then the script */
  .ws-sc { grid-template-columns:minmax(0,1fr); height:calc(100vh - 230px); }
  .ws-sc .ws-sc-read { display:none; }
  .ws-sc.ws-sc-open .ws-sc-list { display:none; }
  .ws-sc.ws-sc-open .ws-sc-read { display:block; }
  .ws-sc-back { display:grid !important; }
  .ws-sc-tools .ws-seg-sm { display:none; }
  .ws-pr { padding:56px 16px 24px; justify-content:flex-start; }
  .ws-pr-bar i { width:auto; flex:1; } .ws-pr-bar { width:100%; }
  .ws-pr-t { font-size:20px; } .ws-pr-btns { width:100%; } .ws-pr-btns .ws-btn { flex:1; justify-content:center; }
  #ws-call-sheet.ws-sheet { z-index:86; }
}
.ws-ci-strip:not(.hidden) + #clientinfo-subtitle { display:none; }
#ws-ci-count { text-transform:none; }
.ws-ci-qa-btns { grid-template-columns:repeat(auto-fit,minmax(110px,1fr)); }
.ws-step p b, .ws-pr-b b, .ws-var { display:inline !important; font-size:inherit; }
.ws-team .ws-chips { gap:5px; flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; }
.ws-team .ws-fchip { height:25px; padding:0 8px; gap:5px; font-size:11.5px; flex:none; }
@media (max-width:719px) {
  .ws-ci-foot { bottom:66px; }
  .ws-incall .ws-ci-foot { bottom:94px; }
}
@media (max-width:719px) {
  .ws-ci-foot, .ws-incall .ws-ci-foot { position:static; border-radius:0 0 14px 14px; }
}

/* v262: long names never push things out of their box */
.ws-fchip { max-width:100%; }
.ws-fchip-t { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.disposition-list { grid-template-columns:repeat(2, minmax(0,1fr)) !important; }
.disp-item { min-width:0; }
.disp-name { white-space:normal !important; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; min-width:0; }
.fx-pb-info { min-width:0; }
.ws-sc-item .ws-row-t, .ws-sc-h .ws-row-t { min-width:0; }
.ws-sc-item .ws-row-t b { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
@media (max-width:719px) { .disposition-list { grid-template-columns:minmax(0,1fr) !important; } }
/* callback cards: 2 columns on wide screens, 1 on phones (the old phone rule was overridden) */
.cb-list { grid-template-columns:repeat(2, minmax(0,1fr)); }
.cb-item { min-width:0; }
@media (max-width:719px) { .cb-list { grid-template-columns:minmax(0,1fr) !important; } }

/* ===== v263: chat files & images ===== */
.ws-chat-attach { flex:none; width:42px; height:42px; }
.ws-chat-attach.hidden { display:none; }
.ws-chat-pending { display:flex; align-items:center; gap:10px; margin:0 12px; padding:9px 10px; border:1px solid var(--border); border-bottom:0; border-radius:12px 12px 0 0; background:var(--bg2); position:relative; }
.ws-chat-pending.hidden { display:none; }
.ws-file-ic { flex:none; width:40px; height:40px; border-radius:10px; display:grid; place-items:center; background:var(--c-accent-soft,rgba(79,140,255,.15)); color:var(--accent); font:800 10.5px var(--font); letter-spacing:.02em; }
.ws-file-t { flex:1; min-width:0; display:flex; flex-direction:column; }
.ws-file-t b { font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ws-file-t small { font-size:11.5px; color:var(--t2); }
.ws-up-bar { position:absolute; left:10px; right:10px; bottom:0; height:3px; border-radius:2px; overflow:hidden; }
.ws-up-bar i { display:block; height:100%; width:0; background:var(--accent); transition:width .15s; }
.ws-msg.ws-has-file { max-width:min(360px, 86%); }
.ws-msg-img { display:block; padding:0; border:0; border-radius:12px; overflow:hidden; cursor:zoom-in; background:var(--bg2); max-width:100%; }
.ws-msg-img img { display:block; max-width:100%; max-height:260px; object-fit:cover; }
.ws-img-ph { display:block; padding:28px 34px; font-size:12px; color:var(--t2); }
.ws-msg-file { display:flex; align-items:center; gap:10px; padding:8px; border-radius:12px; background:var(--bg2); border:1px solid var(--border); min-width:220px; max-width:100%; }
.ws-msg.mine .ws-msg-file { background:var(--bg1); }
.ws-msg-file.ws-gone { min-width:0; color:var(--t2); font-size:12.5px; }
.ws-has-file .ws-msg-b { margin-top:6px; }
.ws-chat-thread.ws-drop { outline:2px dashed var(--accent); outline-offset:-6px; }
.ws-lightbox { position:fixed; inset:0; z-index:200; background:rgba(0,0,0,.86); display:flex; flex-direction:column; align-items:center; justify-content:center; padding:56px 16px 16px; }
.ws-lightbox.hidden { display:none; }
.ws-lb-bar { position:absolute; top:0; left:0; right:0; display:flex; align-items:center; gap:10px; padding:10px 14px; color:#fff; }
.ws-lb-bar span { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600; }
.ws-lb-bar .ws-ico { color:#fff; }
#ws-lb-img { max-width:100%; max-height:100%; object-fit:contain; border-radius:8px; }

/* ===== v263: screen height = the part of the screen you can really see
   (phones: "100vh" includes the area under the browser address bar) ===== */
@supports (height: 100dvh) {
  .ws-chat { height:calc(100dvh - 170px); }
  .ws-sc { height:calc(100dvh - 176px); }
  .ws-xfer .modal-box { max-height:calc(100dvh - 60px); }
  @media (max-width:1023px) { .ws-sc { height:calc(100dvh - 160px); } .ws-xfer .modal-box { max-height:calc(100dvh - 32px); } }
  @media (max-width:719px) {
    .ws-chat { height:calc(100dvh - 210px); }
    .ws-sc { height:calc(100dvh - 230px); }
    .modal .modal-box { max-height:86dvh; }
  }
}
/* phones: an open conversation fills the screen (like WhatsApp) — no bottom
   menu or keypad button over the message box */
@media (max-width:719px) {
  .ws-app.ws-chat-open .ws-tabbar, .ws-app.ws-chat-open .ws-fab { display:none !important; }
  .ws-chat.ws-thread-open { position:fixed; left:0; right:0; top:56px; bottom:0; height:auto !important; z-index:58; border-radius:0; border-left:0; border-right:0; border-bottom:0; }
  .ws-chat.ws-thread-open .ws-chat-compose { padding:8px 8px calc(8px + env(safe-area-inset-bottom)); gap:6px; }
  .ws-chat-compose textarea { font-size:16px; min-width:0; }   /* 16px: stops phones zooming in on tap */
  .ws-chat-compose .ws-btn span { display:none; }
  .ws-chat-compose .ws-btn { width:46px; padding:0; justify-content:center; }
  .ws-chat-pending { margin:0 8px; }
  .ws-msg.ws-has-file { max-width:86%; }
  .ws-msg-file { min-width:0; }
}
@media (max-width:719px) { .ws-top { position:sticky; top:0; z-index:50; } }

/* ===================================================================
   v283 UI polish — consistency pass (empty states, pending, disposition,
   avatar status, My Day, team filter, login label, buttons).
   =================================================================== */

/* Empty states: line icons in the app's own style (follow the theme colour). */
.empty-icon[class*="ei-"] { width:44px; height:44px; margin:0 auto 12px; font-size:0; line-height:0; border-radius:14px;
  background:var(--c-accent-soft,rgba(79,140,255,.13)); position:relative; }
.empty-icon[class*="ei-"]::before { content:""; position:absolute; inset:11px; background:var(--accent);
  -webkit-mask:var(--ei) center/contain no-repeat; mask:var(--ei) center/contain no-repeat; }
.ei-phone { --ei:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.5 2.1L8 9.9a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.8.7a2 2 0 0 1 1.7 2z'/%3E%3C/svg%3E"); }
.ei-list { --ei:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01'/%3E%3C/svg%3E"); }
.ei-doc { --ei:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6M16 13H8M16 17H8M10 9H8'/%3E%3C/svg%3E"); }
.ei-cal { --ei:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E"); }
.ei-book { --ei:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
.empty-state > div:not(.empty-icon):not(.empty-sub) { color:var(--t1); font-weight:600; font-size:14px; }
.empty-state .empty-sub { color:var(--t2); font-size:12.5px; margin-top:4px; }

/* Pending outcomes: proper rows with direction, readable time and a clear action. */
.ws-main .pending-disp-list { gap:0; padding:0; }
.pending-disp-list .pending-disp { display:flex; align-items:center; gap:12px; padding:12px 16px; border:0; border-bottom:1px solid var(--border);
  border-radius:0; background:transparent; box-shadow:none !important; }
.pending-disp-list .pending-disp:last-child { border-bottom:0; }
.pending-disp-list .pending-disp:hover, .pending-disp-list .pending-disp:focus-visible { background:var(--bg2); outline:none; }
.pending-disp-list .pending-disp:focus-visible { box-shadow:inset 3px 0 0 var(--accent) !important; }
.pd-dir { width:32px; height:32px; border-radius:9px; display:grid; place-items:center; flex:none; font-size:15px; font-weight:700; }
.pd-in { color:var(--green); background:var(--c-ok-soft,rgba(46,204,113,.13)); }
.pd-out { color:var(--accent); background:var(--c-accent-soft,rgba(79,140,255,.13)); }
.pd-miss { color:var(--red); background:var(--c-bad-soft,rgba(255,90,95,.12)); }
.pd-main { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.pending-disp .disp-name { font-weight:600; font-size:14px; color:var(--t1); font-variant-numeric:tabular-nums; }
.pending-disp .disp-meta { font-size:12px; color:var(--t2); margin:0; }
.pd-cta { flex:none; height:30px; padding:0 12px; border-radius:8px; display:inline-flex; align-items:center; font:600 12.5px var(--font);
  color:var(--amber); background:var(--c-warn-soft,rgba(245,158,11,.13)); border:1px solid transparent; }
.pending-disp:hover .pd-cta { border-color:var(--amber); }

/* Disposition: picking an outcome is the main action; "Skip for now" is quiet. */
#disposition-modal .disp-btns { justify-content:flex-end; }
#disposition-modal .disp-btns #disp-skip-btn { flex:none; width:auto; padding:0 18px; height:38px; }
#disposition-modal .modal-title { font-size:17px; margin-bottom:4px; }
#disposition-modal .form-modal-subtitle { margin-bottom:14px; }

/* Header buttons in page titles share one style. */
.panel-title .ws-head-btn { margin-left:auto; height:34px; }

/* Avatar: initials + a small "phone connected" dot (the text label is hidden on smaller screens). */
.agent-avatar { position:relative; }
.agent-avatar.has-initials { font-family:var(--font); letter-spacing:.02em; }
.agent-avatar[data-reg]::after { content:""; position:absolute; right:-1px; bottom:-1px; width:11px; height:11px; border-radius:50%;
  border:2px solid var(--bg1,#11151d); background:var(--t3); }
.agent-avatar[data-reg="ok"]::after { background:var(--green); }
.agent-avatar[data-reg="off"]::after { background:var(--red); }
.agent-avatar[data-reg="break"]::after { background:var(--amber); }

/* Team filter chips: label + number. */
.ws-fchip { gap:5px; padding:0 9px; }
.ws-fchip-n { font-weight:700; font-variant-numeric:tabular-nums; }
.ws-fchip-l { font-weight:500; color:var(--t2); }
.ws-fchip.on .ws-fchip-l { color:inherit; }

/* My Day: same type and card style as the rest of the app. */
.ws-main #view-summary .summary-card { border-left-width:1px; border-left-color:var(--border); background:var(--bg1); border-radius:14px; padding:16px; }
.ws-main #view-summary .summary-card:hover { transform:none; border-color:var(--border2); }
.ws-main #view-summary .summary-card .sc-label { font-size:12px; text-transform:none; letter-spacing:0; color:var(--t2); font-weight:500; }
.ws-main #view-summary .summary-card .sc-value { font-family:var(--font); font-size:22px; font-weight:700; letter-spacing:-.01em; font-variant-numeric:tabular-nums; }
.ws-main #view-summary .summary-card .sc-bar { display:none; }
.ws-main #view-summary .rank-pos { font-family:var(--font); }
.ws-main #view-summary .rank-item { padding:7px 10px; border-radius:8px; font-size:13px; }

/* Login: the company name is a label, not a button. */
#login-screen .tenant-badge { background:none; border:0; padding:0; text-align:left; color:var(--t2); font-size:13px; font-weight:600;
  display:flex; align-items:center; gap:8px; margin:-6px 0 20px; }
#login-screen .tenant-badge::before { content:""; width:16px; height:16px; flex:none; background:var(--accent);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18M5 21V7l8-4v18M19 21V11l-6-4M9 9v.01M9 12v.01M9 15v.01M9 18v.01'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18M5 21V7l8-4v18M19 21V11l-6-4M9 9v.01M9 12v.01M9 15v.01M9 18v.01'/%3E%3C/svg%3E") center/contain no-repeat; }
#login-screen .tenant-badge:empty { display:none; }

/* History: status label only for calls that need attention. */
.ws-main .log-item .log-status.log-st-missed, .ws-main .log-item .log-status.log-st-rejected,
.ws-main .log-item .log-status.log-st-failed, .ws-main .log-item .log-status.log-st-busy { color:var(--red); background:var(--c-bad-soft,rgba(255,90,95,.12)); border-color:transparent; }

/* Team filter in the side panel: chips wrap onto a second line instead of being cut off. */
.ws-team .ws-chips { flex-wrap:wrap; overflow:visible; }
.ws-team .ws-fchip { height:26px; padding:0 8px; font-size:11.5px; }
/* One typeface everywhere (numbers stay aligned with tabular figures). */
.ws-top .agent-ext { font-family:var(--font); font-variant-numeric:tabular-nums; }
.ws-main #view-summary .rank-calls { font-family:var(--font); font-variant-numeric:tabular-nums; }
#login-screen .brand-sub { font-family:var(--font); text-transform:none; letter-spacing:0; font-size:12px; }

/* Call History: talk time next to the date. */
.log-meta .log-dur { display:inline-flex; align-items:center; gap:4px; color:var(--t2); font-size:12px; font-weight:600; font-variant-numeric:tabular-nums; }
.log-meta .log-dur svg { width:13px; height:13px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; opacity:.8; }
.log-meta .log-dur-zero { color:var(--t3); font-weight:500; }
.log-meta .log-dur-na { color:var(--t3); font-weight:500; }
.log-meta .log-when + .log-dur::before { content:"·"; margin-right:4px; color:var(--t3); font-weight:400; }

/* ===== Customer Data (caller's records from the company's own systems) ===== */
/* The incoming-call card is always dark, whatever the theme — light text. */
.ws-in-cust { margin-top:8px; font-size:14px; color:rgba(255,255,255,.78); text-align:center; }
.ws-in-cust b { color:#fff; font-weight:700; }
.ws-cust .ws-card-h { margin-bottom:0; }
#ws-cust-list { padding:12px 16px 14px; }
.ws-cust-name { font-size:15px; font-weight:700; color:var(--t1); margin:0 0 8px; }
.ws-cust-rec { display:block; width:100%; text-align:left; font:inherit; color:inherit; cursor:pointer; padding:9px 10px; margin:0 0 6px;
  border:1px solid var(--border); border-radius:10px; background:var(--bg2); }
.ws-cust-rec:hover, .ws-cust-rec:focus-visible { border-color:var(--accent); outline:none; }
.ws-cust-top { display:flex; align-items:baseline; gap:8px; }
.ws-cust-top b { font-size:13px; color:var(--t1); min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; }
.ws-cust-top small { font-size:11.5px; color:var(--t3); white-space:nowrap; }
.ws-cust-f { display:flex; flex-wrap:wrap; gap:2px 10px; margin-top:4px; font-size:12px; color:var(--t1); }
.ws-cust-f i { font-style:normal; color:var(--t3); }
.ws-cust-src { display:block; margin-top:3px; font-size:11px; color:var(--t3); }
#ws-cust-modal .modal-box.ws-cust-box { max-width:620px; width:100%; padding:0; display:flex; flex-direction:column;
  max-height:calc(100vh - 32px); max-height:calc(100dvh - 32px); overflow:hidden; }
.ws-cust-body { flex:1 1 auto; min-height:0; overflow-y:auto; padding:14px 22px; }
.ws-cust-sub { font-size:12.5px; color:var(--t2); margin-bottom:12px; }
.ws-cust-kv { display:grid; grid-template-columns:minmax(110px, 36%) 1fr; gap:7px 14px; align-items:center; }
.ws-cust-kv .k { font-size:12px; color:var(--t3); word-break:break-all; }
.ws-cust-kv .v { font-size:13.5px; color:var(--t1); word-break:break-word; }
.ws-cust-kv input { width:100%; min-width:0; height:34px; padding:0 10px; border-radius:8px; border:1px solid var(--border); background:var(--bg1); color:var(--t1); font:inherit; font-size:13.5px; }
.ws-cust-kv input:focus { outline:none; border-color:var(--accent); }
.ws-cust-err { margin-top:10px; font-size:12.5px; color:var(--red); }
#ws-cust-foot .btn-primary, #ws-cust-foot .btn-secondary { width:auto; flex:none; padding:0 16px; height:36px; }
.ws-cust-del { color:var(--red) !important; }
@media (max-width:600px) { .ws-cust-kv { grid-template-columns:1fr; gap:2px; } .ws-cust-kv .k { margin-top:8px; } }

/* ---------- Customer details: form linked to a data source ---------- */
.ws-ci-body #clientinfo-body > .dsf-bar { grid-column:1 / -1; }
.dsf-bar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:12px 14px; border-radius:12px; border:1px solid var(--border2);
           background:var(--c-accent-soft,rgba(79,140,255,.08)); }
.dsf-bar.warn { background:color-mix(in srgb, var(--amber,#f59e0b) 10%, transparent); border-color:color-mix(in srgb, var(--amber,#f59e0b) 35%, transparent); }
.dsf-src { width:32px; height:32px; flex:none; display:grid; place-items:center; border-radius:9px; background:var(--accent); color:#fff; }
.dsf-src svg { width:15px; height:15px; }
.dsf-bar.warn .dsf-src { background:var(--amber,#f59e0b); }
.dsf-bar.loading .dsf-src { animation:dsfPulse 1.1s ease-in-out infinite; }
@keyframes dsfPulse { 50% { opacity:.45; } }
.dsf-bar-t { display:flex; flex-direction:column; min-width:0; flex:1 1 160px; }
.dsf-bar-t b { font-size:13.5px; color:var(--t1); }
.dsf-bar-t small { font-size:12px; color:var(--t3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dsf-rec { flex:1 1 260px; max-width:420px; height:38px; padding:0 12px; border-radius:10px; border:1px solid var(--border2); background:var(--bg1,var(--bg2)); color:var(--t1); font:inherit; font-size:13.5px; }
.dsf-rec:focus { outline:0; border-color:var(--accent); box-shadow:0 0 0 3px var(--c-accent-soft,rgba(79,140,255,.15)); }
.dsf-note { flex-basis:100%; font-size:12px; color:var(--t2); padding-left:44px; min-height:0; }
.dsf-note:empty { display:none; }
.dsf-note b { color:var(--accent); }
.dsf-retry { height:32px; padding:0 12px; border-radius:9px; border:1px solid var(--border2); background:var(--bg2); color:var(--t1); font:inherit; font-size:12.5px; font-weight:600; cursor:pointer; }
.dsf-tag { display:inline-grid; place-items:center; width:18px; height:18px; margin-right:6px; vertical-align:-3px; border-radius:5px; color:var(--accent); background:var(--c-accent-soft,rgba(79,140,255,.13)); }
.dsf-tag.ro { color:var(--t3); background:var(--bg3); }
.ws-ci-body .dsf-group.is-ro input:not([type=radio]):not([type=checkbox]), .ws-ci-body .dsf-group.is-ro select, .ws-ci-body .dsf-group.is-ro textarea {
  background:var(--bg3); border-style:dashed; color:var(--t2); cursor:default; box-shadow:none; opacity:1; }
.ws-ci-body .dsf-group.is-ro input:focus { border-color:var(--border2); box-shadow:none; }
.ws-ci-body .dsf-group.is-changed input:not([type=radio]):not([type=checkbox]), .ws-ci-body .dsf-group.is-changed select, .ws-ci-body .dsf-group.is-changed textarea {
  border-color:var(--amber,#f59e0b); box-shadow:0 0 0 3px color-mix(in srgb, var(--amber,#f59e0b) 14%, transparent); }
.ws-ci-body .dsf-group.is-changed > label::after { content:"changed"; margin-left:8px; font-size:10.5px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--amber,#f59e0b); }
@media (max-width:640px) { .dsf-note { padding-left:0; } .dsf-rec { max-width:none; } }
