/*
 * Page-level components for the refreshed calling, staff, history and plan
 * screens. Split from ui-refresh.css so the shared design tokens and the
 * page-specific rules stay easy to tell apart.
 */

.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* ------------------------------------------------------------ start call */

.pcx-crumbs{display:flex;align-items:center;gap:4px;font-size:12px;color:var(--pcx-ink-soft);
  font-weight:600;margin-bottom:10px}
.pcx-crumbs a:hover{color:var(--red)}
.pcx-crumbs .lucide{width:14px;height:14px}

.pcx-setup-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:20px;align-items:start}
.pcx-setup-form{min-width:0;display:flex;flex-direction:column;gap:0}
.pcx-setup-aside{position:sticky;top:88px;display:flex;flex-direction:column;gap:14px}
.pcx-setup-aside .card{margin-bottom:0}
.pcx-setup-aside>.card>.btn{margin-top:12px;width:100%;justify-content:center}
.pcx-setup-aside p{font-size:13px}
/* Text links at the end of a side card ("Read the policy"); buttons keep their own colours. */
.pcx-setup-aside>.card>a:last-child:not(.btn){font-size:13px;font-weight:700;color:var(--red);
  display:inline-flex;align-items:center;gap:5px;margin-top:6px}
.pcx-setup-aside .lucide{width:16px;height:16px}

.pcx-step-head{display:flex;gap:12px;align-items:flex-start;margin-bottom:14px}
.pcx-step-head>span{width:28px;height:28px;border-radius:9px;background:var(--pink);color:var(--red);
  display:grid;place-items:center;font-weight:800;font-size:13px;flex:0 0 auto}
.pcx-step-head h3{margin:0 0 2px;font-size:15px;letter-spacing:-.2px}
.pcx-step-head p{margin:0;font-size:12px}

