/* Dispatch Core console — "Modern Tech" design (Claude Design handoff 06-11).
   Palettes are a 1:1 port of the prototype's light/dark v-maps; accents switch
   with the company filter via [data-accent]. Reference:
   design/dispatcher-console/project/Dispatcher Console - Modern Tech.dc.html */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; -webkit-font-smoothing: antialiased; }
/* kill iOS double-tap-to-zoom on controls (keypad digits etc.) without
   disabling pinch-zoom; also removes the 300ms tap delay. */
button { touch-action: manipulation; }
/* Kill iOS double-tap-to-zoom across the app (keeps pan + pinch-zoom). Reported
   on the mobile console: a double-tap zoomed the page. */
html, body { touch-action: manipulation; }

:root, [data-theme="light"] {
  --pg: #F5F5FA;
  --pgc: radial-gradient(1200px 500px at 80% -10%, rgba(124,108,246,.06) 0%, rgba(124,108,246,0) 60%), #F5F5FA;
  --top: rgba(255,255,255,.85);
  --tx: #1A1826; --tx2: #3C3852; --tx3: #27243A; --sub: #8B86A0; --fnt: #A8A3BB;
  --cd: #FFFFFF; --cbd: #E7E5F0;
  --csh: 0 1px 3px rgba(26,24,38,.04), 0 12px 32px rgba(26,24,38,.05);
  --rbd: #F3F2F8; --hbd: #F0EEF6; --hd: #FAFAFD;
  --in: #FAFAFD; --inbd: #E3E1EE;
  --seg: #EEEDF5; --dv: #E7E5F0; --epbd: #DCD9E8;
  --icbg: linear-gradient(135deg,#EEEDF8,#E4E2F2); --icfg: #8B86A0;
  --track: #EEEDF5;
  --aibg: linear-gradient(135deg,rgba(99,102,241,.06),rgba(139,92,246,.08));
  --aibd: #E2DEF9; --ailb: #6D5DE7;
  --holdbg: #FFF8E8; --holdbd: #F2E2B8; --holdtx: #7E5D0F;
  --ckbd: #C8C4D8; --declhov: #FDF3F4;
  --wait-warn: #9A6206; --wait-crit: #B92328;
  --seg-on-bg: #FFFFFF; --seg-off-fg: #6A6580;
  --seg-on-sh: 0 1px 3px rgba(26,24,38,.12);
  --scroll: #A9A4BE;
}
[data-theme="dark"] {
  --pg: #121019;
  --pgc: radial-gradient(1200px 500px at 80% -10%, rgba(124,108,246,.10) 0%, rgba(124,108,246,0) 60%), #121019;
  --top: rgba(21,18,31,.85);
  --tx: #ECEAF5; --tx2: #C9C5DC; --tx3: #D6D2E6; --sub: #8F89A6; --fnt: #6F6987;
  --cd: #1C1928; --cbd: #2C2840;
  --csh: 0 1px 3px rgba(0,0,0,.25), 0 12px 32px rgba(0,0,0,.3);
  --rbd: #262236; --hbd: #262236; --hd: #211D31;
  --in: #16131F; --inbd: #332E4A;
  --seg: #262236; --dv: #2C2840; --epbd: #332E4A;
  --icbg: linear-gradient(135deg,#2A2640,#211D31); --icfg: #8F89A6;
  --track: #2C2840;
  --aibg: linear-gradient(135deg,rgba(99,102,241,.14),rgba(139,92,246,.16));
  --aibd: #3B3563; --ailb: #A99CF9;
  --holdbg: rgba(245,158,11,.10); --holdbd: rgba(245,158,11,.32); --holdtx: #F5B14D;
  --ckbd: #46405F; --declhov: rgba(244,93,98,.12);
  --wait-warn: #F5B14D; --wait-crit: #FF8A8E;
  --seg-on-bg: #393353; --seg-off-fg: #8F89A6;
  --seg-on-sh: 0 1px 3px rgba(0,0,0,.3);
  --scroll: #46405F;
}

/* company accent (switched by the tenant filter) */
[data-accent="all"]  { --acc: #6D5DE7; --acc-grad: linear-gradient(135deg,#6366F1,#8B5CF6); --acc-glow: rgba(109,93,231,.35); }
[data-accent="axis"] { --acc: #2563EB; --acc-grad: linear-gradient(135deg,#2563EB,#38BDF8); --acc-glow: rgba(37,99,235,.35); }
[data-accent="afix"] { --acc: #0A9B6C; --acc-grad: linear-gradient(135deg,#0A9B6C,#34D399); --acc-glow: rgba(10,155,108,.35); }
/* OC accent was MISSING (OC-P5 gap): with Axis OC selected --acc resolved to
   nothing, so every accent-painted element (slider thumb, Claim fill, toggles)
   went invisible — Олег 07-03. Amber to match the OC tenant badge. */
[data-accent="oc"]   { --acc: #D97706; --acc-grad: linear-gradient(135deg,#F59E0B,#FBBF24); --acc-glow: rgba(245,158,11,.35); }
[data-theme="dark"][data-accent="all"]  { --acc: #A99CF9; }
[data-theme="dark"][data-accent="axis"] { --acc: #7CB7FF; }
[data-theme="dark"][data-accent="afix"] { --acc: #5FD9A8; }
[data-theme="dark"][data-accent="oc"]   { --acc: #F5B14D; }

@font-face {
  font-family: 'Space Grotesk';
  src: url('/app/fonts/SpaceGrotesk-Var.woff2') format('woff2');
  font-weight: 300 700; font-display: swap; /* variable font, one file */
}

body {
  font-family: 'Segoe UI', -apple-system, 'Helvetica Neue', sans-serif;
  color: var(--tx); background: var(--pg);
}
.grotesk { font-family: 'Space Grotesk', 'Segoe UI', sans-serif; }
.mono { font-family: 'Space Grotesk', Consolas, monospace; font-variant-numeric: tabular-nums; }

@keyframes dcPulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.4); opacity: .5; } }
@keyframes dcRing  { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,.4); } 100% { box-shadow: 0 0 0 14px rgba(16,185,129,0); } }
@keyframes dcBlink { 0%,80%,100% { opacity: .2; } 40% { opacity: 1; } }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
textarea:focus, input:focus { outline: 2px solid #C7C2F7; outline-offset: -1px; }
button { font-family: inherit; }

/* ---------- layout ---------- */
/* No min-width floor: the window may shrink freely; the icon-rail (≤1024px) and
   phone (≤820px) tiers below adapt the layout. Dispatchers run the console as a
   compact "звонилка" beside other apps, so it must reflow down to ~380px. */
.wrap { display: flex; width: 100vw; height: 100vh; overflow: hidden; }

.sidebar {
  width: 232px; min-width: 232px; display: flex; flex-direction: column;
  padding: 16px 12px 14px; color: #9A93B0; position: relative; overflow: hidden;
  background: linear-gradient(180deg,#15121F 0%,#100E18 100%);
}
.sidebar .glow {
  position: absolute; top: -80px; left: -40px; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,.22) 0%, rgba(99,102,241,0) 70%); pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; position: relative; }
.brand .logo {
  width: 32px; height: 32px; border-radius: 10px;
  box-shadow: 0 4px 14px var(--acc-glow); display: block;
}
.brand .t1 { color: #fff; font-size: 14px; font-weight: 650; line-height: 1.1; }
.brand .t2 { color: #665F7E; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  cursor: pointer; font-size: 13.5px; font-weight: 500; color: #9A93B0; margin-bottom: 3px; position: relative;
}
.nav-item:hover { color: #C9C3DC; }
.nav-item.on { color: #fff; background: rgba(255,255,255,.09); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.nav-item .grow { flex: 1; }
.nav-badge {
  min-width: 20px; height: 18px; border-radius: 9px; background: var(--acc-grad); color: #fff;
  font-size: 11px; font-weight: 650; display: grid; place-items: center; padding: 0 6px;
}
.nav-badge.dim { background: rgba(255,255,255,.13); }
.nav-dot { width: 8px; height: 8px; border-radius: 50%; background: #34D399; box-shadow: 0 0 10px rgba(52,211,153,.9); }

.presence-wrap { position: relative; border-top: 1px solid rgba(255,255,255,.08); padding-top: 10px; }
.presence-menu {
  position: absolute; bottom: 62px; left: 0; right: 0; background: #1E1B2C; border: 1px solid #322E45;
  border-radius: 12px; padding: 6px; box-shadow: 0 12px 36px rgba(0,0,0,.55); z-index: 40;
}
.presence-menu .hdr { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #665F7E; padding: 6px 10px 4px; }
.presence-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; color: #E9E6F2; }
.presence-opt:hover { background: #2A2640; }
.presence-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.presence-row:hover { background: rgba(255,255,255,.06); }
.avatar-sm {
  width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg,#3E3956,#2A2640);
  color: #fff; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; position: relative;
}
.pres-dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #15121F; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 54px; min-height: 54px; background: var(--top); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--cbd); display: flex; align-items: center; gap: 14px;
  padding: 0 24px; position: relative; z-index: 30;
}
.topbar .title { font-size: 15px; font-weight: 650; color: var(--tx); }
.seg { display: flex; background: var(--seg); border-radius: 10px; padding: 2px; gap: 2px; }
.seg button {
  border: none; cursor: pointer; font-size: 12.5px; font-weight: 600; padding: 5px 13px;
  border-radius: 8px; background: transparent; color: var(--seg-off-fg);
}
.seg button.on { background: var(--seg-on-bg); color: var(--acc); box-shadow: var(--seg-on-sh); }
.tb-label { font-size: 11px; color: var(--sub); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.tb-div { width: 1px; height: 24px; background: var(--dv); }
.icon-btn {
  width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--inbd); background: var(--cd);
  color: var(--sub); cursor: pointer; display: grid; place-items: center;
}
.icon-btn:hover { background: var(--hd); }
.icon-btn.acc { color: var(--acc); }
/* 06-15: topbar handset while on a call — filled accent so it clearly reads as active */
.icon-btn.oncall { background: var(--acc); color: #fff; box-shadow: 0 0 0 3px var(--acc-glow); }
.icon-btn.oncall:hover { background: var(--acc); filter: brightness(1.08); }
.icon-btn.sun { color: #F5B14D; }
/* ring-volume slider in the topbar */
.ring-vol { width: 70px; height: 4px; margin: 0 2px; cursor: pointer; accent-color: var(--acc);
  -webkit-appearance: none; appearance: none; background: var(--dv); border-radius: 3px; }
.ring-vol::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 12px;
  border-radius: 50%; background: var(--acc); cursor: pointer; border: none; }
.ring-vol::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--acc); border: none; cursor: pointer; }
.conn { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--sub); font-weight: 600; }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; }
/* mobile account/status button (sidebar presence is hidden on phones) */
.tb-acct { display: none; background: none; border: none; cursor: pointer; padding: 0; }
.acct-av { position: relative; display: grid; place-items: center; width: 31px; height: 31px;
  border-radius: 50%; background: var(--seg); color: var(--tx); font-size: 11px; font-weight: 700; }
.acct-av .pres-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px;
  border-radius: 50%; border: 2px solid var(--cd); }

.banner-warn {
  background: var(--holdbg); border-bottom: 1px solid var(--holdbd); color: var(--holdtx);
  font-size: 12.5px; padding: 7px 24px; display: flex; align-items: center; gap: 10px;
}
.banner-warn .dot { width: 8px; height: 8px; border-radius: 50%; background: #DBA112; }
.banner-warn button { background: none; border: none; cursor: pointer; color: var(--holdtx); font-weight: 650; font-size: 12.5px; text-decoration: underline; padding: 0; }

.content { flex: 1; overflow-y: auto; padding: 22px 26px; background: var(--pgc); }

.screen-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.screen-head .h { font-size: 19px; font-weight: 650; }
.screen-head .meta { font-size: 12.5px; color: var(--sub); }

/* ---------- cards / tables ---------- */
.card { background: var(--cd); border: 1px solid var(--cbd); border-radius: 16px; box-shadow: var(--csh); }
.table-card { overflow: hidden; }
.thead {
  display: grid; gap: 8px; padding: 10px 18px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; color: var(--sub);
  background: var(--hd); border-bottom: 1px solid var(--hbd);
}
.trow { display: grid; gap: 8px; align-items: center; padding: 11px 18px; border-top: 1px solid var(--rbd); }
.trow:hover { background: var(--hd); }
.cols-queue, .thead.cols-queue { grid-template-columns: 46px 1.4fr 150px 105px 130px 110px; }
.cols-cb, .thead.cols-cb { grid-template-columns: 40px 1.4fr 150px 105px 1fr; }
.cols-hist, .thead.cols-hist { grid-template-columns: 105px 1.4fr 150px 105px 90px 90px; }
.cols-tick, .thead.cols-tick { grid-template-columns: 135px 1.1fr 160px 1.1fr 105px 110px; }

.empty {
  background: var(--cd); border: 1px dashed var(--epbd); border-radius: 16px; padding: 54px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
}
.empty .ic { width: 44px; height: 44px; border-radius: 14px; background: var(--icbg); display: grid; place-items: center; color: var(--icfg); margin-bottom: 8px; }
.empty .t { font-size: 14px; font-weight: 600; }
.empty .d { font-size: 12.5px; color: var(--sub); max-width: 380px; line-height: 1.5; }

.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.ten { display: inline-block; font-size: 11.5px; font-weight: 650; padding: 3px 9px; border-radius: 7px; }
.st  { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }

.avatar {
  width: 34px; height: 34px; border-radius: 11px; color: #fff; display: grid; place-items: center;
  font-size: 12px; font-weight: 650; flex-shrink: 0; position: relative; overflow: hidden;
}
/* uploaded photo overlays the initials circle; on 404 the img removes itself */
.av-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.avatar-sm .av-img, .acct-av .av-img { border-radius: 50%; z-index: 1; }
.avatar-sm .pres-dot, .acct-av .pres-dot { z-index: 2; }
.btn-acc {
  border: none; cursor: pointer; background: var(--acc-grad); color: #fff; font-size: 12.5px;
  font-weight: 650; padding: 8px 19px; border-radius: 10px; box-shadow: 0 3px 10px var(--acc-glow);
}
.btn-acc:hover { filter: brightness(1.08); }
.btn-acc:disabled { opacity: .5; cursor: default; }

.wait-num { font-size: 13.5px; font-weight: 650; }
.wait-track { width: 72px; height: 3px; border-radius: 2px; background: var(--track); margin-top: 4px; overflow: hidden; }
.wait-fill { height: 100%; border-radius: 2px; }
.ringing-lbl { display: inline-flex; align-items: center; gap: 7px; color: #0A9B6C; font-size: 12px; font-weight: 650; }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: #10B981; display: inline-block; animation: dcPulse 1.1s ease-in-out infinite; }

/* ---------- softphone ---------- */
.softphone {
  background: linear-gradient(135deg,#1B1828 0%,#141220 100%); border: 1px solid transparent;
  border-radius: 16px; padding: 13px 18px; display: flex; align-items: center; gap: 14px;
  color: #fff; margin-bottom: 16px; box-shadow: 0 8px 28px rgba(20,18,32,.25); position: relative; overflow: hidden;
}
[data-theme="dark"] .softphone { border-color: #2C2840; }
.softphone .glow {
  position: absolute; top: -60px; right: 120px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,108,246,.25) 0%, rgba(124,108,246,0) 70%); pointer-events: none;
}
.softphone .who-avatar {
  width: 40px; height: 40px; border-radius: 13px; background: var(--acc-grad); display: grid;
  place-items: center; font-size: 13px; font-weight: 650; box-shadow: 0 4px 14px var(--acc-glow);
}
.softphone .nm { font-size: 14px; font-weight: 650; }
.softphone .ph { font-size: 12px; color: #9A93B0; margin-top: 1px; }
.softphone .timer { font-size: 24px; font-weight: 600; color: #5EE5A8; }
.softphone .div { width: 1px; height: 26px; background: rgba(255,255,255,.12); }
.sp-pill { font-size: 11px; font-weight: 650; padding: 3px 10px; border-radius: 20px; }
.sp-pill.muted { background: rgba(244,93,98,.18); color: #FF9296; }
.sp-pill.hold { background: rgba(245,158,11,.18); color: #FBC36D; }
.sp-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid rgba(255,255,255,.14);
  background: transparent; color: #B9B3CC; cursor: pointer; display: grid; place-items: center;
}
.sp-btn.on { background: #FFFFFF; color: #15121F; }
.sp-btn.stub { border-color: rgba(255,255,255,.07); color: #564F6E; cursor: not-allowed; }
.sp-end {
  height: 38px; padding: 0 19px; border-radius: 12px; border: none;
  background: linear-gradient(135deg,#F45D62,#E5484D); color: #fff; font-weight: 650; font-size: 13px;
  cursor: pointer; display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 14px rgba(229,72,77,.35);
}
.sp-end:hover { filter: brightness(1.08); }

.active-grid { display: grid; grid-template-columns: minmax(380px,5fr) minmax(340px,4fr); gap: 16px; align-items: start; }
.wo-strip {
  margin-top: 14px; padding: 11px 13px; background: var(--in); border: 1px solid var(--hbd);
  border-radius: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.ai-card {
  margin-top: 12px; background: var(--aibg); border: 1px solid var(--aibd); border-radius: 12px;
  padding: 12px 14px; position: relative; overflow: hidden;
}
.ai-card .lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; color: var(--ailb); text-transform: uppercase; }
.ai-card .txt { font-size: 13px; color: var(--tx2); margin-top: 6px; line-height: 1.5; text-wrap: pretty; }
.sec-lbl { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sub); margin-bottom: 4px; }
.past-row { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--rbd); font-size: 12.5px; align-items: baseline; }
.hold-note {
  background: var(--holdbg); border: 1px solid var(--holdbd); color: var(--holdtx);
  font-size: 12px; font-weight: 600; border-radius: 10px; padding: 8px 12px;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #F45D62; display: inline-block; animation: dcPulse 1.3s ease-in-out infinite; }
.notes-ta {
  width: 100%; min-height: 80px; border: 1px solid var(--inbd); border-radius: 10px; padding: 10px 12px;
  font-family: inherit; font-size: 13px; color: var(--tx3); resize: vertical; background: var(--in); line-height: 1.5;
}

/* ---------- incoming banner / dialer popover ---------- */
.incoming {
  position: fixed; top: 66px; right: 22px; width: 348px; background: var(--cd);
  border: 1px solid var(--cbd); border-radius: 18px; padding: 15px; z-index: 60;
  box-shadow: 0 4px 12px rgba(26,24,38,.08), 0 24px 64px rgba(26,24,38,.25);
}
.ring-badge {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg,#E4F8EF,#D3F3E3); color: #0A9B6C; animation: dcRing 1.2s ease-out infinite;
}
[data-theme="dark"] .ring-badge { background: rgba(52,211,153,.13); color: #5FD9A8; }
.btn-accept {
  flex: 1; height: 36px; border: none; border-radius: 10px; color: #fff; font-weight: 650;
  font-size: 13px; cursor: pointer; background: linear-gradient(135deg,#10B981,#0A9B6C);
  box-shadow: 0 3px 10px rgba(16,185,129,.3);
}
.btn-accept:hover { filter: brightness(1.08); }
.btn-decline {
  flex: 1; height: 36px; border: 1px solid var(--inbd); border-radius: 10px; background: var(--cd);
  color: #F45D62; font-weight: 650; font-size: 13px; cursor: pointer;
}
.btn-decline:hover { background: var(--declhov); }

.dialer-pop {
  position: absolute; top: 46px; right: 0; width: 280px; background: var(--cd);
  border: 1px solid var(--cbd); border-radius: 14px; padding: 12px; z-index: 50;
  box-shadow: 0 4px 12px rgba(26,24,38,.08), 0 24px 64px rgba(26,24,38,.22);
}
.dialer-pop input {
  width: 100%; background: var(--in); border: 1px solid var(--inbd); border-radius: 10px;
  color: var(--tx); padding: 10px 12px; font-size: 15px; font-family: 'Space Grotesk', monospace;
}
.dial-status { font-size: 12px; color: var(--sub); margin-top: 8px; min-height: 16px; }
.mini-kp { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mini-kp button { flex: 1 1 calc((100% - 12px) / 3); box-sizing: border-box; height: 38px; border: 1px solid var(--inbd); background: var(--in); color: var(--tx); border-radius: 9px; font-size: 16px; font-weight: 600; cursor: pointer; }
.mini-kp button:hover { background: var(--hd); }
.mini-kp button:active { transform: scale(.94); }
.mini-kp button.bk { color: var(--sub); }

/* ---------- metrics ---------- */
.metric-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 16px; }
.metric-card { padding: 16px 18px 12px; overflow: hidden; }
.metric-card .lbl { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sub); }
.metric-card .val { font-size: 32px; font-weight: 600; margin-top: 6px; }
.metric-card .sub { font-size: 12px; color: var(--sub); margin-top: 1px; }
.split-row { display: flex; align-items: center; gap: 14px; padding: 7px 0; }
.split-track { flex: 1; height: 8px; background: var(--track); border-radius: 4px; overflow: hidden; }
.split-fill { height: 100%; border-radius: 4px; transition: width .4s; }

.typing { display: inline-flex; gap: 4px; align-items: center; padding: 2px 0; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--fnt); animation: dcBlink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .18s; }
.typing span:nth-child(3) { animation-delay: .36s; }

.mic-warn { display: none; color: #f85149; font-weight: 600; font-size: 12.5px; padding: 6px 24px; background: var(--holdbg); border-bottom: 1px solid var(--holdbd); }

/* ============ W5: Dialer ============ */
.dial-tabs { display: inline-flex; gap: 4px; background: var(--seg); border-radius: 11px; padding: 4px; margin-bottom: 18px; }
.dial-tab { border: none; background: transparent; color: var(--seg-off-fg); font-size: 13px; font-weight: 650; padding: 7px 20px; border-radius: 8px; cursor: pointer; }
.dial-tab.on { background: var(--seg-on-bg); color: var(--tx); box-shadow: var(--seg-on-sh); }
.dial-card { background: var(--cd); border: 1px solid var(--cbd); border-radius: 18px; box-shadow: var(--csh); padding: 22px; max-width: 380px; }
.dial-disp { text-align: center; margin-bottom: 18px; }
.dial-disp.sm { margin-bottom: 12px; }
.dial-num { font-size: 30px; font-weight: 600; letter-spacing: .5px; color: var(--tx); min-height: 38px; }
.dial-disp.sm .dial-num { font-size: 24px; }
.dial-ph { color: var(--fnt); font-weight: 400; opacity: .8; }
.dial-caret { display: inline-block; width: 2px; height: 0.9em; background: var(--acc, #4DA3FF); border-radius: 1px; margin: 0 1px; vertical-align: -1px; animation: dcBlink 1.05s step-end infinite; }
.dial-field { width: 100%; background: transparent; border: none; outline: none; text-align: center; color: var(--tx); box-sizing: border-box; padding: 0; }
.dial-field::placeholder { color: var(--fnt); opacity: .75; font-weight: 400; }
.dial-field:focus { outline: none; }
.dial-mutearm { width: 100%; margin-top: 12px; padding: 11px; border-radius: 14px; border: 1px solid var(--line, rgba(125,125,125,.2)); background: var(--card2, rgba(125,125,125,.05)); color: var(--tx); font-size: 14px; font-weight: 600; cursor: pointer; }
.dial-mutearm.on { background: #F45D62; border-color: #F45D62; color: #fff; }
/* widget #8/#9 */
.wgt-call-ph[data-act] { cursor: pointer; }
.wgt-smsrow:empty { display: none; }
.wgt-sms { width: 100%; margin-top: 8px; padding: 9px; border-radius: 12px; border: 1px solid var(--line, rgba(125,125,125,.2)); background: var(--card2, rgba(125,125,125,.06)); color: var(--acc, #4DA3FF); font-size: 13px; font-weight: 650; cursor: pointer; }
/* #5 dialer contact-name search */
.dial-namesearch { width: 100%; margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line, rgba(125,125,125,.22)); background: var(--card2, rgba(125,125,125,.05)); color: var(--tx); font-size: 14px; box-sizing: border-box; }
.dial-nameres { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.dial-nameres:empty { margin-top: 0; }
.dial-nameitem { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line, rgba(125,125,125,.16)); background: var(--card, transparent); color: var(--tx); cursor: pointer; text-align: left; }
.dial-nameitem:hover { background: rgba(125,125,125,.08); }
.dni-nm { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dni-ph { color: var(--sub); font-size: 12.5px; flex: none; }
.dni-empty { color: var(--sub); font-size: 12.5px; padding: 6px 4px; }
/* header clipping in the Phone panes' rounded corners */
.phone-grid .screen-head { overflow: visible; padding-top: 3px; }
.phone-grid .screen-head .h { line-height: 1.3; padding-top: 1px; }
.phone-hist, .phone-dial { padding: 2px 14px 0 14px; box-sizing: border-box; }
.phone-grid { padding-left: 14px; box-sizing: border-box; }
@media (max-width: 820px) {
  .phone-grid { padding-left: 0; grid-template-columns: 1fr; }
  .phone-hist, .phone-dial { padding-left: 4px; padding-right: 4px; }
}
.dial-hint { font-size: 12px; color: var(--sub); margin-top: 5px; min-height: 16px; }
.dial-hint.warn { color: var(--wait-crit); font-weight: 600; }
/* paste-from-clipboard pill on the External dialer — clean, centered */
.dial-paste-btn { display: block; width: fit-content; margin: 0 auto 16px; padding: 7px 14px; border-radius: 9px;
  border: 1px solid var(--cbd); background: var(--hd); color: var(--sub); font-size: 12px; font-weight: 600;
  font-family: inherit; cursor: pointer; white-space: nowrap; transition: border-color .12s, color .12s, background .12s; }
.dial-paste-btn:hover { border-color: var(--acc); color: var(--acc); }
.dial-paste-btn.has-sug { border-color: var(--acc); color: var(--acc); background: color-mix(in srgb, var(--acc) 9%, transparent); }
/* clipboard peek chip — surfaces the phone-filtered clipboard contents on the big
   dialer so the dispatcher sees what they copied and can tap to load it */
.dial-clip-chip { display: flex; align-items: center; gap: 7px; width: fit-content; margin: 0 auto 14px;
  padding: 6px 13px; border-radius: 11px; border: 1px solid var(--acc);
  background: color-mix(in srgb, var(--acc) 11%, transparent); color: var(--acc);
  font-family: inherit; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s; }
.dial-clip-chip:hover { background: color-mix(in srgb, var(--acc) 18%, transparent); }
.dcc-num { font-size: 15.5px; font-weight: 650; letter-spacing: .3px; color: var(--tx); }
.dcc-tag { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--acc); opacity: .85; }
/* recent copied numbers — small tappable chips under the dialer paste area */
.dial-recents { width: fit-content; max-width: 100%; margin: 0 auto 14px; text-align: center; }
.dr-lbl { display: block; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--sub); margin-bottom: 6px; }
.dr-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.dr-chip { padding: 5px 10px; border-radius: 9px; border: 1px solid var(--cbd); background: var(--hd); color: var(--tx); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: border-color .12s, color .12s; }
.dr-chip:hover { border-color: var(--acc); color: var(--acc); }
/* DCOPv2 (07-05): copilot starter-prompt chips + bot-call-down transfer banner */
.cop-prompt-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; max-width: 460px; }
/* Persistent suggestion cloud above the composer — visible while the input is empty,
   hidden the moment you start typing. Wraps into a few rows (no slider); chips keep
   their natural width so rows read as a loose scatter of bubbles. */
.cop-chip-strip { display: flex; flex-wrap: wrap; gap: 7px 8px; padding: 10px 11px; border-top: 1px solid var(--cbd); }
.cop-prompt-chip { flex: 0 1 auto; white-space: nowrap; font-size: 12px; font-weight: 550; border-radius: 999px; }
.bot-batch-banner { margin: 0 0 8px; padding: 7px 12px; border-radius: 10px; background: #6D5DE7; color: #fff; font-size: 12.5px; font-weight: 750; letter-spacing: .2px; }
/* desktop (Electron) update bar — fixed at the very bottom, explicit button */
.desk-update-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 10px 16px; background: var(--acc); color: #fff; box-shadow: 0 -2px 12px rgba(0,0,0,.25); font-size: 13.5px; font-weight: 600; }
.dub-txt { letter-spacing: .2px; }
.dub-btn { padding: 7px 16px; border-radius: 9px; border: 0; background: #fff; color: var(--acc); font-family: inherit; font-size: 13px; font-weight: 750; cursor: pointer; }
.dub-btn:hover { opacity: .92; }
.dub-btn:disabled { opacity: .6; cursor: default; }
/* paste button on the compact topbar mini-dialer */
.mini-paste { margin: 6px auto 4px; font-size: 11.5px; padding: 5px 12px; }
/* keypad: flexbox-wrap (not grid) — iOS Safari mis-sizes grid 1fr tracks here
   and the flex buttons collapse to a single column; flex-wrap is bulletproof. */
.kp { display: flex; flex-wrap: wrap; gap: 12px; }
.kp-key {
  flex: 1 1 calc((100% - 24px) / 3); box-sizing: border-box;
  height: 60px; border: 1px solid var(--inbd); background: var(--in); border-radius: 14px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--tx);
  transition: transform .05s, background .12s;
}
.kp-key:hover { background: var(--hd); }
.kp-key:active { transform: scale(.95); }
.kp-d { font-size: 22px; font-weight: 600; line-height: 1; }
.kp-s { font-size: 9px; font-weight: 700; letter-spacing: .12em; color: var(--sub); }
.kp-del { color: var(--sub); }
.kp-call { background: linear-gradient(135deg,#10B981,#0A9B6C); border: none; color: #fff; box-shadow: 0 4px 14px rgba(16,185,129,.32); }
.kp-call:hover { filter: brightness(1.08); background: linear-gradient(135deg,#10B981,#0A9B6C); }
/* F2: dialing/ringing → red hang-up (cancel) */
.kp-call.dialing { background: linear-gradient(135deg,#F45D62,#E5484D); box-shadow: 0 4px 14px rgba(229,72,77,.34); }
.kp-call.dialing:hover { filter: brightness(1.06); background: linear-gradient(135deg,#F45D62,#E5484D); }

/* Merged Phone screen made the dialer pane narrow → the old 2-col (colleagues | keypad)
   internal card squished the colleague rows to "Av…Ex". Stack single-column: colleagues
   on top (scroll-capped), keypad below (Олег 2026-07-08). */
.dial-internal { max-width: min(430px, 100%); box-sizing: border-box; display: grid; grid-template-columns: 1fr; gap: 14px; margin: 0 auto; }
.dial-internal .dir-list { max-height: 210px; overflow-y: auto; }
.dial-internal .dir-row .dir-name, .dial-internal .dir-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-list { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.dir-row { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 12px; border: 1px solid transparent; }
.dir-row:hover { background: var(--hd); border-color: var(--rbd); }
.dir-row.busy { opacity: .65; }
.dir-nm { font-size: 13.5px; font-weight: 650; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dir-meta { font-size: 11.5px; color: var(--sub); display: flex; align-items: center; gap: 6px; margin-top: 1px; }
.pres-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dir-call { width: 36px; height: 36px; border-radius: 11px; border: none; cursor: pointer; background: linear-gradient(135deg,#10B981,#0A9B6C); color: #fff; display: grid; place-items: center; box-shadow: 0 3px 10px rgba(16,185,129,.3); flex-shrink: 0; }
.dir-call:disabled { opacity: .4; cursor: default; box-shadow: none; }
.dir-empty { font-size: 12.5px; color: var(--sub); padding: 18px 4px; text-align: center; }
.xkp { display: flex; flex-wrap: wrap; gap: 8px; }
.xkp-key { flex: 1 1 calc((100% - 16px) / 3); box-sizing: border-box; height: 44px; border: 1px solid var(--inbd); background: var(--in); border-radius: 11px; cursor: pointer; font-size: 17px; font-weight: 600; color: var(--tx); }
.xkp-key:hover { background: var(--hd); }
.xkp-key:active { transform: scale(.95); }
.xkp-call { background: linear-gradient(135deg,#10B981,#0A9B6C); border: none; color: #fff; display: grid; place-items: center; }

/* ============ W5: intercom banner ============ */
.intercom-banner {
  position: fixed; bottom: 22px; right: 22px; width: 300px; background: var(--cd);
  border: 1px solid var(--cbd); border-radius: 18px; padding: 16px; z-index: 70;
  box-shadow: 0 4px 12px rgba(26,24,38,.10), 0 24px 64px rgba(26,24,38,.30);
}
.ic-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ic-kicker { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--acc); display: inline-flex; align-items: center; gap: 6px; }
.ic-kicker.in { color: #0A9B6C; }
.ic-kicker.live { color: #F45D62; }
.ic-kicker.err { color: var(--wait-crit); }
.ic-who { font-size: 16px; font-weight: 650; color: var(--tx); }
.ic-sub { font-size: 12px; color: var(--sub); margin-top: 1px; }
.ic-timer { font-size: 13px; font-weight: 650; color: var(--tx2); }
.ic-row { display: flex; gap: 8px; margin-top: 13px; }
.ic-mute { flex: 1; height: 36px; border: 1px solid var(--inbd); border-radius: 10px; background: var(--cd); color: var(--tx2); font-weight: 650; font-size: 13px; cursor: pointer; }
.ic-mute.on { background: var(--holdbg); border-color: var(--holdbd); color: var(--holdtx); }

/* ============ W5: Team + Users ============ */
.cols-team, .thead.cols-team { grid-template-columns: 1.6fr 110px 150px 90px; }
.cols-users, .thead.cols-users { grid-template-columns: 1.5fr 150px 130px 90px 200px; }
.avatar.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 11px; }
.trow.off { opacity: .55; }
.u-you { font-size: 10px; font-weight: 700; color: var(--acc); background: var(--seg); padding: 1px 6px; border-radius: 6px; margin-left: 4px; }
.u-on { font-size: 11.5px; font-weight: 650; color: #0A9B6C; }
.u-offl { font-size: 11.5px; font-weight: 650; color: var(--sub); }
.u-new { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.u-edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.u-inp { background: var(--in); border: 1px solid var(--inbd); border-radius: 9px; color: var(--tx); padding: 8px 11px; font-size: 13px; }
select.u-inp { cursor: pointer; }
/* Native <select> dropdown readability (Oleg 06-19, Windows/Electron): Chromium
   rendered the open option popup with system-LIGHT background under our light
   theme text → white-on-white, unreadable. Scope color-scheme to selects so the
   native popup chrome follows the page theme, plus explicit SOLID option colors
   (theme vars) as a belt-and-suspenders for the text/background. Covers every
   <select> app-wide (ticket Transfer-to, etc.). */
[data-theme="dark"] select { color-scheme: dark; }
[data-theme="light"] select { color-scheme: light; }
select option { background-color: var(--cd); color: var(--tx); }
.u-x { border: 1px solid var(--inbd); background: var(--cd); color: var(--tx2); font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 9px; cursor: pointer; }
.u-x:hover { background: var(--hd); }
.u-x.danger { color: #F45D62; }
.u-err { font-size: 12px; color: var(--wait-crit); min-height: 15px; margin-top: 8px; }
.tn-row { display: inline-flex; gap: 10px; align-items: center; }
.tn-ck { display: inline-flex; gap: 5px; align-items: center; font-size: 12.5px; color: var(--tx2); cursor: pointer; }
.temp-box { background: var(--aibg); border: 1px solid var(--aibd); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; }
.tb-h { font-size: 12.5px; color: var(--tx2); }
.tb-pw { font-size: 22px; font-weight: 600; letter-spacing: 1px; color: var(--tx); margin: 6px 0; user-select: all; }
.tb-note { font-size: 11.5px; color: var(--sub); line-height: 1.45; margin-bottom: 10px; }

/* ============ W5: Recordings ============ */
.cols-rec, .thead.cols-rec { grid-template-columns: 100px 1.4fr 90px 80px 90px 110px; }
.trow.cols-rec { position: relative; }
.rec-dir { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 9px; border-radius: 7px; background: var(--seg); color: var(--tx2); }
.rec-dir.int { background: var(--aibg); color: var(--ailb); }
.rec-play { border: 1px solid var(--inbd); background: var(--cd); color: var(--acc); font-size: 12px; font-weight: 650; padding: 6px 12px; border-radius: 9px; cursor: pointer; }
.rec-play:hover { background: var(--hd); }
.rec-audio { grid-column: 1 / -1; padding: 10px 2px 2px; }
.rec-audio audio { width: 100%; height: 38px; }

/* ============ W6: Messenger ============ */
.msgr { display: grid; grid-template-columns: 290px 1fr; gap: 16px; height: calc(100vh - 110px); min-height: 420px; }
.msgr-threads { background: var(--cd); border: 1px solid var(--cbd); border-radius: 16px; box-shadow: var(--csh); display: flex; flex-direction: column; overflow: hidden; }
.msgr-head { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--hbd); }
.msgr-head .h { font-size: 16px; font-weight: 650; flex: 1; }
.msgr-new { border: none; background: var(--acc-grad); color: #fff; font-size: 12.5px; font-weight: 650; padding: 6px 13px; border-radius: 9px; cursor: pointer; box-shadow: 0 3px 10px var(--acc-glow); }
.thread-list { flex: 1; overflow-y: auto; padding: 6px; }
.thread-empty { color: var(--sub); font-size: 12.5px; text-align: center; padding: 28px 14px; line-height: 1.5; }
.thread-row { display: flex; gap: 11px; align-items: center; padding: 9px 10px; border-radius: 12px; cursor: pointer; }
.thread-row:hover { background: var(--hd); }
.thread-row.on { background: var(--seg); }
.avatar.grp { font-weight: 700; }
.tr-top { display: flex; align-items: baseline; gap: 6px; }
.tr-name { font-size: 13.5px; font-weight: 650; color: var(--tx); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-time { font-size: 11px; color: var(--sub); flex-shrink: 0; }
.tr-bot { display: flex; align-items: center; gap: 6px; margin-top: 1px; }
.tr-prev { font-size: 12px; color: var(--sub); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* SMS list handler tag: colleague's name (06-17) — compact, muted, truncated so a
   long name never pushes the row. `.you`/`.bot` keep their inherited look. */
.sms-tag.agent { font-size: 11px; font-weight: 600; color: var(--sub); max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; opacity: .85; }
.tr-unread { background: var(--acc); color: #fff; font-size: 10.5px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; flex-shrink: 0; }

.msgr-conv { background: var(--cd); border: 1px solid var(--cbd); border-radius: 16px; box-shadow: var(--csh); display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.conv-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; color: var(--sub); }
.conv-empty .ce-ic { font-size: 34px; opacity: .6; margin-bottom: 4px; }
.conv-empty .ce-t { font-size: 15px; font-weight: 650; color: var(--tx); }
.conv-empty .ce-d { font-size: 12.5px; max-width: 320px; line-height: 1.5; }
.conv-head { display: flex; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--hbd); }
.ch-name { font-size: 15px; font-weight: 650; }
.ch-sub { font-size: 12px; color: var(--sub); margin-top: 1px; }
.conv-msgs { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.day-sep { align-self: center; font-size: 11px; font-weight: 650; color: var(--sub); background: var(--seg); padding: 3px 12px; border-radius: 12px; margin: 6px 0; }
.msg { max-width: 72%; align-self: flex-start; display: flex; flex-direction: column; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg-sender { font-size: 11px; font-weight: 650; color: var(--acc); margin: 0 0 2px 4px; }
.bubble { background: var(--seg); color: var(--tx); padding: 8px 12px; border-radius: 14px; border-bottom-left-radius: 4px; font-size: 13.5px; line-height: 1.4; word-break: break-word; }
.msg.mine .bubble { background: var(--acc-grad); color: #fff; border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
.msg-body { white-space: pre-wrap; }
.msg-time { font-size: 10px; color: var(--fnt); margin: 2px 4px 0; }
.att-img { display: block; }
.att-img img { max-width: 240px; max-height: 240px; border-radius: 10px; display: block; }
.att-file { display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; padding: 4px 2px; }
.af-ic { font-size: 18px; }
.af-n { font-weight: 600; font-size: 13px; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.af-s { font-size: 11px; opacity: .7; }
.conv-composer { display: flex; align-items: flex-end; gap: 8px; padding: 11px 14px; border-top: 1px solid var(--hbd); }
.cc-attach { border: none; background: transparent; font-size: 19px; cursor: pointer; padding: 6px; border-radius: 8px; line-height: 1; }
.cc-attach:hover { background: var(--hd); }
.cc-text { flex: 1; resize: none; border: 1px solid var(--inbd); background: var(--in); color: var(--tx); border-radius: 12px; padding: 10px 13px; font-size: 16px; font-family: inherit; line-height: 1.3; min-height: 42px; max-height: 120px; }
.cc-send { border: none; background: var(--acc-grad); color: #fff; font-weight: 650; font-size: 13px; padding: 9px 18px; border-radius: 11px; cursor: pointer; box-shadow: 0 3px 10px var(--acc-glow); }

.new-panel { padding: 18px; overflow-y: auto; }
.np-head { display: flex; align-items: center; margin-bottom: 14px; }
.np-head .h { flex: 1; font-size: 16px; font-weight: 650; }
.np-opt { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; border: 1px solid var(--cbd); background: var(--cd); border-radius: 13px; padding: 14px 16px; margin-bottom: 10px; cursor: pointer; }
.np-opt:hover { background: var(--hd); }
.np-ic { font-size: 22px; }
.np-t { font-size: 14px; font-weight: 650; color: var(--tx); }
.np-d { font-size: 12px; color: var(--sub); margin-top: 1px; }
.rost-list { display: flex; flex-direction: column; gap: 4px; max-height: 52vh; overflow-y: auto; }
.rost-row { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 11px; cursor: pointer; border: 1px solid transparent; }
.rost-row:hover { background: var(--hd); }
.rost-row.sel { background: var(--seg); border-color: var(--acc); }
.rost-n { font-size: 13.5px; font-weight: 600; color: var(--tx); }
.rost-m { font-size: 11.5px; color: var(--sub); }
.rost-ck { width: 20px; text-align: center; color: var(--acc); font-weight: 800; }
.rost-add { color: var(--acc); font-size: 18px; font-weight: 700; }

/* ============ W7: PWA / mobile (bottom tabs + responsive) ============ */
/* base (hidden on desktop; shown under the mobile media query) */
.bottomnav { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 80;
  background: var(--top); backdrop-filter: blur(12px); border-top: 1px solid var(--cbd);
  padding-bottom: env(safe-area-inset-bottom); }
.bottomnav button { flex: 1; background: none; border: none; color: var(--sub); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 7px;
  font-size: 10px; font-weight: 600; position: relative; min-width: 0; }
.bottomnav button.on { color: var(--acc); }
.bottomnav button svg { width: 21px; height: 21px; }
.bottomnav button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn-badge { position: absolute; top: 3px; left: 50%; margin-left: 4px; background: var(--acc); color: #fff;
  font-size: 9px; font-weight: 700; min-width: 15px; height: 15px; border-radius: 8px; display: grid;
  place-items: center; padding: 0 4px; }
.conv-back { display: none; background: none; border: none; cursor: pointer; color: var(--tx);
  font-size: 23px; line-height: 1; padding: 0 8px 0 0; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 95; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; }
.sheet { width: 100%; background: var(--cd); border-radius: 18px 18px 0 0; padding: 8px 8px calc(12px + env(safe-area-inset-bottom));
  max-height: 72vh; overflow-y: auto; box-shadow: 0 -8px 40px rgba(0,0,0,.3); }
.sheet-grab { width: 38px; height: 4px; border-radius: 2px; background: var(--epbd); margin: 6px auto 8px; }
.sheet-item { display: flex; align-items: center; gap: 13px; padding: 13px 14px; border-radius: 12px;
  cursor: pointer; color: var(--tx); font-size: 14.5px; font-weight: 600; }
.sheet-item:active { background: var(--hd); }
.sheet-item svg { width: 18px; height: 18px; color: var(--sub); flex-shrink: 0; }
.sheet-item.danger { color: #F45D62; }

/* 06-18 mobile company switcher chip (desktop #tenantSeg is hidden on phones) */
.tb-company { display: inline-flex; align-items: center; gap: 5px; background: var(--seg); color: var(--tx); border: 1px solid var(--cbd); border-radius: 9px; padding: 5px 10px; font-size: 12.5px; font-weight: 650; font-family: inherit; cursor: pointer; }
.tb-company:active { opacity: .8; }

/* ---- Mid-range (821–1024px): collapse the desktop sidebar to an icon rail so
   the console stays usable when the window is dragged narrow (shrink-to-dialer).
   Below 821px the phone layout (next block) hides the sidebar entirely. ---- */
@media (min-width: 821px) and (max-width: 1024px) {
  .sidebar { width: 64px; min-width: 64px; padding: 16px 8px 14px; overflow: visible; }
  .sidebar .glow { display: none; }                /* would bleed once overflow is visible */
  .brand { justify-content: center; padding: 4px 0 18px; }
  .brand > div { display: none; }                  /* hide wordmark text, keep the logo */
  .nav-item { justify-content: center; gap: 0; padding: 9px 0; position: relative; }
  .nav-item .grow { display: none; }
  /* unread counts / on-call dot ride the icon's top-right corner */
  .nav-badge { position: absolute; top: 3px; right: 8px; min-width: 16px; height: 15px; font-size: 9.5px; padding: 0 4px; }
  .nav-dot { position: absolute; top: 7px; right: 12px; }
  /* presence collapses to the avatar; its menu pops out to the right */
  .presence-row { justify-content: center; padding: 8px 0; }
  .presence-row > div:not(.avatar-sm) { display: none; }
  .presence-row > svg { display: none; }
  .presence-menu { left: 8px; right: auto; width: 210px; }
  .content { padding: 20px 18px; }
}

@media (max-width: 820px) {
  .sidebar { display: none; }
  /* desktop .wrap is min-width:1200px — without resetting it the whole app is
     forced 1200px wide on a phone and everything scrolls sideways (the real
     cause of the "keypad too wide" report, not the keypad itself). */
  .wrap { flex-direction: column; min-width: 0; width: 100%; }
  .main { height: 100vh; height: 100dvh; min-height: 0; }
  /* clear the iOS status bar / notch (black-translucent + viewport-fit=cover) */
  .topbar { padding: env(safe-area-inset-top) 14px 0; gap: 8px; height: auto; min-height: calc(54px + env(safe-area-inset-top)); }
  .topbar .seg, #dialBtn, .tb-div { display: none; }
  .topbar .tb-label { display: none; }
  /* offline banner: wrap instead of overflowing off-screen */
  .banner-warn { padding: 7px 14px; font-size: 11.5px; flex-wrap: wrap; line-height: 1.35; }
  .banner-warn #offlineBannerText { flex: 1 1 100%; min-width: 0; }
  .conn span:not(.dot) { display: none; }   /* keep the status dot, drop the word */
  .tb-acct { display: inline-flex; align-items: center; }   /* status + sign out on phones */
  .content { padding: 14px 14px calc(66px + env(safe-area-inset-bottom)); }
  .bottomnav { display: flex; }

  /* screen heads tighter */
  .screen-head { margin-bottom: 12px; }
  .active-grid { grid-template-columns: 1fr; }
  .softphone { flex-wrap: wrap; row-gap: 10px; }
  /* 06-18 mobile: bigger call-control tap targets; embedded ticket form full-width
     with 16px inputs (no iOS focus-zoom). */
  .softphone .sp-btn, .softphone .sp-end { width: 42px; height: 42px; }
  #acTicket select, #acTicket textarea, #acTicket input { width: 100%; box-sizing: border-box; font-size: 16px; }
  /* the floating call widget is redundant on phones (the bottom "On call" tab
     returns to the call) and would cover the top of the content — hide it. */
  .call-widget { display: none !important; }
  /* the On-call bottom-nav tab is tinted green (a live call) */
  .bottomnav .bn-oncall { color: #10B981; }
  .bottomnav .bn-oncall.on { color: var(--acc); }
  .bottomnav button span { font-size: 9.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* messenger → single pane (list OR conversation), with a back button */
  /* Fit the conversation EXACTLY into the visible area so the composer is
     pinned above the bottom nav (was overshooting by safe-top + .content's
     14px top pad → composer was pushed below the fold). */
  .msgr { grid-template-columns: 1fr;
    height: calc(100dvh - 54px - env(safe-area-inset-top) - 14px - 66px - env(safe-area-inset-bottom)); }
  /* iOS keyboard follow (chat only): when the composer is focused, shrink ONLY
     the conversation to the area above the keyboard (--kbd-msgr-h, set by the
     inline script from visualViewport; falls back to the static height). Top
     (header + messages) stays put; nav hidden; body can't scroll the page away.
     Deliberately does NOT touch .main/.wrap/html — that collapsed the layout. */
  body.kbd-open { overflow: hidden; }
  body.kbd-open .bottomnav { display: none; }
  body.kbd-open .content { padding-bottom: 0; }
  body.kbd-open .msgr {
    height: var(--kbd-msgr-h, calc(100dvh - 54px - env(safe-area-inset-top) - 14px - 66px - env(safe-area-inset-bottom))); }
  /* iOS form accessory bar (the prev/next/Done strip) is a NATIVE overlay that
     covers the bottom ~44px of the visible web area — shrinking .msgr can't move
     the textarea out from under it (iOS scroll-into-view re-pins the focused
     input just above the keyboard). Instead give the textarea real space below
     it: padding-bottom drops a gap the accessory bar covers instead of the
     input, and scroll-margin-bottom asks iOS to leave that gap when it reveals
     the field. */
  body.kbd-open .conv-composer { padding-bottom: 64px; }
  body.kbd-open .cc-text { scroll-margin-bottom: 72px; }
  .msgr[data-m="list"] .msgr-conv { display: none; }
  .msgr[data-m="conv"] .msgr-threads { display: none; }
  .conv-back { display: inline-block; }

  /* dialer → centered phone-style pad with round, thumb-sized keys */
  .dial-card, .dial-internal { max-width: 100%; }
  .dial-card { padding: 16px 14px 22px; }
  .dial-internal { grid-template-columns: 1fr; }
  .dir-list { max-height: none; }
  .dial-num { font-size: 33px; }

  /* round touch keys; max-width caps key size on wide phones, margin centers.
     aspect-ratio:1 makes them perfect circles regardless of screen width. */
  .kp { max-width: 320px; margin: 16px auto 0; gap: 16px; justify-content: center; }
  .kp-key { flex: 1 1 calc((100% - 32px) / 3); height: auto; aspect-ratio: 1; border-radius: 50%; }
  .kp-d { font-size: 27px; }
  .kp-s { font-size: 9.5px; }
  .kp-call svg { width: 25px; height: 25px; }

  /* internal extension pad → same round style, a touch smaller */
  .xkp { max-width: 300px; margin: 14px auto 0; gap: 14px; justify-content: center; }
  .xkp-key { flex: 1 1 calc((100% - 28px) / 3); height: auto; aspect-ratio: 1; border-radius: 50%; font-size: 22px; }

  /* data tables: keep columns, scroll sideways instead of breaking */
  .table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-card .thead, .table-card .trow { min-width: 580px; }
  /* team/users grids use fr-columns that COLLAPSE under min-width on a phone
     (avatar then overlaps the Role text — Oleg's screenshot). Fixed px tracks
     can't shrink; the row gets its true width and the card scrolls sideways. */
  .thead.cols-team, .trow.cols-team { grid-template-columns: 210px 100px 130px 80px; }
  .thead.cols-users, .trow.cols-users { grid-template-columns: 210px 120px 115px 80px 195px; }

  /* call/intercom banners → bottom sheet above the tab bar */
  .incoming, .intercom-banner { left: 12px; right: 12px; width: auto; top: auto;
    bottom: calc(74px + env(safe-area-inset-bottom)); }
  /* 06-18: a tall banner (conference roster) must never run off-screen */
  .incoming, .intercom-banner { max-height: calc(100dvh - 150px - env(safe-area-inset-bottom)); overflow-y: auto; }

  /* users/team new-user form wraps */
  .u-new, .u-edit { flex-direction: column; align-items: stretch; }
  .u-new .u-inp, .u-new .tn-row { width: 100%; }

  /* push prompt sits above the tab bar on phones */
  .push-prompt { bottom: calc(66px + env(safe-area-inset-bottom)); padding-bottom: 0; }
}

/* W7: push-notification soft prompt */
.push-prompt { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; display: flex; justify-content: center;
  padding: 14px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); pointer-events: none; }
.pp-card { pointer-events: auto; width: 100%; max-width: 420px; background: var(--cd); border: 1px solid var(--cbd);
  border-radius: 16px; padding: 15px 16px; box-shadow: 0 8px 40px rgba(0,0,0,.32); font-size: 14px; color: var(--tx); }
.pp-d { font-size: 12.5px; color: var(--sub); margin-top: 5px; line-height: 1.45; }
.pp-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 13px; }
.pp-ok { border: none; background: var(--acc-grad); color: #fff; font-weight: 650; font-size: 13px; padding: 9px 18px; border-radius: 10px; cursor: pointer; }
.pp-no { border: 1px solid var(--inbd); background: var(--cd); color: var(--tx2); font-weight: 600; font-size: 13px; padding: 9px 16px; border-radius: 10px; cursor: pointer; }

/* ============ W8: conference (group calls) ============ */
.conf-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 4px; }
.conf-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 5px;
  background: var(--in); border: 1px solid var(--inbd); border-radius: 20px;
  font-size: 12.5px; font-weight: 600; color: var(--tx); }
.conf-chip .avatar.sm { width: 22px; height: 22px; border-radius: 50%; font-size: 9px; }
.conf-chip.pending { opacity: .65; border-style: dashed; padding-left: 11px; animation: confPulse 1.4s ease-in-out infinite; }
@keyframes confPulse { 0%,100% { opacity: .65; } 50% { opacity: .35; } }
/* W8.6: active-conference participant roster (rows + ✕ remove) + wider banner */
.intercom-banner.conf-wide { width: 380px; }
.conf-roster { display: flex; flex-direction: column; gap: 4px; margin: 9px 0 4px; max-height: 46vh; overflow-y: auto; }
.conf-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 11px; background: var(--in); border: 1px solid var(--inbd); }
.conf-row.pending { opacity: .7; border-style: dashed; animation: confPulse 1.4s ease-in-out infinite; }
.conf-row .avatar.sm { width: 26px; height: 26px; border-radius: 50%; font-size: 10px; flex-shrink: 0; }
.conf-rico { width: 26px; height: 26px; border-radius: 50%; background: var(--seg); display: grid; place-items: center; font-size: 14px; flex-shrink: 0; }
.conf-rnm { flex: 1; min-width: 0; }
.conf-rt { font-size: 13px; font-weight: 600; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conf-rs { font-size: 11px; color: var(--sub); }
.conf-you { font-size: 10px; font-weight: 700; color: var(--acc); }
.conf-x { flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px; border: none; background: transparent; color: var(--sub); font-size: 14px; line-height: 1; cursor: pointer; }
.conf-x:hover { background: var(--holdbg); color: #f85149; }
.conf-addlist { max-height: 180px; overflow-y: auto; margin-top: 10px; border-top: 1px solid var(--rbd); padding-top: 8px; }
.conf-addlist .dir-row { cursor: pointer; }
.conf-pick { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--inbd);
  display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
  color: #fff; font-size: 14px; font-weight: 700; }
.conf-pick.on { background: var(--acc-grad); border-color: transparent; }
.conf-pick.off { opacity: .3; cursor: default; }
.rec-dir.conf-rec { background: rgba(124,108,246,.14); color: var(--acc); }
/* W8.5: dial an external number into the conference */
.conf-dialrow { display: flex; gap: 8px; margin-bottom: 8px; }
.conf-dialrow .u-inp { flex: 1; min-width: 0; font-size: 14px; padding: 9px 12px; }
.conf-dialrow .btn-acc { flex-shrink: 0; padding: 0 18px; font-size: 13px; }

/* ---- mobile: Queue + Recordings rows become stacked cards (06-12).
   The 580px min-width + sideways scroll left Queue's caller cell ~40px
   (fields overlapped) and Recordings wider than the phone viewport. ---- */
@media (max-width: 640px) {
  .thead.cols-queue, .thead.cols-rec { display: none; }
  .table-card .trow.cols-queue, .table-card .trow.cols-rec { min-width: 0; }
  .trow.cols-queue {
    grid-template-columns: auto auto 1fr auto;
    grid-template-areas: "caller caller caller wait" "tag ten . claim";
    row-gap: 10px; padding: 13px 14px;
  }
  .trow.cols-queue > div:nth-child(1) { display: none; }
  .trow.cols-queue > div:nth-child(2) { grid-area: caller; }
  .trow.cols-queue > div:nth-child(3) { grid-area: tag; align-self: center; }
  .trow.cols-queue > div:nth-child(4) { grid-area: ten; align-self: center; }
  .trow.cols-queue > div:nth-child(5) { grid-area: wait; justify-self: end; }
  .trow.cols-queue > div:nth-child(6) { grid-area: claim; }
  .trow.cols-rec {
    grid-template-columns: auto auto 1fr;
    grid-template-areas: "type type time" "party party party" "ten size play";
    row-gap: 9px; padding: 13px 14px;
  }
  .trow.cols-rec > div:nth-child(1) { grid-area: type; }
  .trow.cols-rec > div:nth-child(2) { grid-area: party; overflow-wrap: anywhere; }
  .trow.cols-rec > div:nth-child(3) { grid-area: ten; align-self: center; }
  .trow.cols-rec > div:nth-child(4) { grid-area: size; align-self: center; }
  .trow.cols-rec > div:nth-child(5) { grid-area: time; justify-self: end; }
  .trow.cols-rec > div:nth-child(6) { grid-area: play; align-self: center; }
  .rec-audio audio { max-width: 100%; }
  /* Team + Users tables: stack to fit the phone (no sideways swipe — статусы видны без свайпа). */
  .thead.cols-team, .thead.cols-users { display: none; }
  .table-card .trow.cols-team { min-width: 0; grid-template-columns: 1fr auto;
    grid-template-areas: "member ten" "pres online"; row-gap: 6px; }
  .trow.cols-team > div:nth-child(1) { grid-area: member; min-width: 0; }
  .trow.cols-team > div:nth-child(2) { grid-area: ten; justify-self: end; align-self: center; }
  .trow.cols-team > div:nth-child(3) { grid-area: pres; flex-wrap: wrap; }
  .trow.cols-team > div:nth-child(4) { grid-area: online; justify-self: end; align-self: center; }
  .table-card .trow.cols-users:not(.edit) { min-width: 0; grid-template-columns: 1fr auto;
    grid-template-areas: "member role" "pres ten" "actions actions"; row-gap: 7px; }
  .trow.cols-users:not(.edit) > div:nth-child(1) { grid-area: member; min-width: 0; }
  .trow.cols-users:not(.edit) > div:nth-child(2) { grid-area: role; justify-self: end; align-self: center; }
  .trow.cols-users:not(.edit) > div:nth-child(3) { grid-area: ten; justify-self: end; align-self: center; }
  .trow.cols-users:not(.edit) > div:nth-child(4) { grid-area: pres; flex-wrap: wrap; }
  .trow.cols-users:not(.edit) > div:nth-child(5) { grid-area: actions; justify-content: flex-start; }
}

/* Copy/paste ergonomics (06-17): one-click copyable values + toast + custom
   right-click menu (Electron shell has no native one). */
.copyable { cursor: copy; user-select: text; border-radius: 4px; padding: 0 1px; transition: background .12s; }
.copyable:hover { background: color-mix(in srgb, var(--acc) 16%, transparent); text-decoration: underline; text-underline-offset: 2px; }
.copyable:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }
.acp-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(8px); background: var(--cd); color: var(--tx); border: 1px solid var(--cbd); box-shadow: var(--csh); border-radius: 10px; padding: 9px 15px; font-size: 13px; font-weight: 650; opacity: 0; pointer-events: none; z-index: 9999; transition: opacity .15s ease, transform .15s ease; }
.acp-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.ctxmenu { position: fixed; z-index: 10000; min-width: 150px; background: var(--cd); border: 1px solid var(--cbd); box-shadow: var(--csh); border-radius: 10px; padding: 5px; }
.ctxmenu-item { padding: 7px 12px; font-size: 13px; font-weight: 550; color: var(--tx); border-radius: 7px; cursor: pointer; user-select: none; }
.ctxmenu-item:hover { background: color-mix(in srgb, var(--acc) 20%, transparent); }

/* ---- Contacts book (06-17) ---- */
.ct-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.ct-seg { flex: 0 0 auto; }
.ct-search { flex: 1; min-width: 150px; font-size: 13.5px; padding: 8px 13px; border-radius: 10px; border: 1px solid var(--cbd); background: var(--cd); color: var(--tx); font-family: inherit; }
.ct-search:focus { outline: none; border-color: var(--acc); }
.ct-addbtn { flex: 0 0 auto; padding: 8px 15px; }

.ct-list { padding: 0; }
.ct-grp-h { position: sticky; top: 0; z-index: 1; padding: 7px 16px; font-size: 12px; font-weight: 700; color: var(--sub); background: var(--hd); letter-spacing: .05em; }
.ct-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--cbd); }
.ct-grp .ct-grp-h + .ct-row { border-top: none; }
.ct-row:hover { background: color-mix(in srgb, var(--acc) 5%, transparent); }
.ct-main { flex: 1; min-width: 0; }
.ct-nm { font-size: 14px; font-weight: 650; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-ph { font-size: 12.5px; color: var(--sub); margin-top: 1px; }
.ct-actions { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.ct-call { width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#34D399,#059669); color: #fff; flex: 0 0 auto; }
.ct-call:hover { filter: brightness(1.08); }
.ct-x { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--cbd); background: var(--cd); color: var(--tx2); cursor: pointer; font-family: inherit; white-space: nowrap; }
.ct-x:hover { border-color: var(--acc); color: var(--acc); }
.ct-x.danger:hover { border-color: #F45D62; color: #F45D62; }
.ct-empty { padding: 34px 16px; text-align: center; color: var(--sub); font-size: 13px; }

.ct-add { padding: 14px 16px; margin-bottom: 14px; }
.ct-add-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ct-add-row + .ct-add-row { margin-top: 10px; }
.ct-inp { font-size: 13.5px; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--cbd); background: var(--cd); color: var(--tx); font-family: inherit; }
.ct-inp:focus { outline: none; border-color: var(--acc); }
.ct-add-row > .ct-inp:first-child { flex: 1; min-width: 140px; }
.ct-add-ten { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--sub); }
.ct-add-hint { font-size: 12px; color: var(--sub); margin-top: 8px; }
.ct-scope { flex: 0 0 auto; }
.ct-edit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; }
.ct-row.editing { background: color-mix(in srgb, var(--acc) 6%, transparent); }

/* recents "+save to contacts" affordance on the Dialer */
.dr-item { display: inline-flex; align-items: center; gap: 3px; }
.dr-add { width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--cbd); background: var(--hd); color: var(--sub); font-size: 15px; line-height: 1; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; justify-content: center; }
.dr-add:hover { border-color: var(--acc); color: var(--acc); }

/* 06-18: persistent active-call widget — shown on every screen except Active */
.call-widget { position: fixed; top: 64px; right: 22px; z-index: 65; display: flex; align-items: center; gap: 6px; background: var(--cd); border: 1px solid var(--cbd); border-radius: 13px; padding: 6px; box-shadow: 0 10px 34px rgba(0,0,0,.34); }
.call-widget .cw-open { display: flex; align-items: center; gap: 9px; cursor: pointer; background: transparent; border: 0; color: var(--tx1); padding: 5px 10px 5px 8px; border-radius: 9px; font-family: inherit; }
.call-widget .cw-open:hover { background: rgba(125,125,125,.12); }
.call-widget .cw-dot { width: 9px; height: 9px; border-radius: 50%; background: #10B981; flex: 0 0 auto; animation: cwPulse 1.6s infinite; }
@keyframes cwPulse { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,.45); } 70% { box-shadow: 0 0 0 7px rgba(16,185,129,0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); } }
.call-widget .cw-ph { font-size: 13px; font-weight: 650; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.call-widget .cw-tm { font-size: 12.5px; font-weight: 650; color: #10B981; min-width: 42px; text-align: right; }
.call-widget .cw-b { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--cbd); background: transparent; color: var(--tx2); cursor: pointer; display: grid; place-items: center; }
.call-widget .cw-b:hover { background: rgba(125,125,125,.12); }
.call-widget .cw-b.on { background: var(--acc); color: #fff; border-color: transparent; }
.call-widget .cw-end { background: rgba(239,68,68,.16); color: #EF4444; border-color: transparent; }
.call-widget .cw-end:hover { background: rgba(239,68,68,.28); }
@media (max-width: 820px) { .call-widget { top: calc(54px + env(safe-area-inset-top)); left: 10px; right: 10px; } .call-widget .cw-ph { max-width: none; flex: 1; } }

/* ============================================================================
   Dialer Widget (CSR P1 Phase 2) — compact always-on-top softphone rendered by
   app/js/widget.js in the separate Electron window (?widget=1). Glass/pill skin
   per the Claude Design "Dispatcher Dialer Widget"; colours follow the app theme
   (data-theme) + tenant accent (--acc / --acc-grad). See widget.js for wiring.
   ============================================================================ */
@keyframes dwIn   { 0% { transform: translateY(10px) scale(.97); opacity: 0; } 100% { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes dwRing { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,.4); } 100% { box-shadow: 0 0 0 18px rgba(16,185,129,0); } }
@keyframes dwBob  { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* widget window: hide the full console chrome + its floating banners, make the
   page background transparent so only the rounded glass card shows. */
body.widget-mode { background: transparent !important; }
body.widget-mode .wrap,
body.widget-mode #incoming, body.widget-mode #xferBanner, body.widget-mode .intercom-banner,
body.widget-mode .push-prompt, body.widget-mode #updateToast, body.widget-mode .call-widget,
body.widget-mode .acp-toast { display: none !important; }

#dialer-widget {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  z-index: 999; font-family: 'Segoe UI', -apple-system, 'Helvetica Neue', sans-serif;
  /* light defaults (app boots light); dark override below */
  --wg-glass: rgba(255,255,255,.9); --wg-solid: #FFFFFF; --wg-bd: rgba(20,18,32,.1);
  --wg-tx: #1A1826; --wg-tx2: #3C3852; --wg-sub: #8B86A0; --wg-ph: #B4AFC4; --wg-grip: rgba(20,18,32,.2);
  --wg-keybg: #F4F3FA; --wg-keybd: #ECEAF4; --wg-keyhov: #EBE9F4;
}
[data-theme="dark"] #dialer-widget {
  --wg-glass: rgba(28,25,40,.85); --wg-solid: #1C1928; --wg-bd: rgba(255,255,255,.09);
  --wg-tx: #F1EFF8; --wg-tx2: #C7C2DA; --wg-sub: #8B85A2; --wg-ph: #6A6486; --wg-grip: rgba(255,255,255,.22);
  --wg-keybg: rgba(255,255,255,.05); --wg-keybd: rgba(255,255,255,.07); --wg-keyhov: rgba(255,255,255,.1);
}
#dialer-widget button { font-family: inherit; }
/* same-view re-render (Mute/Hold tick) must not replay the entrance animation */
.wgt-noanim .wgt-card, .wgt-noanim .wgt-pill { animation: none; }

/* ---- collapsed pill ---- */
.wgt-pill {
  display: flex; align-items: center; gap: 11px; height: 52px; padding: 0 8px 0 16px; flex-shrink: 0;
  border-radius: 26px; cursor: grab; background: var(--wg-glass); border: 1px solid var(--wg-bd);
  box-shadow: 0 14px 40px rgba(0,0,0,.4); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  /* the WHOLE pill drags the window; expand/End are no-drag buttons so they stay
     clickable (a drag region swallows clicks, so the body can't also expand —
     hence the dedicated arrows button, present on both idle and in-call). 06-20. */
  animation: dwIn .22s ease; -webkit-app-region: drag;
}
.wgt-pill:hover { filter: brightness(1.04); }
.wgt-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.wgt-dot.live { background: #10B981; box-shadow: 0 0 10px rgba(16,185,129,.8); animation: dcPulse 1.3s ease-in-out infinite; }
.wgt-pill-txt { min-width: 0; }
.wgt-pill-t { font-size: 12.5px; font-weight: 650; color: var(--wg-tx); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.wgt-pill-s { font-size: 11px; color: var(--wg-sub); margin-top: 1px; }
/* idle "ops stats" pill (queue/tickets/callbacks): fixed width so changing counts
   never force a window resize — the pill is sized once when it collapses. 06-20. */
.wgt-pill-txt.stats { width: 168px; }
.wgt-pill-txt.stats .wgt-pill-s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wgt-pill-end, .wgt-pill-open { width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer; display: grid; place-items: center; -webkit-app-region: no-drag; }
.wgt-pill-end { background: linear-gradient(135deg,#F45D62,#E5484D); color: #fff; box-shadow: 0 4px 12px rgba(229,72,77,.4); }
.wgt-pill-open { background: var(--wg-keybg); color: var(--wg-tx2); }

/* ---- expanded card ---- */
.wgt-card {
  /* flex-shrink:0 — never let the flex container (a still-pill-narrow window
     during expand) squeeze the card below 328px, which crushed the header so the
     name slid under the buttons until the window finished resizing. 06-20. */
  width: 328px; flex-shrink: 0; border-radius: 28px; overflow: hidden; background: var(--wg-glass);
  border: 1px solid rgba(255,255,255,.09); border-top-color: rgba(255,255,255,.16);
  /* WGTCLIP (07-03): layered shadow tuned to fit inside the transparent window
     margin (M=40 in fitWindow) — the old 70px-blur shadow was CLIPPED by the
     window edge and read as an ugly square halo. */
  box-shadow:
    0 1px 2px rgba(0,0,0,.35),
    0 6px 16px rgba(0,0,0,.30),
    0 18px 44px rgba(0,0,0,.38),
    0 1px 0 rgba(255,255,255,.06) inset;
  backdrop-filter: blur(24px) saturate(1.15); -webkit-backdrop-filter: blur(24px) saturate(1.15);
  animation: dwIn .26s cubic-bezier(.2,.9,.3,1);
}
.wgt-clip-chip {
  display: flex; align-items: center; gap: 7px; margin: 10px 18px 0; padding: 8px 12px;
  border-radius: 12px; border: 1px dashed var(--acc, #7C5CFF); background: color-mix(in srgb, var(--acc, #7C5CFF) 12%, transparent);
  color: var(--wg-fg, #E8E6F0); font-size: 13.5px; font-weight: 600; cursor: pointer; width: calc(100% - 36px);
  justify-content: center; letter-spacing: .2px;
}
.wgt-clip-chip:hover { background: color-mix(in srgb, var(--acc, #7C5CFF) 20%, transparent); }
.wgt-clip-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; opacity: .55; letter-spacing: .8px; }
.wgt-divider { height: 1px; background: var(--wg-bd); margin: 0 0 2px; }

/* header / drag bar */
.wgt-head { display: flex; align-items: center; gap: 10px; padding: 13px 14px 11px; -webkit-app-region: drag; }
.wgt-grip { display: flex; flex-direction: column; gap: 3px; padding: 3px 2px; cursor: grab; }
.wgt-grip span { width: 15px; height: 2px; border-radius: 2px; background: var(--wg-grip); }
.wgt-av-wrap { position: relative; }
.wgt-av { width: 28px; height: 28px; border-radius: 9px; background: var(--acc-grad); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; box-shadow: 0 3px 10px var(--acc-glow); }
.wgt-av-dot { position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--wg-solid); }
.wgt-id { flex: 1; min-width: 0; }
.wgt-id-nm { font-size: 12.5px; font-weight: 650; color: var(--wg-tx); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wgt-id-pr { font-size: 11px; color: var(--wg-sub); margin-top: 1px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; -webkit-app-region: no-drag; }
.wgt-id-pr:hover { color: var(--wg-tx2); }
.wgt-pr-dot { width: 6px; height: 6px; border-radius: 50%; }
.wgt-icbtn { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--wg-bd); background: var(--wg-keybg); color: var(--wg-tx2); cursor: pointer; display: grid; place-items: center; -webkit-app-region: no-drag; }
.wgt-icbtn:hover { background: var(--wg-keyhov); }

.wgt-body { padding: 14px 18px 18px; }

/* dial view */
.wgt-numdisp { min-height: 52px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.wgt-num { font-size: 27px; font-weight: 600; letter-spacing: .01em; color: var(--wg-tx); line-height: 1.1; }
.wgt-num-ph { font-size: 17px; font-weight: 500; color: var(--wg-ph); }
.wgt-num-sub { font-size: 11.5px; font-weight: 600; color: var(--wg-sub); min-height: 15px; }
.wgt-pad { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.wgt-key { height: 54px; border-radius: 15px; border: 1px solid var(--wg-keybd); background: var(--wg-keybg); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; transition: transform .06s, background .15s; }
.wgt-key:hover { background: var(--wg-keyhov); }
.wgt-key:active { transform: scale(.93); }
.wgt-key-d { font-size: 21px; font-weight: 600; color: var(--wg-tx); line-height: 1; }
.wgt-key-s { font-size: 8px; font-weight: 700; letter-spacing: .13em; color: var(--wg-sub); height: 9px; }
.wgt-actionrow { display: grid; grid-template-columns: 54px 1fr 54px; align-items: center; gap: 9px; margin-top: 13px; }
.wgt-call { height: 56px; border-radius: 18px; border: none; background: linear-gradient(135deg,#10B981,#0A9B6C); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 15px; font-weight: 650; box-shadow: 0 8px 22px rgba(16,185,129,.35); }
.wgt-call:hover { filter: brightness(1.06); }
.wgt-bksp, .wgt-clear { height: 56px; border-radius: 18px; border: none; background: transparent; color: var(--wg-tx2); cursor: pointer; display: grid; place-items: center; }
.wgt-bksp:hover, .wgt-clear:hover { background: var(--wg-keybg); }
.wgt-bksp.off { color: var(--wg-ph); cursor: default; }

/* chips (tag / tenant / WO) */
.wgt-chip { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.wgt-chip.sq { border-radius: 7px; font-weight: 650; }
.wgt-wo { font-size: 11px; font-weight: 700; color: var(--wg-tx2); margin-left: auto; align-self: center; }

/* incoming view */
.wgt-incoming { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 22px 18px 20px; }
.wgt-inc-kick { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #0A9B6C; margin-bottom: 14px; }
.wgt-inc-badge { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; color: #fff; font-size: 24px; font-weight: 650; background: var(--acc-grad); animation: dwRing 1.3s ease-out infinite; }
.wgt-inc-nm { font-size: 19px; font-weight: 650; color: var(--wg-tx); margin-top: 14px; }
.wgt-inc-ph { font-size: 13px; color: var(--wg-sub); margin-top: 3px; }
.wgt-inc-chips { display: flex; gap: 7px; margin-top: 11px; }
.wgt-inc-actions { display: flex; gap: 26px; margin-top: 22px; }
.wgt-inc-col { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.wgt-inc-col span { font-size: 11px; color: var(--wg-sub); font-weight: 600; }
.wgt-circ { width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer; display: grid; place-items: center; color: #fff; }
.wgt-circ:hover { filter: brightness(1.07); }
.wgt-circ.decline { background: linear-gradient(135deg,#F45D62,#E5484D); box-shadow: 0 8px 20px rgba(229,72,77,.4); }
.wgt-circ.accept { background: linear-gradient(135deg,#10B981,#0A9B6C); box-shadow: 0 8px 20px rgba(16,185,129,.42); animation: dwBob 1.4s ease-in-out infinite; }

/* in-call view */
.wgt-call-head { display: flex; align-items: center; gap: 12px; }
.wgt-call-av { width: 46px; height: 46px; border-radius: 15px; background: var(--acc-grad); color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 650; }
.wgt-call-id { flex: 1; min-width: 0; }
.wgt-call-nm { font-size: 15px; font-weight: 650; color: var(--wg-tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wgt-call-ph { font-size: 12px; color: var(--wg-sub); margin-top: 1px; }
.wgt-call-right { text-align: right; }
.wgt-timer { font-size: 18px; font-weight: 600; color: #10B981; line-height: 1; }
.wgt-call-st { font-size: 10px; font-weight: 650; color: var(--wg-sub); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }
.wgt-call-chips { display: flex; gap: 7px; align-items: center; margin-top: 11px; }
.wgt-ctrls { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin-top: 16px; }
.wgt-ctrl { height: 62px; border-radius: 15px; border: 1px solid var(--wg-bd); background: var(--wg-keybg); color: var(--wg-tx2); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.wgt-ctrl span { font-size: 10.5px; font-weight: 600; }
.wgt-ctrl:hover { filter: brightness(1.05); }
.wgt-ctrl.on { background: var(--acc-grad); color: #fff; border-color: transparent; }
.wgt-dtmf { margin-top: 12px; padding: 10px; border-radius: 15px; background: var(--wg-keybg); border: 1px solid var(--wg-bd); }
.wgt-dtmf-str { text-align: center; font-size: 15px; font-weight: 600; color: var(--wg-tx2); min-height: 20px; letter-spacing: .18em; }
.wgt-dtmf-pad { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin-top: 8px; }
.wgt-dtmf-key { height: 38px; border-radius: 11px; border: 1px solid var(--wg-keybd); background: var(--wg-solid); cursor: pointer; font-size: 16px; font-weight: 600; color: var(--wg-tx); transition: transform .06s; }
.wgt-dtmf-key:hover { background: var(--wg-keyhov); }
.wgt-dtmf-key:active { transform: scale(.93); }
.wgt-end { width: 100%; height: 54px; border-radius: 18px; border: none; background: linear-gradient(135deg,#F45D62,#E5484D); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 15px; font-weight: 650; box-shadow: 0 8px 22px rgba(229,72,77,.36); margin-top: 13px; }
.wgt-end:hover { filter: brightness(1.06); }

/* SALES S2 — AI-intake new-lead panel on the active sales/COD call */
.sales-intake { border:1px solid var(--cbd); }
.sales-intake .si-head { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.sales-intake .si-title { font-size:13.5px; font-weight:700; flex:1; }
.sales-intake .si-ai { font-size:11.5px; font-weight:650; padding:6px 12px; border-radius:9px;
  border:1px solid var(--cbd); background:rgba(168,85,247,.12); color:#C084FC; cursor:pointer; }
.sales-intake .si-ai:hover { filter:brightness(1.1); }
.sales-intake .si-ai:disabled { opacity:.5; cursor:default; }
.sales-intake .si-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:9px 10px; }
.sales-intake .si-field { display:flex; flex-direction:column; gap:3px; min-width:0; }
.sales-intake .si-field.si-wide { grid-column:1 / -1; }
.sales-intake .si-lab { font-size:10.5px; font-weight:700; color:var(--sub);
  text-transform:uppercase; letter-spacing:.03em; }
.sales-intake .si-lab i { color:#FF8A8E; font-style:normal; }
.sales-intake .si-in { width:100%; box-sizing:border-box; background:var(--cd,rgba(125,125,125,.06));
  border:1px solid var(--cbd); border-radius:8px; padding:7px 9px; font-size:13px; color:var(--fg);
  outline:none; font-family:inherit; }
.sales-intake .si-in:focus { border-color:var(--acc,#4DA3FF); }
.sales-intake .si-area { resize:vertical; min-height:42px; }
.sales-intake .si-foot { display:flex; align-items:center; gap:12px; margin-top:12px; }
.sales-intake .si-status { flex:1; font-size:12px; color:var(--sub); min-height:16px; }
.sales-intake .si-status.si-ok { color:#10B981; }
.sales-intake .si-status.si-err { color:#FF8A8E; }
.sales-intake .si-status.si-busy { color:var(--acc,#4DA3FF); }
.sales-intake .si-create { flex-shrink:0; padding:9px 20px; font-size:13px; }
@media (max-width:760px){ .sales-intake .si-grid { grid-template-columns:repeat(2,1fr); } }


/* DCOP (07-02): dispatcher copilot panel */
/* .msgr is a 290px+1fr grid (threads column) — the copilot has no thread list,
   so flex it and center a wide single conversation instead. */
.cop-msgr { display: flex; justify-content: center; height: calc(100vh - 110px); min-height: 420px; }
.cop-msgr .msgr-conv { width: 100%; max-width: 980px; display: flex; flex-direction: column; background: var(--cd); border: 1px solid var(--cbd); border-radius: 16px; box-shadow: var(--csh); overflow: hidden; }
.cop-msgr .conv-msgs { flex: 1; overflow-y: auto; }
.cop-batchbar { display:flex; align-items:center; gap:8px; padding:8px 12px; font-size:12px; border-bottom:1px solid var(--line,#2a2f3a); flex-wrap:wrap; }
.cop-batchbar .btn.sm { padding:2px 10px; font-size:12px; }
.cop-batchbar .btn.danger { color:#f66; border-color:#f66; }
.cop-tasksbar { padding: 8px 12px; font-size: 12px; color: var(--muted, #9aa4b2); cursor: pointer; border-bottom: 1px solid var(--line, #2a2f3a); user-select: none; }
.cop-tasksbar:hover { color: var(--fg, #e6e9ef); }
.cop-tasks { max-height: 180px; overflow-y: auto; border-bottom: 1px solid var(--line, #2a2f3a); padding: 4px 12px; }
.cop-task-row { font-size: 12px; padding: 4px 0; border-bottom: 1px dashed rgba(255,255,255,.05); }
.cop-chip { font-size: 10px; padding: 1px 6px; border-radius: 8px; background: rgba(99,140,255,.18); color: #9db4ff; margin-left: 4px; }
.bubble.cop-task { border-left: 3px solid #638cff; }


/* DCOP FAB: floating copilot bubble (bottom-right) + slide-up chat panel */
.cop-fab { position: fixed; right: 22px; bottom: 22px; width: 54px; height: 54px; border-radius: 50%;
  background: var(--acc-grad, linear-gradient(135deg,#6366f1,#8b5cf6)); color:#fff; font-size: 26px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 900;
  box-shadow: 0 6px 22px rgba(0,0,0,.45); user-select: none; }
.cop-fab:hover { transform: scale(1.06); }
.cop-fab .cop-fab-badge { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px;
  border-radius: 10px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.cop-fab-panel { position: fixed; right: 22px; bottom: 88px; width: 400px; max-width: calc(100vw - 32px);
  height: min(62vh, 580px); z-index: 901; background: var(--cd); border: 1px solid var(--cbd);
  border-radius: 16px; box-shadow: 0 14px 44px rgba(0,0,0,.55); display: flex; flex-direction: column; overflow: hidden; }
.cop-fab-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--hbd); font-weight: 650; }
.cop-fab-head .x { margin-left: auto; cursor: pointer; opacity: .7; font-size: 18px; padding: 2px 6px; }
.cop-fab-head .x:hover { opacity: 1; }
.cop-fab-panel .conv-msgs { flex: 1; overflow-y: auto; padding: 10px; }
@media (max-width: 760px) { .cop-fab { bottom: 86px; } .cop-fab-panel { bottom: 150px; } }

/* Sortable table headers (07-03): History columns */
.thead .th-sort { cursor: pointer; user-select: none; }
.thead .th-sort:hover { color: var(--tx); }
.thead .th-sort.on { color: var(--acc); font-weight: 700; }

/* OUTNUM-CFG (07-03): outbound-number pickers in Settings */
.ob-row { display: grid; grid-template-columns: 110px 1fr 1fr 1fr; gap: 12px; align-items: end; padding: 10px 0; border-bottom: 1px solid var(--hbd); }
.ob-row:last-child { border-bottom: none; }
.ob-co { font-weight: 650; padding-bottom: 6px; }
.ob-row select { width: 100%; }

/* ---- Phone screen (Zoom-style merged Dialer + Call History) ---- */
/* Call history is the primary content → give it the flexible big column; the
   dialer only needs enough for the keypad (Олег 2026-07-08). */
.phone-grid { align-items: stretch; }
/* 2-col only on desktop. This rule sits BELOW the ≤820px mobile reset in source order,
   so it MUST be desktop-scoped — otherwise it overrides the mobile 1-col stack and the
   Phone screen collapses into a thin left strip on iPhone (Олег 07-08). */
@media (min-width: 821px) { .phone-grid { grid-template-columns: minmax(0, 1fr) clamp(380px, 32%, 440px); } }
.phone-hist { overflow-y: auto; }
.ph-head { margin-bottom: 6px; }
.ph-list { display: flex; flex-direction: column; }
.ph-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto 30px 30px; align-items: center; gap: 8px; padding: 9px 8px; border-radius: 11px; cursor: default; border-bottom: 1px solid var(--line, rgba(125,125,125,.10)); }
.ph-row:last-child { border-bottom: none; }
.ph-row:hover { background: rgba(125,125,125,.07); }
.ph-row.nodial { cursor: default; }
.ph-call { width: 30px; height: 30px; border: none; border-radius: 50%; background: transparent; color: var(--sub); cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: .5; flex: none; }
.ph-row:hover .ph-call { opacity: 1; }
.ph-call:hover { background: rgba(125,125,125,.16); color: var(--tx); }
.ph-nm[data-copynum] { cursor: pointer; }
.ph-dir { display: flex; align-items: center; justify-content: center; }
.ph-main { min-width: 0; }
.ph-nm { font-size: 13.5px; font-weight: 650; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-nm.miss { color: #D5383E; }
.ph-sb { font-size: 11.5px; color: var(--sub); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-rt { text-align: right; }
.ph-tm { font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ph-du { font-size: 11px; color: var(--tx2, var(--sub)); }
.ph-kb { width: 30px; height: 30px; border: none; border-radius: 50%; background: transparent; color: var(--sub); cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: .5; }
.ph-row:hover .ph-kb { opacity: 1; }
.ph-kb:hover { background: rgba(125,125,125,.16); color: var(--tx); }
.phone-dial { overflow-y: auto; }
.phone-dial .dial-card { max-width: 420px; margin: 0 auto; }
/* mobile-only: FAB reveals the dialpad; "‹ History" returns. Hidden on desktop. */
.phone-fab, .phone-back { display: none; }
@media (max-width: 820px) {
  .phone-fab { display: flex; align-items: center; justify-content: center; position: fixed; left: 16px; bottom: calc(74px + env(safe-area-inset-bottom, 0px)); width: 54px; height: 54px; border-radius: 50%; border: none; z-index: 40; background: var(--accent, #7A5AF8); color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.28); cursor: pointer; }
  .phone-back { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 8px; background: none; border: none; color: var(--accent, #7A5AF8); font-size: 14px; font-weight: 600; cursor: pointer; padding: 0; }
}

/* Ф3 (07-16): insurance/warranty rep badge on the Active Call card. Branded pill;
   real logo when /img/warranty/<slug>.png exists, else a clean name-chip. */
.ins-badge{display:inline-flex;align-items:center;gap:7px;max-width:100%;
  padding:5px 11px 5px 8px;border-radius:999px;font-size:12.5px;font-weight:650;
  color:var(--ins,#5b6b7a);background:color-mix(in srgb,var(--ins,#5b6b7a) 12%,transparent);
  border:1px solid color-mix(in srgb,var(--ins,#5b6b7a) 40%,transparent);line-height:1.15}
.ins-badge .ins-logo{height:18px;width:auto;max-width:66px;border-radius:3px;
  background:#fff;padding:1px 2px;object-fit:contain;display:block}
.ins-badge .ins-txt{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
