.topbar-logout{min-height:34px;padding:0 11px;border:1px solid #d8dfda;border-radius:9px;background:#fff;color:#506057;font-size:12px;font-weight:650}
.topbar-logout:hover{background:#f3f7f4;border-color:#bfcac2}
.topbar-left{display:flex;align-items:center;gap:10px;min-width:0}
.nav-toggle{display:none;width:38px;height:38px;align-items:center;justify-content:center;border:1px solid #d8dfda;border-radius:10px;background:#fff;color:#35463d}
.nav-toggle svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.nav-icon{width:19px;height:19px;flex:0 0 auto;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.nav-overlay{display:none}
@media(max-width:760px){
  .sidebar{position:fixed;inset:0 auto 0 0;width:min(290px,86vw);height:100dvh;min-height:0;padding:20px 14px 14px;flex-direction:column;align-items:stretch;gap:0;transform:translateX(-105%);transition:transform .2s ease;box-shadow:12px 0 32px rgba(6,33,28,.18)}
  .sidebar.open{transform:translateX(0)}
  .brand-lockup{height:39px;margin:0 0 22px;padding:0 8px}
  .brand-lockup img{width:174px;height:36px}
  .workspace-switch{display:grid}
  .nav-label{display:block;margin:27px 9px 8px}
  .side-nav{display:grid}
  .sidebar-bottom{display:block;margin-top:auto}
  .workspace{min-height:100vh}
  .nav-toggle{display:inline-flex;flex:0 0 auto}
  .nav-overlay:not(.hidden){display:block;position:fixed;inset:0;z-index:4;border:0;background:rgba(3,17,14,.42)}
}
@media(max-width:450px){.topbar-left{gap:7px}.nav-toggle{width:36px;height:36px}}
@media(prefers-reduced-motion:reduce){.sidebar{transition:none}}
@media(max-width:450px){
  .topbar-right{gap:9px}
  .sync-status{display:none}
  .dial-input-row{display:grid;grid-template-columns:23px minmax(0,1fr);height:auto;gap:4px;padding:6px}
  .dial-input-row .phone-prefix{grid-column:1;grid-row:1}
  .dial-input-row input{grid-column:2;grid-row:1;width:100%;min-width:0;height:38px}
  .dial-input-row .button{grid-column:1/-1;grid-row:auto;width:100%;height:40px}
}

/* Touch targets follow the 44px mobile control token in the official UI kit. */
@media(max-width:760px){
  :root{--touch-min:44px}
  .nav-toggle{width:var(--touch-min);height:var(--touch-min)}
  .topbar-logout{min-height:var(--touch-min)}
  .button{min-height:var(--touch-min)}
  .add-device{min-height:var(--touch-min)}
  .session-select-row{height:var(--touch-min)}
  .session-select-row select{height:var(--touch-min)}
  .dial-input-row{min-height:56px}
  .dial-input-row input{height:44px}
}
@media(max-width:450px){
  .nav-toggle{width:var(--touch-min);height:var(--touch-min)}
  .add-device{width:var(--touch-min);min-width:var(--touch-min);height:var(--touch-min);padding:0}
  .dial-input-row .button{min-height:var(--touch-min);height:var(--touch-min)}
}

/* Simplified dialer: one clear question, two big buttons. */
.eyebrow,.panel-kicker,.phone-prefix,.environment,.topbar-divider,.secure-badge,.service-status{display:none}
.dial-input-row{height:auto;flex-wrap:wrap;padding:10px;gap:10px}
.dial-input-row input{flex:1 1 100%;grid-column:1/-1;height:54px;font-size:20px;padding:0 8px}
.dial-input-row .button{flex:1 1 calc(50% - 6px);grid-column:auto;min-height:54px;height:54px;font-size:16px;font-weight:700;justify-content:center}
.dial-panel label{font-size:15px;font-weight:650}
.dial-panel .field-hint{font-size:14px}
@media (max-width:560px){.dial-input-row .button{flex:1 1 100%}}

/* ===== Dialer: only the dialer. One calm card, nothing else. ===== */
body:not(.embedded-dialer){background:linear-gradient(180deg,#eaf1ea 0,#dde7de 100%)}
body:not(.embedded-dialer) .app-shell{display:block;min-height:100vh}
body:not(.embedded-dialer) .sidebar,body:not(.embedded-dialer) .topbar,body:not(.embedded-dialer) .page-header,
body:not(.embedded-dialer) .session-panel,body:not(.embedded-dialer) #history,body:not(.embedded-dialer) .page-footer,
body:not(.embedded-dialer) .nav-overlay,body:not(.embedded-dialer) .audio-note,body:not(.embedded-dialer) details.diagnostics,
body:not(.embedded-dialer) .call-symbol{display:none!important}
body:not(.embedded-dialer) .workspace{min-height:100vh;margin:0;display:grid;place-items:center;padding:24px 16px}
body:not(.embedded-dialer) .page-container{width:min(100%,460px);margin:0;padding:0}
body:not(.embedded-dialer) .call-layout{display:block}
body:not(.embedded-dialer) .dial-panel{padding:32px 28px;border:0;border-radius:28px;background:#fff;box-shadow:0 2px 4px #06211c0d,0 24px 60px #06211c1f}
body:not(.embedded-dialer) .dial-panel .panel-heading{justify-content:center;text-align:center;margin-bottom:18px}
body:not(.embedded-dialer) .dial-panel .panel-heading h2{font-size:28px;line-height:1.15;letter-spacing:-.03em;margin:0}
body:not(.embedded-dialer) .dial-form{margin-top:0}
body:not(.embedded-dialer) .dial-input-row{border:2px solid #d3dcd5;border-radius:16px;background:#fbfcfb}
body:not(.embedded-dialer) .dial-input-row:focus-within{border-color:#00b93f;box-shadow:0 0 0 4px rgba(0,216,74,.16)}
body:not(.embedded-dialer) .dial-input-row input{text-align:center;font-size:24px;font-weight:600;letter-spacing:.01em}
body:not(.embedded-dialer) .dial-input-row .button{border-radius:14px}
body:not(.embedded-dialer) .field-hint{text-align:center;font-size:14px;color:#6a786f;margin:10px 0 0}
body:not(.embedded-dialer) .no-whatsapp-hint{margin:14px 0 0;padding:12px 14px;border-radius:12px;background:#fff7e6;color:#7a5200;font-size:15px;text-align:center}
body:not(.embedded-dialer) .no-whatsapp-hint a{color:#0a7132;font-weight:700}
body:not(.embedded-dialer) .call-status{justify-content:center;margin-top:18px;border:0;background:#f2f6f2;border-radius:14px;font-size:16px}
body:not(.embedded-dialer) #message{width:min(100%,460px);margin:14px auto 0;text-align:center}
.embedded-dialer .no-whatsapp-hint{display:none}
.call-status.idle{display:none!important}
body:not(.embedded-dialer) .page-container{width:min(100%,520px)}
body:not(.embedded-dialer) #message{width:min(100%,520px)}
[hidden]{display:none!important}

/* ===== Call surface (standalone and embedded): a quiet phone, no technical noise ===== */
.call-symbol,.audio-note,details.diagnostics,.environment,.secure-badge{display:none!important}
.embedded-dialer .dial-panel .panel-heading{display:none}
.dial-panel{display:flex;flex-direction:column}
.dial-panel>*{order:5}
.dial-panel .panel-heading{order:0}
.dial-form{order:1!important}
.call-status{order:2!important}
.incoming-actions{order:3!important}
#video-panel{order:4!important}
.dial-panel>.audio-controls{order:6!important}
.dial-panel label[for="destination"]{font-size:14px;font-weight:600;color:#55645b;margin:0 0 8px}
.embedded-dialer{background:#f4f7f4}
.embedded-dialer .dial-panel{max-width:520px;margin:0 auto;padding:8px 4px;background:transparent;border:0;box-shadow:none}
.embedded-dialer .page-container{max-width:560px;padding:12px}

/* Idle: number + two actions */
.dial-input-row{padding:12px;border-radius:18px}
.dial-input-row .button{border-radius:14px;min-height:54px}

/* In a call: status first, big video, controls, then the red hang-up button */
.dial-panel:has(#hangup:not(.hidden)) :is(label[for="destination"],#destination,.field-hint,#dial,#dial-video,.no-whatsapp-hint){display:none!important}
.dial-panel:has(#hangup:not(.hidden)) .dial-form{order:9!important;margin-top:14px}
.dial-panel:has(#hangup:not(.hidden)) .dial-input-row{padding:0;border:0;background:transparent;box-shadow:none}
#hangup{width:100%;flex:1 1 100%;min-height:58px;border:0;border-radius:16px;background:#d92d20;color:#fff;font-size:17px;font-weight:700;justify-content:center}
#hangup:hover{background:#b92317}
#hangup svg{stroke:#fff}
.call-status{margin:0 0 12px;padding:14px 16px;border:0;border-radius:16px;background:#eef4ef;display:flex;align-items:center;gap:10px;font-size:17px;font-weight:600;color:#183128}
.call-status .call-duration{margin-left:auto;font-variant-numeric:tabular-nums;font-size:18px}
.call-status[data-status="ended"],.call-status[data-status="failed"],.call-status[data-status="rejected"]{background:#f3f4f3;color:#55645b;font-weight:500}
.recording-status{font-size:12px;padding:4px 10px;border-radius:999px}
.dial-panel .video-panel{margin:0 0 12px;gap:10px}
.video-stage{width:100%;max-height:none;aspect-ratio:16/10;border-radius:18px;background:#0b1511}
.video-stage canvas{width:100%;height:100%;object-fit:contain}
.video-stage video{width:26%;right:12px;bottom:12px;border-radius:12px}
.dial-panel .audio-controls{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin:0 0 12px}
.dial-panel .audio-controls .button{flex:1 1 180px;min-height:50px;border-radius:14px;font-weight:600;background:#fff;border:1px solid #cfd8d1;color:#26372e}
.dial-panel .audio-controls .button:hover{background:#f2f6f2}
#message{margin-top:12px;border-radius:14px;font-size:15px}
.notice:empty{display:none}
html:has(body.embedded-dialer){background:#fff}
.embedded-dialer{background:#fff}
.call-status{flex-wrap:nowrap;white-space:nowrap}
.call-status #call-status-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}
.call-status .call-duration{margin-left:0}
.dial-panel .audio-controls{margin:0 0 10px}
.dial-panel .video-panel .audio-controls{margin:0}
.dial-panel .video-panel{margin-bottom:10px}
.dial-panel:has(#hangup:not(.hidden)) :is(.panel-heading,.session-select-row,label[for="session-select"]){display:none!important}
.call-status{flex-wrap:wrap;row-gap:6px}
.call-status #call-status-label{flex:1 1 100%;white-space:normal;overflow:visible}
.call-status .call-duration{font-size:22px;font-weight:700}
.video-note:empty{display:none}

/* Bigger picture */
.video-stage:fullscreen{width:100vw;height:100vh;max-height:none;aspect-ratio:auto;border-radius:0;background:#000}
.video-stage:fullscreen canvas{object-fit:contain}
.video-stage.large{position:fixed;inset:0;z-index:9999;width:100vw;height:100vh;max-height:none;aspect-ratio:auto;border-radius:0;background:#000}
.video-exit{position:absolute;top:14px;right:14px;z-index:2;min-height:40px;padding:0 16px;border:0;border-radius:999px;background:rgba(0,0,0,.6);color:#fff;font:inherit;font-weight:600;cursor:pointer}
.video-exit:hover{background:rgba(0,0,0,.8)}
.video-stage{cursor:zoom-in}
.video-stage:fullscreen,.video-stage.large{cursor:zoom-out}
.video-stage:fullscreen video,.video-stage.large video{width:min(24%,260px);right:20px;bottom:20px}
/* Status header: dot and sentence on one line, timer and badge below */
.call-status{justify-content:flex-start}
.call-status #call-status-label{flex:1 1 calc(100% - 30px)}
.call-status .call-duration{margin-left:0}
body:not(.embedded-dialer) .call-status{justify-content:flex-start}
.dial-panel:has(#hangup:not(.hidden)){padding-top:18px!important}
.headset-option{display:flex;align-items:center;gap:10px;margin:14px 0 0;font-size:15px;color:#3f4f46;cursor:pointer}
.headset-option input{width:20px;height:20px;accent-color:#00b93f}
.headset-option small{color:#7c8782}
.dial-panel:has(#hangup:not(.hidden)) .headset-option{display:none}

/* The stage follows the picture's shape: tall for a phone held upright. */
.video-stage{aspect-ratio:var(--arn,1.6)}
.video-stage.portrait{width:min(100%,calc(66vh * var(--arn,0.5625)));max-height:66vh;margin:0 auto}
.video-stage:fullscreen,.video-stage.large{width:100vw!important;height:100vh!important;max-height:none!important;aspect-ratio:auto!important;margin:0}

/* ===== Premium embed (site/CRM dialog and console dialog) ============================
   Dark brand header + rounded white sheet, large number field, solid green primary action.
   Scoped to .embedded-dialer so the standalone /dialer page keeps its own look. */
html:has(body.embedded-dialer){background:#06211c}
body.embedded-dialer{min-height:100vh;background:#06211c radial-gradient(120% 90% at 100% 0,#0f4a37 0,rgba(6,33,28,0) 62%) no-repeat}
.embedded-dialer .app-shell,.embedded-dialer .workspace{min-height:100vh;margin:0}
.embedded-dialer .page-container{display:flex;flex-direction:column;width:100%;max-width:none;min-height:100vh;margin:0;padding:0}
.embedded-dialer .page-container:before{content:"Ligação segura pelo WhatsApp";flex:0 0 auto;display:flex;align-items:flex-end;height:118px;padding:0 28px 26px;background:url(/dialer/assets/logo-horizontal-negative.svg) no-repeat 28px 30px/128px auto;color:#8fd9b0;font-size:13px;font-weight:600;letter-spacing:.01em}
.embedded-dialer #discador{flex:1 1 auto;display:block;padding:30px 26px 26px;border-radius:28px 28px 0 0;background:#fff;box-shadow:0 -10px 40px rgba(0,0,0,.18)}
.embedded-dialer .dial-panel{max-width:none;margin:0;padding:0;border:0;background:transparent;box-shadow:none}
.embedded-dialer .dial-panel label[for="destination"]{display:block;margin:0 0 10px;color:#5f6d65;font-size:13px;font-weight:650;letter-spacing:.02em;text-transform:uppercase}
.embedded-dialer .dial-input-row{display:flex;flex-wrap:wrap;gap:12px;padding:0;border:0;background:transparent;box-shadow:none}
.embedded-dialer .dial-input-row .phone-prefix{display:none}
.embedded-dialer .dial-input-row input{flex:1 1 100%;width:100%;height:68px;padding:0 18px;border:2px solid transparent;border-radius:18px;background:#f2f6f2;color:#06211c;font-size:28px;font-weight:650;letter-spacing:.01em;text-align:center}
.embedded-dialer .dial-input-row input::placeholder{color:#a3aea7;font-weight:500}
.embedded-dialer .dial-input-row input:focus{outline:0;border-color:#00d84a;background:#fff;box-shadow:0 0 0 5px rgba(0,216,74,.16)}
.embedded-dialer .dial-input-row .button{flex:1 1 calc(50% - 6px);height:60px;min-height:60px;border:0;border-radius:16px;font-size:16px;font-weight:700;justify-content:center;gap:10px}
.embedded-dialer #dial{background:#00d84a;color:#06211c;box-shadow:0 8px 20px rgba(0,216,74,.28)}
.embedded-dialer #dial:hover:not(:disabled){background:#00c244}
.embedded-dialer #dial-video{background:#06211c;color:#fff;box-shadow:0 8px 20px rgba(6,33,28,.22)}
.embedded-dialer #dial-video:hover:not(:disabled){background:#0b2b25}
.embedded-dialer #dial-video svg{stroke:#fff}
.embedded-dialer .dial-input-row .button:disabled{opacity:.45;box-shadow:none}
.embedded-dialer .field-hint{margin:14px 0 0;color:#7c8782;font-size:13px;text-align:center}
.embedded-dialer .headset-option{display:none}
.embedded-dialer .audio-note{display:flex!important;gap:8px;margin:26px 0 0;padding:12px 14px;border-radius:14px;background:#f2f6f2;color:#5f6d65;font-size:13px;line-height:1.5}
.embedded-dialer .dial-panel:has(#hangup:not(.hidden)) .audio-note{display:none!important}
.embedded-dialer .call-status{background:#f2f6f2}
@media(max-width:380px){.embedded-dialer #discador{padding:24px 16px 20px}.embedded-dialer .dial-input-row input{font-size:24px}}
.embedded-dialer .page-container:before{height:104px;padding-bottom:22px}
.embedded-dialer #discador{display:flex;flex-direction:column}
.embedded-dialer #discador .dial-panel{flex:1 1 auto}
.embedded-dialer .dial-panel .audio-note{margin-top:auto}
.embedded-dialer .dial-panel{display:flex;flex-direction:column}
.embedded-dialer .dial-form{margin-bottom:26px}
/* In a call the brand header shrinks so the picture gets the room */
.embedded-dialer:has(#hangup:not(.hidden)) .page-container:before{content:"";height:64px;background-position:28px 22px}
.embedded-dialer:has(#hangup:not(.hidden)) #discador{padding-top:22px}
.group-toggle{margin:2px 0 6px;padding:10px 0;border:0;background:none;color:#0a8f3c;font:inherit;font-size:14px;font-weight:650;text-align:left;cursor:pointer}
.group-toggle:hover{text-decoration:underline}
.group-box{display:grid;gap:8px;margin:4px 0 10px}
.group-box textarea{width:100%;padding:12px 14px;border:1.5px solid #d3dbd5;border-radius:14px;font:inherit;font-size:16px;resize:vertical}
.group-box textarea:focus{outline:3px solid rgba(0,216,74,.35);border-color:#00d84a}
/* Number field and call list */
#destination,#group-numbers{font-variant-numeric:tabular-nums;letter-spacing:.02em}
.dial-panel .call{display:grid;gap:2px;padding:12px 14px;border:1px solid #e3e8e4;border-radius:12px;background:#fff}
.dial-panel .call strong{color:#06211c;font-size:15px;font-weight:650;font-variant-numeric:tabular-nums}
.dial-panel .call span{color:#6a766f;font-size:13px}
#dial-form>.field-hint.is-ok{color:#0a8f3c;font-weight:650}
#dial-form>.field-hint.is-warn{color:#b3541e}

.group-switch{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:14px;margin:6px 0 10px;padding:14px 16px;border:1.5px solid #e0e6e1;border-radius:16px;background:#f7f9f7;cursor:pointer;transition:border-color .15s,background .15s}
.group-switch:hover{border-color:#bfe9cc}
.group-switch:has(.switch-input:checked){border-color:#00d84a;background:#effcf3}
.group-switch .switch-input{position:absolute;opacity:0;width:1px;height:1px}
.group-switch .switch-track{position:relative;width:46px;height:28px;border-radius:999px;background:#c9d2cc;transition:background .18s}
.group-switch .switch-track:after{content:"";position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:50%;background:#fff;box-shadow:0 1px 4px #0003;transition:transform .18s}
.group-switch .switch-input:checked+.switch-track{background:#00d84a}
.group-switch .switch-input:checked+.switch-track:after{transform:translateX(18px)}
.group-switch .switch-input:focus-visible+.switch-track{outline:3px solid rgba(0,216,74,.45);outline-offset:2px}
.group-switch .switch-copy strong{display:block;color:#06211c;font-size:15px;font-weight:650;text-transform:none;letter-spacing:0}
.group-switch .switch-copy small{display:block;margin-top:2px;color:#5e6b64;font-size:13px;line-height:1.4}
.group-box label{color:#06211c;font-size:14px;font-weight:650;text-transform:none;letter-spacing:0}
.dial-panel:has(#hangup:not(.hidden)) :is(.group-switch,.group-box){display:none!important}

/* Specificity guard: form label rules elsewhere must not break the switch layout */
.dial-form label.group-switch{display:grid!important;grid-template-columns:46px minmax(0,1fr);align-items:center;gap:14px;margin:6px 0 10px;padding:14px 16px;text-transform:none;letter-spacing:0;font-size:inherit}
.dial-form label.group-switch .switch-track{display:block!important;position:relative;width:46px;height:28px;flex:none}
.dial-form label.group-switch .switch-copy{display:block;min-width:0}
.dial-form label.group-switch .switch-copy strong{display:block;font-size:15px;line-height:1.3;color:#06211c}
.dial-form label.group-switch .switch-copy small{display:block;font-size:13px;line-height:1.4;font-weight:500}

/* Voice-only calls: sound wave instead of the video stage */
#voice-wave{order:4!important}
.voice-wave{margin:0 0 12px;border-radius:18px;background:linear-gradient(160deg,#0b2b25,#06211c);padding:14px 14px 10px;text-align:center}
.voice-wave canvas{display:block;width:100%;height:110px}
.voice-wave-label{margin:6px 0 0;color:#9fb8b0;font-size:13px;font-weight:600;letter-spacing:.04em}