.pcx-choice-grid{display:grid;gap:12px}
.pcx-choice-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.pcx-choice-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.pcx-choice{position:relative;display:flex;flex-direction:column;gap:4px;padding:16px 16px 16px 16px;
  border:1.5px solid var(--pcx-line);border-radius:var(--pcx-radius);background:#fff;cursor:pointer}
.pcx-choice:hover{border-color:var(--pcx-line-strong);box-shadow:var(--pcx-shadow-sm)}
.pcx-choice.selected{border-color:var(--red);background:#fffafb;box-shadow:0 0 0 3px rgba(239,10,37,.07)}
.pcx-choice input{position:absolute;opacity:0;width:0;height:0}
.pcx-choice-mark{position:absolute;top:14px;right:14px;width:17px;height:17px;border-radius:50%;
  border:2px solid var(--pcx-line-strong);background:#fff}
.pcx-choice.selected .pcx-choice-mark{border-color:var(--red);box-shadow:inset 0 0 0 3px #fff;background:var(--red)}
.pcx-choice-icon{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;
  background:var(--pcx-canvas);color:var(--pcx-ink-soft);margin-bottom:6px}
.pcx-choice-icon .lucide{width:21px;height:21px}
.pcx-choice-icon.premium{background:var(--pcx-gold-soft);color:#c07a00}
.pcx-choice.selected .pcx-choice-icon{background:var(--pink);color:var(--red)}
.pcx-choice.selected .pcx-choice-icon.premium{background:var(--pcx-gold-soft);color:#c07a00}
.pcx-choice b{font-size:14px}
.pcx-choice small{font-size:12px;color:var(--pcx-ink-soft);line-height:1.45}

.pcx-voice{cursor:default}
.pcx-voice-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;padding-right:26px}
.pcx-voice-head strong{font-size:17px;letter-spacing:-.4px}
.pcx-voice-head strong i{font-size:11px;font-weight:600;font-style:normal;color:var(--pcx-ink-soft)}
.pcx-voice ul{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:5px}
.pcx-voice li{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--pcx-ink-soft)}
.pcx-voice li .lucide{width:14px;height:14px;color:var(--green);flex:0 0 auto}
.pcx-voice-state{margin-top:9px;font-size:11px;font-weight:700;color:var(--green)}
.pcx-voice>a{margin-top:9px;font-size:12px;font-weight:700;color:var(--red);display:inline-flex;align-items:center;gap:5px}
.pcx-voice>a .lucide{width:14px;height:14px}

.pcx-setup-form .form-grid.three{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.pcx-setup-form textarea{min-height:88px;resize:vertical}
.pcx-counter{display:block;text-align:right;font-size:11px;color:var(--pcx-ink-soft);margin-top:4px;
  font-variant-numeric:tabular-nums}
.pcx-counter.near{color:var(--orange);font-weight:700}
.pcx-filter-bar .search{margin-bottom:0}

.pcx-wallet-strip{display:flex;align-items:center;gap:20px;flex-wrap:wrap;background:var(--pcx-canvas);
  border:1px solid var(--pcx-line);border-radius:var(--pcx-radius);padding:14px 16px}
.pcx-wallet-strip>div{min-width:120px}
.pcx-wallet-strip small{display:block;font-size:11px;color:var(--pcx-ink-soft);font-weight:600;margin-bottom:2px}
.pcx-wallet-strip b{font-size:18px;letter-spacing:-.4px}
.pcx-wallet-strip .btn{margin-left:auto;width:auto;min-width:150px}

.pcx-action-bar{position:sticky;bottom:0;display:flex;align-items:center;gap:16px;flex-wrap:wrap;
  background:#fff;border:1px solid var(--pcx-line);border-radius:var(--pcx-radius);padding:14px 16px;
  box-shadow:var(--pcx-shadow-lg);margin-bottom:16px;z-index:9}
.pcx-action-bar p{display:flex;gap:10px;align-items:flex-start;margin:0;flex:1;min-width:220px}
.pcx-action-bar p .lucide{width:20px;height:20px;flex:0 0 auto}
.pcx-action-bar p.ok .lucide{color:var(--green)}
.pcx-action-bar p.warn .lucide{color:var(--orange)}
.pcx-action-bar b{display:block;font-size:14px;color:var(--pcx-ink)}
.pcx-action-bar small{font-size:12px;color:var(--pcx-ink-soft)}
.pcx-action-bar .btn{width:auto;min-width:210px;margin:0}
.pcx-setup-form .consent-inline{margin-bottom:14px;font-size:12px}
@media (max-width:860px){.pcx-action-bar{bottom:64px}}

.pcx-checklist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
.pcx-checklist li{display:flex;gap:10px;align-items:flex-start}
.pcx-checklist li .lucide{width:18px;height:18px;flex:0 0 auto;color:#c3ccdf;margin-top:1px}
.pcx-checklist li.done .lucide{color:var(--green)}
.pcx-checklist b{display:block;font-size:13px}
.pcx-checklist small{font-size:12px;color:var(--pcx-ink-soft);line-height:1.45}
.pcx-note{font-size:12px;color:var(--pcx-ink-soft);margin:12px 0 0;padding-top:12px;
  border-top:1px solid var(--pcx-line)}

/* -------------------------------------------------------------- ai staff */

.pcx-staff-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:20px;align-items:start}
.pcx-staff-main{min-width:0}
.pcx-staff-aside{position:sticky;top:88px;display:flex;flex-direction:column;gap:14px}
.pcx-staff-aside .card{margin-bottom:0}
.pcx-staff-aside .btn{width:100%;margin-top:10px}
.pcx-staff-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(330px,1fr));gap:14px;margin-bottom:16px}
.pcx-staff-card{background:#fff;border:1px solid var(--pcx-line);border-radius:var(--pcx-radius-lg);
  padding:16px;display:flex;flex-direction:column;gap:12px;box-shadow:var(--pcx-shadow-sm)}
.pcx-staff-card:hover{box-shadow:var(--pcx-shadow)}
.pcx-staff-card header{display:flex;align-items:center;gap:11px;flex-wrap:wrap}
.pcx-staff-card header>div{min-width:0;flex:1}
.pcx-staff-card h2{margin:0;font-size:16px;letter-spacing:-.3px}
.pcx-staff-card header p{margin:0;font-size:12px}
.pcx-staff-card .pill{font-size:10px;padding:4px 9px}
.pcx-staff-avatar{width:48px;height:48px;border-radius:50%;overflow:hidden;background:var(--pcx-canvas);
  border:1px solid var(--pcx-line);display:grid;place-items:center;color:var(--pcx-ink-soft);flex:0 0 auto}
.pcx-staff-avatar img{width:100%;height:100%;object-fit:cover}
.pcx-staff-avatar.female{background:#fdeef4}
.pcx-staff-avatar.male{background:#eaf1ff}
.pcx-staff-meta{margin:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;background:var(--pcx-canvas);
  border-radius:var(--pcx-radius);padding:12px}
.pcx-staff-meta dt{display:flex;align-items:center;gap:5px;font-size:11px;color:var(--pcx-ink-soft);
  font-weight:600;margin-bottom:2px}
.pcx-staff-meta dt .lucide{width:13px;height:13px}
.pcx-staff-meta dd{margin:0;font-size:13px;font-weight:700;overflow-wrap:anywhere}
.pcx-staff-meta .premium-text{color:#b97800}
.pcx-staff-toggles{display:flex;gap:18px;flex-wrap:wrap}
.pcx-toggle{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:13px}
.pcx-toggle input{position:absolute;opacity:0;width:0;height:0}
.pcx-toggle input:focus-visible+.pcx-switch{outline:2px solid var(--red);outline-offset:2px}
.pcx-toggle b{font-weight:600;color:var(--pcx-ink-soft)}
.pcx-toggle input:checked~b{color:var(--pcx-ink)}
.pcx-staff-card .btn{width:100%;margin:0}
.pcx-staff-card .button-row{display:flex;gap:8px}
.pcx-staff-card .button-row .btn{flex:1;min-width:0;padding:0 10px}

.pcx-template-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:10px;margin-top:12px}
.pcx-template{display:flex;align-items:center;gap:10px;text-align:left;padding:12px;border-radius:var(--pcx-radius);
  border:1px solid var(--pcx-line);background:var(--pcx-canvas);width:100%}
.pcx-template:hover{background:#fff;border-color:var(--red);box-shadow:var(--pcx-shadow-sm)}
.pcx-template>div{flex:1;min-width:0}
.pcx-template .lucide{width:18px;height:18px;color:var(--red);flex:0 0 auto}
.pcx-template .lucide:last-child{color:var(--pcx-ink-soft);width:15px;height:15px}
.pcx-template b{display:block;font-size:13px}
.pcx-template small{font-size:11px;color:var(--pcx-ink-soft)}

/* ---------------------------------------------------------- call history */

.pcx-live-banner{display:flex;align-items:center;gap:12px;margin-bottom:16px}
.pcx-live-banner .lucide{color:var(--green);flex:0 0 auto}
.pcx-live-banner span{flex:1}
.pcx-live-banner b{display:block}
.pcx-live-banner .btn{width:auto;margin:0;flex:0 0 auto}

.pcx-filter-bar{display:flex;gap:12px;flex-wrap:wrap;align-items:center;margin-bottom:14px}
.pcx-filter-bar .search{flex:1 1 260px;min-width:220px}
.pcx-chips{display:flex;gap:6px;flex-wrap:wrap}
.pcx-chips button,.pcx-chips a{border:1px solid var(--pcx-line);background:#fff;border-radius:999px;padding:7px 14px;
  font-size:12px;font-weight:600;color:var(--pcx-ink-soft);text-decoration:none;white-space:nowrap}
.pcx-chips button:hover,.pcx-chips a:hover{border-color:var(--pcx-line-strong);color:var(--pcx-ink)}
.pcx-chips button.active,.pcx-chips a.active{background:var(--red);border-color:var(--red);color:#fff}

.pcx-history-table td small{display:block;font-size:11px;color:var(--pcx-ink-soft)}
.pcx-history-table td b{font-size:13px}
.pcx-history-table tbody tr.pcx-row{cursor:pointer}
.pcx-row-open{border:0;background:transparent;padding:4px;border-radius:8px;color:inherit;
  display:inline-flex}
.pcx-row-open:hover{background:var(--pcx-canvas);color:var(--red)}
.pcx-col-index{color:var(--pcx-ink-soft);font-size:12px;width:38px}
.pcx-col-go{width:34px;text-align:right;color:#aab4cc}
.pcx-col-go .lucide{width:17px;height:17px}
.pcx-num{font-variant-numeric:tabular-nums;white-space:nowrap}
.pcx-muted{color:var(--pcx-ink-soft)}
.pcx-tag{display:inline-block;font-size:11px;font-weight:700;padding:4px 10px;border-radius:999px;
  background:var(--pcx-canvas);color:var(--pcx-ink-soft);white-space:nowrap}
.pcx-tag.pcx-ch-whatsapp{background:#e7f8ee;color:#0f8f47}
.pcx-tag.pcx-ch-promochat{background:#eef0ff;color:#4f4fd0}
.pcx-tag.pcx-ch-phone{background:#e9f1ff;color:#0a6ad8}
.pcx-dir{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:600;white-space:nowrap}
.pcx-dir .lucide{width:14px;height:14px}
.pcx-dir.incoming .lucide{color:var(--green)}
.pcx-dir.outgoing .lucide{color:var(--red)}
.pcx-dir.missed{color:var(--red)}
.pcx-empty-row td{padding:0!important;background:#fff}
.pcx-result-note{font-size:12px;color:var(--pcx-ink-soft);margin:12px 0 0;text-align:center}

/* ---------------------------------------------------------------- plans */

.pcx-plan-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px;margin-bottom:16px;
  align-items:stretch}
.pcx-plan{position:relative;background:#fff;border:1px solid var(--pcx-line);border-radius:var(--pcx-radius-lg);
  padding:20px;display:flex;flex-direction:column;gap:12px;box-shadow:var(--pcx-shadow-sm)}
.pcx-plan:hover{box-shadow:var(--pcx-shadow)}
.pcx-plan.featured{border:1.5px solid var(--red);box-shadow:0 10px 28px rgba(228,0,29,.10)}
.pcx-plan.current{border-color:var(--green)}
.pcx-plan-flag{position:absolute;top:-11px;left:50%;transform:translateX(-50%);background:var(--red);color:#fff;
  font-size:10px;font-weight:800;letter-spacing:.7px;padding:5px 12px;border-radius:999px;white-space:nowrap}
.pcx-plan header{display:flex;align-items:center;gap:10px}
.pcx-plan header h3{margin:0;font-size:17px;letter-spacing:-.3px}
.pcx-plan header small{font-size:11px;color:var(--green);font-weight:700}
.pcx-plan-icon{width:40px;height:40px;border-radius:12px;background:var(--pink);color:var(--red);
  display:grid;place-items:center;flex:0 0 auto}
.pcx-plan-icon.gold{background:var(--pcx-gold-soft);color:#c07a00}
.pcx-plan-icon .lucide{width:20px;height:20px}
.pcx-plan-price{margin:0;font-size:30px;font-weight:800;letter-spacing:-1.2px;color:var(--pcx-ink);line-height:1.1}
.pcx-plan-price small{display:block;font-size:11px;font-weight:600;color:var(--pcx-ink-soft);letter-spacing:0}
.pcx-plan ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:9px;flex:1}
.pcx-plan li{display:flex;align-items:flex-start;gap:8px;font-size:13px;color:var(--pcx-ink)}
.pcx-plan li .lucide{width:15px;height:15px;color:var(--green);flex:0 0 auto;margin-top:2px}
.pcx-plan .btn{width:100%;margin:0}
.pcx-plan footer{font-size:11px;color:var(--pcx-ink-soft);text-align:center}

.pcx-plan-steps{display:flex;align-items:center;gap:20px;flex-wrap:wrap}
.pcx-plan-steps>div{flex:1;min-width:220px}
.pcx-plan-steps b{display:block;font-size:14px}
.pcx-plan-steps small{font-size:12px;color:var(--pcx-ink-soft)}
.pcx-plan-steps ol{list-style:none;margin:0;padding:0;display:flex;gap:8px;flex-wrap:wrap}
.pcx-plan-steps li{display:flex;align-items:center;gap:7px;font-size:12px;font-weight:600;
  background:var(--pcx-canvas);border-radius:999px;padding:7px 14px 7px 7px}
.pcx-plan-steps li span{width:22px;height:22px;border-radius:50%;background:var(--red);color:#fff;
  display:grid;place-items:center;font-size:11px;font-weight:800}
.pcx-plan-steps .btn{width:auto;margin:0}

/* ------------------------------------------------------------ responsive */

@media (max-width:1180px){
  .pcx-setup-layout,.pcx-staff-layout{grid-template-columns:minmax(0,1fr)}
  .pcx-setup-aside,.pcx-staff-aside{position:static;flex-direction:row;flex-wrap:wrap}
  .pcx-setup-aside>*,.pcx-staff-aside>*{flex:1 1 280px}
}
@media (max-width:860px){
  .pcx-setup-form .form-grid.three,.pcx-choice-grid.three{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:640px){
  .pcx-choice-grid.two,.pcx-choice-grid.three,
  .pcx-setup-form .form-grid.three,.pcx-staff-meta{grid-template-columns:minmax(0,1fr)}
  .pcx-setup-aside,.pcx-staff-aside{flex-direction:column}
  .pcx-action-bar .btn,.pcx-wallet-strip .btn{width:100%;margin-left:0}
  .pcx-plan-steps{flex-direction:column;align-items:stretch}
  .pcx-plan-steps .btn{width:100%}
  /* The history table keeps its most useful columns on a phone. */
  .pcx-history-table th:nth-child(1),.pcx-history-table td:nth-child(1),
  .pcx-history-table th:nth-child(6),.pcx-history-table td:nth-child(6),
  .pcx-history-table th:nth-child(5),.pcx-history-table td:nth-child(5){display:none}
}

/* AI Staff add/edit dialog: header and footer stay fixed, the body scrolls. */
.workspace-action-dialog.staff-dialog{width:min(94vw,760px);max-height:min(90vh,860px);overflow:hidden}
.staff-dialog form{display:flex;flex-direction:column;max-height:min(90vh,860px);padding:0}
.staff-dialog .sf-head{padding:24px 28px 14px;border-bottom:1px solid #edf1f7}
.staff-dialog .sf-head h2{margin:0;font-size:22px}.staff-dialog .sf-head p{margin:4px 0 0;font-size:14px}
.staff-dialog .dialog-close{top:18px;right:18px;z-index:2}
.sf-tabs{display:flex;gap:6px;padding:12px 28px 0;border-bottom:1px solid #edf1f7;overflow-x:auto}
.sf-tabs button{display:flex;align-items:center;gap:8px;border:0;background:none;padding:10px 14px;font:inherit;font-size:14px;font-weight:650;color:#56658a;border-bottom:3px solid transparent;cursor:pointer;white-space:nowrap}
.sf-tabs button svg{width:17px;height:17px}.sf-tabs button.active{color:#f11535;border-bottom-color:#f11535}
.sf-body{flex:1;overflow-y:auto;padding:20px 28px;display:flex;flex-direction:column;gap:22px}
.sf-body>[data-sf-panel]{display:flex;flex-direction:column;gap:22px}.sf-body>[data-sf-panel][hidden]{display:none}
.sf-group h3{margin:0 0 4px;font-size:15px;color:#0c1942}.sf-group>p{margin:0 0 12px;font-size:13px;color:#6b7a99}
.sf-group>h3+.sf-cards,.sf-group>h3+.sf-toggles,.sf-group>h3+.sf-grid{margin-top:10px}
.sf-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 16px}
.sf-field{display:flex;flex-direction:column;gap:6px;min-width:0}.sf-field.wide{grid-column:1/-1}
.sf-field>span{font-size:13px;font-weight:650;color:#3f5079}.sf-field em{color:#f11535;font-style:normal}
.sf-field input,.sf-field select,.sf-field textarea{width:100%;min-height:42px;border:1px solid #d6deea;border-radius:9px;padding:9px 12px;font:inherit;font-size:14px;color:#0c1942;background:#fff;box-shadow:none;outline:0}
.sf-field textarea{min-height:84px;resize:vertical;line-height:1.5}
.sf-field input:focus,.sf-field select:focus,.sf-field textarea:focus{border-color:#0a6bec;box-shadow:0 0 0 3px rgba(10,107,236,.12)}
.sf-field input:invalid:not(:placeholder-shown){border-color:#f11535}
.sf-field small{font-size:12px;color:#7b88a4}
.sf-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.sf-card{position:relative;display:flex;flex-direction:column;gap:6px;padding:14px;border:1.5px solid #e1e7f0;border-radius:12px;cursor:pointer;background:#fff;transition:border-color .15s,box-shadow .15s,background .15s}
.sf-card:hover{border-color:#b9c6da}
.sf-card input{position:absolute;opacity:0;pointer-events:none}
.sf-card:has(input:checked){border-color:#f11535;background:#fff6f7;box-shadow:0 0 0 3px rgba(241,21,53,.1)}
.sf-card:has(input:focus-visible){outline:2px solid #0a6bec;outline-offset:2px}
.sf-card-icon{width:34px;height:34px;border-radius:9px;display:grid;place-items:center;background:#eef4ff;color:#0a6bec}.sf-card-icon svg{width:18px;height:18px}
.sf-card:has(input:checked) .sf-card-icon{background:#ffe3e8;color:#f11535}
.sf-card b{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:14px;color:#0c1942}
.sf-card b em{font-style:normal;font-size:11px;font-weight:700;padding:2px 8px;border-radius:20px;background:#e8fbf2;color:#0b8a50}
.sf-card small{font-size:12px;line-height:1.45;color:#63728f}
.sf-note{display:flex;gap:10px;align-items:flex-start;margin-top:12px;padding:12px 14px;border-radius:10px;background:#f2f7ff;color:#35507f;font-size:13px;line-height:1.5}.sf-note svg{width:17px;height:17px;flex:0 0 auto;margin-top:2px;color:#0a6bec}
.sf-toggles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.sf-toggle{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid #e3e9f2;border-radius:11px;cursor:pointer;background:#fff}
.sf-toggle input{position:absolute;opacity:0;pointer-events:none}
.sf-toggle i{position:relative;flex:0 0 auto;width:40px;height:23px;border-radius:20px;background:#cfd7e4;transition:background .15s}
.sf-toggle i:after{content:"";position:absolute;top:3px;left:3px;width:17px;height:17px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.2);transition:transform .15s}
.sf-toggle input:checked+i{background:#12a86b}.sf-toggle input:checked+i:after{transform:translateX(17px)}
.sf-toggle input:focus-visible+i{outline:2px solid #0a6bec;outline-offset:2px}
.sf-toggle span{display:flex;flex-direction:column;min-width:0}.sf-toggle b{font-size:14px;color:#0c1942}.sf-toggle small{font-size:12px;color:#7b88a4}
.staff-dialog .sf-actions{margin:0;padding:14px 28px;border-top:1px solid #edf1f7;background:#fbfcfe}
.staff-dialog .sf-actions .btn{min-width:130px}
@media(max-width:640px){.sf-head,.sf-body,.staff-dialog .sf-actions{padding-left:18px;padding-right:18px}.sf-tabs{padding:10px 12px 0}.sf-grid,.sf-toggles,.sf-cards{grid-template-columns:1fr}.staff-dialog .sf-actions .btn{flex:1;min-width:0}}
.pcx-staff-card .button-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.pcx-staff-card .button-row .btn{min-height:42px;white-space:nowrap;justify-content:center;gap:7px}
.pcx-staff-card .button-row .btn svg{width:17px;height:17px}
.staff-dialog form:has(.sf-tabs){height:min(90vh,760px)}
.sf-cards+.sf-grid{margin-top:14px}

/* Headings never break mid-word: the description beside them wraps to the next line instead. */
.section-title{flex-wrap:wrap}
.section-title>h1,.section-title>h2,.section-title>h3{flex-shrink:0;max-width:100%}
.pcx-rate-card header,.pcx-control header{flex-wrap:wrap;row-gap:6px}
.pcx-rate-card h3,.pcx-control h3{white-space:nowrap}
.pcx-rate-card header>.pill,.pcx-control header>.pill{margin-left:auto}
.pcx-rate-tier{white-space:nowrap}
/* Customer history */
.timeline-picker{max-width:420px;margin:0 0 14px}
.timeline-item>.pill{justify-self:start}
.timeline-item h3{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.timeline-item .button-row .btn{min-height:36px;padding:0 12px}
.mobile-timeline-customer .profile{display:flex;align-items:center;gap:14px}
@media(max-width:640px){.mobile-timeline-customer .avatar.large{width:56px;height:56px;font-size:20px}.mobile-timeline-customer .profile>div{text-align:left}}
.pcx-rate-card header>div{min-width:max-content}
/* Link-based filter chips (server-side filters) look like the button chips. */
.tabs>a{display:inline-flex;align-items:center;padding:11px 20px;background:var(--soft);border-radius:8px;font-weight:600;color:inherit;white-space:nowrap;text-decoration:none}
.tabs>a.active{background:var(--red);color:#fff}
.list-pager{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:10px;margin-top:14px;padding-top:12px;border-top:1px solid var(--line)}
.list-pager>span:nth-child(2){font-size:13px;color:var(--muted);text-align:center}
.list-pager>a:last-child{justify-self:end}.list-pager .btn{min-height:38px;gap:6px}
@media(max-width:640px){.list-pager{grid-template-columns:1fr 1fr}.list-pager>span:nth-child(2){grid-column:1/-1;grid-row:1}}
/* Forgot / reset password */
.auth-forgot{margin:-4px 0 12px;text-align:right}
.auth-forgot button{border:0;background:none;padding:2px 0;color:var(--red);font-weight:600;font-size:13px;cursor:pointer}
.auth-forgot button:hover{text-decoration:underline}
.auth-success{background:#ecfbf4;border:1px solid #bfe9d3;color:#0b6b43;border-radius:10px;padding:14px 16px;font-weight:600;font-size:14px;line-height:1.5}
.sf-card .sf-price{margin-top:auto;padding-top:6px;font-size:13px;font-weight:700;color:#0c1942}
.sf-card:has(input:checked) .sf-price{color:#c8102e}
/* Browser push offer */
.push-offer{position:fixed;right:20px;bottom:20px;z-index:60;display:flex;gap:12px;align-items:flex-start;max-width:360px;padding:16px;border-radius:14px;background:#fff;border:1px solid #e3e9f2;box-shadow:0 18px 40px rgba(12,25,66,.18)}
.push-offer-icon{font-size:24px;line-height:1}
.push-offer b{font-size:15px;color:#0c1942}.push-offer p{margin:4px 0 10px;font-size:13px;color:#51607f;line-height:1.45}
.push-offer-actions{display:flex;gap:8px}.push-offer-actions .btn{min-height:36px;padding:0 14px;font-size:13px}
@media(max-width:860px){.push-offer{left:12px;right:12px;bottom:84px;max-width:none}}
/* Admin / staff portal sign-in */
.portal-body .desktop-nav,.portal-body .top-actions{display:none}
.portal-login{min-height:calc(100vh - 160px);display:grid;place-items:center;padding:32px 16px}
.portal-card{width:min(100%,440px);padding:32px!important}
.portal-card h2{margin:14px 0 6px;font-size:26px}.portal-card>p{margin:0 0 20px;color:#5b6a8c}
.portal-badge{display:inline-flex;align-items:center;gap:8px;padding:6px 12px;border-radius:999px;background:#0c1942;color:#fff;font-size:12px;font-weight:700;letter-spacing:.02em}
.portal-badge svg{width:15px;height:15px}
.portal-card .auth-forgot a{color:var(--red);font-weight:600;font-size:13px}
.portal-note{display:flex;gap:8px;align-items:flex-start;margin:20px 0 0;padding-top:16px;border-top:1px solid #edf1f7;font-size:13px;color:#5b6a8c;line-height:1.5}
.portal-note svg{width:16px;height:16px;flex:0 0 auto;margin-top:2px}.portal-note a{color:var(--red);font-weight:600}
.auth-card .form-grid{align-items:end}

/* ------------------------------------------------------ calls sub-navigation */
.pcx-subnav{display:flex;gap:4px;margin:-4px 0 18px;padding:4px;background:var(--pcx-canvas);
  border:1px solid var(--pcx-line);border-radius:12px;overflow-x:auto;scrollbar-width:none;width:max-content;max-width:100%}
.pcx-subnav::-webkit-scrollbar{display:none}
.pcx-subnav a{display:inline-flex;align-items:center;gap:7px;padding:8px 14px;border-radius:9px;font-size:13px;
  font-weight:600;color:var(--pcx-ink-soft);white-space:nowrap;text-decoration:none}
.pcx-subnav a:hover{color:var(--pcx-ink);background:#fff}
.pcx-subnav a.active{background:#fff;color:var(--red);box-shadow:0 1px 3px rgba(12,25,66,.1)}
.pcx-subnav .lucide{width:16px;height:16px}
.pcx-subnav-live{font-style:normal;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--green);
  color:#fff;font-size:11px;font-weight:700;display:inline-grid;place-items:center}
@media(max-width:640px){.pcx-subnav{width:auto;margin-left:-2px;margin-right:-2px}.pcx-subnav a{padding:8px 11px}}

/* ------------------------------------------------------- start call polish */
.pcx-choice.is-disabled{cursor:not-allowed;background:var(--pcx-canvas);border-style:dashed}
.pcx-choice.is-disabled:hover{border-color:var(--pcx-line);box-shadow:none}
.pcx-choice.is-disabled b{color:var(--pcx-ink-soft)}
.pcx-choice.is-disabled .pcx-choice-mark{opacity:.45}
.pcx-action-bar .consent-inline{flex:1 1 100%;display:flex;align-items:flex-start;gap:9px;margin:0 0 2px;
  padding:0 0 12px;border-bottom:1px solid var(--pcx-line);font-size:13px;color:var(--pcx-ink);cursor:pointer}
.pcx-action-bar .consent-inline input{width:18px;height:18px;margin:1px 0 0;flex:0 0 auto;accent-color:var(--red)}
.pcx-action-bar .consent-inline a{color:var(--red);font-weight:700;white-space:nowrap}
.pcx-action-bar p.pending .lucide{color:var(--orange)}
.pcx-setup-aside .section-title{margin-bottom:12px}
.pcx-setup-aside .info-box{display:flex;gap:9px;align-items:flex-start;padding:12px;border-radius:12px;
  background:var(--pcx-canvas);font-size:12.5px;line-height:1.5;color:var(--pcx-ink)}
.pcx-setup-aside .info-box .lucide{flex:0 0 auto;margin-top:2px;color:var(--green)}

/* ------------------------------------------------------- empty states */
.pcx-empty-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin-top:6px}
.pcx-empty-actions .btn{width:auto;min-width:170px}

/* ------------------------------------------------------- live call */
.call-runtime-panel .live-owner-title{margin:20px 0 10px;font-size:15px}
.live-owner-actions .live-end{margin-left:auto;min-width:140px}
@media(max-width:640px){.live-owner-actions .live-end{margin-left:0;width:100%}}

/* ------------------------------------------------------- customer history */
.pcx-customer{display:flex;align-items:center;gap:18px 28px;flex-wrap:wrap}
.pcx-customer-id{display:flex;align-items:center;gap:14px;min-width:220px}
.pcx-customer-id h2{margin:0 0 2px;font-size:20px}
.pcx-customer-id p{margin:0 0 6px;font-size:13px}
.pcx-customer-facts{display:grid;grid-template-columns:repeat(4,minmax(90px,auto));gap:10px 26px;
  padding-left:28px;border-left:1px solid var(--pcx-line)}
.pcx-customer-facts small{display:block;font-size:11px;font-weight:600;color:var(--pcx-ink-soft);margin-bottom:2px}
.pcx-customer-facts b{font-size:16px;letter-spacing:-.3px;white-space:nowrap}
.pcx-customer-actions{display:flex;gap:8px;margin-left:auto}
.pcx-customer-actions .btn{width:auto;min-width:120px;margin:0}
@media(max-width:1100px){.pcx-customer-facts{padding-left:0;border-left:0;order:3;flex:1 1 100%}.pcx-customer-actions{margin-left:auto}}
@media(max-width:640px){.pcx-customer-facts{grid-template-columns:repeat(2,minmax(0,1fr))}
  .pcx-customer-actions{flex:1 1 100%}.pcx-customer-actions .btn{flex:1;min-width:0}}
.pcx-customer .avatar.large{width:64px;height:64px;font-size:22px;flex:0 0 auto}

/* Customer summary on a phone: facts first, then the call buttons. */
@media(max-width:640px){.pcx-customer-facts{order:2}.pcx-customer-actions{order:3}}

/* Call history on a phone: two stats per row, and each call as a compact card instead of a clipped table. */
@media(max-width:720px){
  .pcx-stat-strip{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .pcx-stat{padding:12px;gap:10px}
  .pcx-stat .iconbox{width:36px;height:36px;border-radius:11px}
  .pcx-stat b{font-size:16px}
}
@media(max-width:640px){
  .pcx-history-table{overflow:visible;border:0}
  .pcx-history-table table,.pcx-history-table tbody{display:block;width:100%;min-width:0}
  .pcx-history-table thead{display:none}
  .pcx-history-table tr.pcx-row{display:grid;grid-template-columns:minmax(0,1fr) auto 26px;
    grid-template-areas:"contact charge go" "date status go" "channel duration go";gap:6px 12px;align-items:center;
    padding:12px 2px;border-bottom:1px solid var(--pcx-line)}
  .pcx-history-table tr.pcx-row:last-child{border-bottom:0}
  .pcx-history-table tr.pcx-row td{display:block;padding:0;border:0;min-width:0}
  .pcx-history-table td:nth-child(2){grid-area:date}.pcx-history-table td:nth-child(2) b,.pcx-history-table td:nth-child(2) small{display:inline;font-size:12px;font-weight:500;color:var(--pcx-ink-soft)}
  .pcx-history-table td:nth-child(2) small{margin-left:6px}
  .pcx-history-table td:nth-child(3){grid-area:contact}.pcx-history-table td:nth-child(3) b{font-size:14px}
  .pcx-history-table td:nth-child(4){grid-area:channel}
  .pcx-history-table td:nth-child(7){grid-area:duration;text-align:right;font-size:12px;color:var(--pcx-ink-soft)}
  .pcx-history-table td:nth-child(8){grid-area:charge;text-align:right}
  .pcx-history-table td:nth-child(9){grid-area:status;text-align:right}
  .pcx-history-table td:nth-child(10){grid-area:go}
  .pcx-history-table tr.pcx-empty-row,.pcx-history-table tr.pcx-empty-row td{display:block}
}
@media(max-width:640px){
  .pcx-history-table tr.pcx-row td:nth-child(1),.pcx-history-table tr.pcx-row td:nth-child(5),
  .pcx-history-table tr.pcx-row td:nth-child(6){display:none}
  /* Choice cards turn into compact rows: icon on the left, text beside it. */
  .pcx-choice:not(.pcx-voice){display:grid;grid-template-columns:40px minmax(0,1fr);column-gap:12px;row-gap:1px;
    align-items:center;padding:12px 40px 12px 12px}
  .pcx-choice:not(.pcx-voice) .pcx-choice-icon{grid-row:span 2;margin:0;width:40px;height:40px;border-radius:12px}
  .pcx-choice:not(.pcx-voice) .pcx-choice-mark{top:50%;margin-top:-8px}
  .pcx-choice-grid{gap:10px}
}
@media(max-width:640px){.pcx-action-bar{position:static;box-shadow:var(--pcx-shadow-sm)}}

/* ------------------------------------------------ Campaigns › results */
a.ref-campaign-row{color:inherit;text-decoration:none;grid-template-columns:42px 1fr auto auto 18px}
a.ref-campaign-row:hover h3{color:var(--red)}
.ref-campaign-item{display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--line)}
.ref-campaign-item>a.ref-campaign-row{flex:1;min-width:0;border-bottom:0}
.ref-campaign-del{flex:0 0 auto;width:36px;height:36px;border-radius:10px;border:1px solid var(--line);background:#fff;color:#8a93a8;display:grid;place-items:center;cursor:pointer}
.ref-campaign-del:hover{color:var(--red);border-color:#f3b8c1;background:#fff5f6}
.ref-campaign-del svg{width:16px;height:16px}
a.ref-campaign-row>.lucide{width:18px;height:18px;color:#aab4cc}
.cr-back{margin:0 0 6px}
.cr-back a{display:inline-flex;align-items:center;gap:6px;color:var(--pcx-ink-soft,#61719c);font-weight:600;text-decoration:none}
.cr-back a .lucide{width:16px;height:16px}
.cr-control{display:inline-flex;margin:0}
.pcx-page-head-actions .pill{align-self:center}
.cr-progress{display:grid;grid-template-columns:minmax(180px,auto) 1fr;gap:18px;align-items:center;padding:16px 18px;margin-bottom:14px}
.cr-progress b{display:block;font-size:15px}
.cr-progress small{color:var(--pcx-ink-soft,#61719c)}
.cr-stats .pcx-stat small+b+small{margin-top:2px}
.cr-table table{width:100%;border-collapse:collapse}
.cr-table th{text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.4px;color:var(--pcx-ink-soft,#61719c);padding:10px 12px;border-bottom:1px solid var(--line)}
.cr-table td{padding:12px;border-bottom:1px solid var(--line);vertical-align:top;font-size:13px}
.cr-table td b{display:block}
.cr-table td b a{color:inherit}
.cr-table td small{display:block;font-size:11px;color:var(--pcx-ink-soft,#61719c);margin-top:2px}
.cr-table .pcx-num{text-align:right;white-space:nowrap}
.cr-table td.cr-details{max-width:460px;white-space:normal}
.cr-details p{margin:0 0 3px;line-height:1.45}
.cr-when{white-space:nowrap;color:var(--pcx-ink-soft,#61719c)}
.cr-more{padding:10px 14px;margin:0}
@media (max-width:760px){
  .cr-progress{grid-template-columns:1fr;gap:10px}
  /* .table-wrap tbody td (ui-refresh.css) is more specific than .cr-table td, so the card layout names both. */
  .table-wrap.cr-table{overflow:visible;border:0}
  .table-wrap.cr-table thead{display:none}
  .table-wrap.cr-table table,.table-wrap.cr-table tbody{display:block;min-width:0}
  .table-wrap.cr-table tbody tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 12px;padding:12px 2px;border-bottom:1px solid var(--line)}
  .table-wrap.cr-table tbody td{display:block;padding:0;border:0;min-width:0;white-space:normal}
  .table-wrap.cr-table tbody td.cr-details{grid-column:1/-1;max-width:none}
  .table-wrap.cr-table tbody td[data-label="Talk"],.table-wrap.cr-table tbody td[data-label="Cost"],.table-wrap.cr-table tbody td.cr-when{font-size:12px;text-align:left;color:var(--pcx-ink-soft,#61719c)}
  .table-wrap.cr-table tbody td[data-label="Talk"]::before,.table-wrap.cr-table tbody td[data-label="Cost"]::before{content:attr(data-label) ": "}
  .table-wrap.cr-table tbody tr.cr-empty{display:block}
}
.ref-campaign-form>label.field{display:block;margin:14px 0}
.auth-sent-to{margin:8px 0 0;color:#667085;font-size:14px}.auth-sent-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}

/* Dashboard › Getting started. */.ref-getting-started-card{margin:16px 0}.ref-getting-started-card .section-title{align-items:center;gap:16px}.ref-getting-started-card .section-title>div:first-child{flex:1}.ref-getting-started-card .section-title>div:last-child{width:180px}.ref-getting-started li{align-items:center;padding:6px 0}.ref-getting-started li>div{flex:1}.ref-getting-started li.done b{color:#60719e;text-decoration:line-through}.ref-getting-started li>svg{width:20px;flex:none;color:#b6c0d8}.ref-getting-started li.done>svg{color:#13a460}

.cr-estimate{margin:12px 0}.cr-estimate.warn{border-color:#f3c27a;background:#fff8ec;color:#6b4300}

/* Start Call: who-and-how in two columns (contact, number / AI staff, language), and the AI engine line. */
.pcx-setup-form .pcx-who-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.pcx-setup-form .pcx-who-grid label.field small[data-staff-language]{display:block;margin-top:6px;color:var(--muted)!important;font-weight:500;font-size:12px;line-height:1.4}
.pcx-setup-form .pcx-engine-line{display:flex;align-items:center;gap:10px;margin-bottom:14px}
.pcx-setup-form .pcx-engine-line small{color:var(--muted)}
.pcx-action-bar .pcx-staff-warn{display:flex;gap:8px;align-items:flex-start;color:#b45309;font-size:13px;margin:0}
.pcx-action-bar .pcx-staff-warn[hidden]{display:none}
@media (max-width:720px){.pcx-setup-form .pcx-who-grid{grid-template-columns:1fr}}

/* Wallet ledger: money out is red, money in green. */
.ledger-row strong.debit{color:var(--red)}
/* Batch list: the status pill keeps its own column so the arrow never covers it. */
.ref-campaign-item .ref-campaign-row{grid-template-columns:42px minmax(0,1fr) auto auto 18px}
.ref-campaign-item .ref-campaign-row>.pill{white-space:nowrap;justify-self:end}
@media(max-width:760px){.ref-campaign-item .ref-campaign-row{grid-template-columns:38px minmax(0,1fr) auto 18px}}
