/* Calls page in the chat board v1 palette. Element ids/classes follow CarrierDial's employee phone so calls.js works unchanged. */
/* v2 palette (approved design 2026-11-14). */
:root{--bg:#181818;--row:#242424;--panel:#1f1f1f;--line:#2c2c2c;--strong:#3a3a3a;--text:#f4f3ef;--mute:#b8b6ae;--dim:#918f88;--accent:#f4f3ef;--accent-text:#f4f3ef;--on-accent:#181818;--red:#ff7b6e;--green:#7dd3a8;--amber:#f0b660}
.phone-head h1,header h1{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
*{box-sizing:border-box;margin:0}
html,body{height:100%;background:var(--bg);color:var(--text);font:13px/1.4 -apple-system,BlinkMacSystemFont,"Inter","Segoe UI",Roboto,sans-serif}
body{display:flex;flex-direction:column;height:100dvh;overflow:hidden}
button,input,select{font:inherit}
button{cursor:pointer}
[hidden]{display:none!important}
.top{flex:none;display:flex;justify-content:space-between;align-items:center;padding:10px 14px;border-bottom:1px solid var(--line)}
.top h1{font-size:15px;font-weight:700}
.top-status{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--mute)}.top-status b{font-weight:700;color:var(--text)}
.top-status #phone-extension:not(:empty)::before{content:"· "}
.led{width:7px;height:7px;border-radius:50%;background:var(--dim)}
main{flex:1;min-height:0;overflow:auto;padding:10px 12px 12px;display:flex;flex-direction:column;gap:10px}
h2{font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--mute)}
.primary,.secondary,.phone-end{border-radius:4px;min-height:38px;padding:8px 14px;font-weight:700;border:1px solid var(--strong);background:var(--panel);color:var(--text)}
.primary{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.primary:disabled,.secondary:disabled{opacity:.45;cursor:default}
.phone-end{background:var(--red);border-color:var(--red);color:#2a100c}
.pill{display:inline-flex;align-items:center;border-radius:8px;padding:5px 9px;font-size:11px;font-weight:700;background:var(--row);border:1px solid var(--line);color:var(--mute)}
/* connect panel */
.phone-connect{background:var(--row);border:1px solid var(--line);border-radius:8px;padding:12px;display:grid;gap:10px}
.phone-connect p{color:var(--mute);font-size:12px;margin-top:4px}
.phone-connect .actions{display:flex;gap:8px;flex-wrap:wrap}
.phone-checks{list-style:none;padding:0;display:flex;flex-wrap:wrap;gap:6px 14px;font-size:11px}
.phone-checks li{color:var(--dim)}.phone-checks li.passed{color:var(--green)}
/* console */
.phone-console{flex:1;min-height:0;display:flex;flex-direction:column;background:var(--row);border:1px solid var(--line);border-radius:8px;overflow:hidden}
.phone-console-head{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 10px;border-bottom:1px solid var(--line)}
.phone-console-switch{display:grid;grid-template-columns:1fr 1fr;gap:4px}
.phone-console-switch button{border:1px solid var(--line);background:transparent;color:var(--mute);border-radius:4px;padding:8px 12px;font-weight:600}
.phone-console-switch button[aria-pressed=true]{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.phone-heading-actions{display:flex;gap:8px;align-items:center}
#phone-status{margin:0;padding:8px 12px;font-size:12px;color:var(--mute);border-bottom:1px solid var(--line)}#phone-status:empty{display:none}
#phone-status[data-error=true]{color:var(--red);background:rgba(255,123,110,.10)}
.phone-console-grid{flex:1;min-height:0;display:grid;grid-template-columns:minmax(260px,360px) minmax(0,1fr)}
.phone-dial-side{padding:12px;border-right:1px solid var(--line);display:flex;flex-direction:column;gap:10px;min-height:0;overflow:auto}
.phone-console label{display:block;font-size:11px;font-weight:700;color:var(--mute);margin:0 0 5px;letter-spacing:.03em}
.phone-console input,.phone-console select{width:100%;min-height:40px;padding:9px 11px;border:1px solid var(--strong);border-radius:4px;background:var(--bg);color:var(--text)}
.phone-console input:focus,.phone-console select:focus{outline:2px solid rgba(244,243,239,.35);border-color:var(--accent)}
.phone-number-entry{position:relative;margin-bottom:10px}.phone-number-entry input{font-size:20px;padding-right:44px;letter-spacing:.02em}
.phone-number-entry button{position:absolute;right:4px;top:4px;width:34px;height:34px;border:0;background:transparent;color:var(--mute);font-size:20px;border-radius:4px}
.phone-call-action{width:100%;margin-top:10px}
.phone-keypad{display:grid;grid-template-columns:repeat(3,1fr);grid-auto-rows:minmax(48px,1fr);gap:8px;flex:1;min-height:200px;max-height:360px}
.phone-keypad button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--text)}
.phone-keypad button:active,.phone-keypad button:hover{border-color:var(--accent);background:rgba(244,243,239,.10)}
.phone-keypad b{font-size:22px;font-weight:600;line-height:1}.phone-keypad small{font-size:9px;letter-spacing:.14em;color:var(--dim)}
.phone-keypad-help{font-size:11px;color:var(--dim);text-align:center}
/* active call */
.phone-active{border:1px solid var(--strong);border-radius:8px;padding:10px;background:var(--panel);display:grid;gap:8px}
.phone-call-indicator{width:9px;height:9px;border-radius:50%;background:var(--green);animation:pulse 1.2s infinite}
.phone-active h2{color:var(--text);font-size:14px;letter-spacing:0;text-transform:none}.phone-active p{color:var(--mute)}
.phone-call-controls{display:flex;flex-wrap:wrap;gap:6px}
.phone-tone-entry>div{display:flex;gap:6px}
/* history */
.phone-call-side{min-width:0;min-height:0;display:flex}
.phone-history-panel{flex:1;display:flex;flex-direction:column;min-height:0}
.phone-history-panel>header{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-bottom:1px solid var(--line)}
.phone-history-list{flex:1;min-height:0;overflow:auto}
.phone-history-empty{color:var(--dim);padding:14px 12px;font-size:12px}
.phone-history-entry{padding:9px 12px;border-bottom:1px solid var(--line);display:grid;gap:3px;font-size:12px;color:var(--mute)}
.phone-history-entry strong,.phone-history-entry b{color:var(--text)}
.phone-history-pagination{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;border-top:1px solid var(--line);font-size:11px;color:var(--mute)}
/* review dialog */
dialog{margin:auto;border:1px solid var(--strong);border-radius:8px;background:var(--panel);color:var(--text);padding:16px;max-width:360px;width:calc(100% - 32px)}
dialog::backdrop{background:rgba(0,0,0,.6)}
dialog p{margin:8px 0;color:var(--mute)}dialog strong{color:var(--text)}
dialog .check{display:flex;gap:8px;align-items:center;margin:12px 0;font-size:12px}
dialog .actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}
#phone-review-countdown{font-size:11px;color:var(--amber)}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.45}}
/* phone: one column; the switch chooses Dialer or Call history */
@media (max-width:760px){
  .phone-console-grid{grid-template-columns:1fr}
  .phone-dial-side{border-right:0}
  .phone-console[data-console-view=dialer] .phone-call-side{display:none}
  .phone-console[data-console-view=history] .phone-dial-side{display:none}
  .phone-connect{padding:10px}
}
/* v2 layout (design "Carrieralarm mobile redesign", Calls screen, 2026-11-14): flat page, underline tabs, big keypad */
.top{padding:18px 20px 4px;border-bottom:0}
.top-status{font-size:14px;gap:8px}.top-status b{font-weight:600}
.led{width:8px;height:8px}
main{padding:10px 20px 16px;gap:16px}
h2{font-size:12px;font-weight:700;letter-spacing:.08em;color:var(--mute)}
.primary,.secondary,.phone-end{border-radius:12px;min-height:44px;padding:0 16px;font-size:15px;font-weight:600;border:0;background:var(--row)}
.primary{background:var(--accent);color:var(--on-accent)}
.phone-end{background:var(--red)}
.phone-connect{border:0;border-radius:14px;padding:16px;gap:12px}
.phone-connect p{font-size:15px;line-height:21px;color:var(--text);margin-top:6px}
.phone-connect .secondary{background:var(--strong)}
.phone-connect .actions .secondary+.secondary{background:transparent;border:1px solid var(--strong)}
.phone-checks{font-size:13px;gap:8px 18px}
.phone-console{background:transparent;border:0;border-radius:0;overflow:visible}
.phone-console-head{padding:0;border-bottom:1px solid var(--line)}
.phone-console-switch{display:flex;gap:20px}
.phone-console-switch button,.phone-console-switch button[aria-pressed=true]{height:44px;margin-bottom:-1px;padding:0;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;font-size:15px;font-weight:600;color:var(--dim)}
.phone-console-switch button[aria-pressed=true]{color:var(--text);border-bottom-color:var(--text)}
.phone-heading-actions .secondary{min-height:36px;padding:0 12px;font-size:13px}
#phone-status{padding:10px 0}
.phone-dial-side{padding:16px 0 0;gap:12px;overflow:visible}
.phone-console label{font-size:13px;font-weight:400;letter-spacing:0;color:var(--dim);margin:0 0 6px}
.phone-console input,.phone-console select{min-height:52px;padding:0 16px;border:0;border-radius:12px;background:var(--row);font-size:16px}
.phone-number-entry input{font-size:24px;letter-spacing:.04em}
.phone-number-entry button{right:8px;top:9px;width:34px;height:34px}
.phone-call-action{min-height:52px;border-radius:14px;font-size:17px;margin-top:4px}
.phone-call-action:disabled{background:var(--strong);color:var(--mute);opacity:1}
.phone-keypad{grid-auto-rows:72px;gap:10px;max-height:none;min-height:0;flex:none}
.phone-keypad button{border:0;border-radius:14px;background:var(--row)}
.phone-keypad button:active,.phone-keypad button:hover{background:var(--line)}
.phone-keypad b{font-size:26px;font-weight:400}.phone-keypad small{font-size:10px;margin-top:4px}
.phone-keypad-help{font-size:13px;line-height:18px;padding:4px 0}
.phone-history-entry{padding:12px 0;font-size:14px}.phone-history-panel>header{padding:12px 0}
dialog{border:0;border-radius:16px;background:var(--row)}

/* Compact (2026-11-17): everything fits one screen with no scrolling. The Dialer / Call history switch is the shared bottom bar (.sw). */
.top{padding:calc(8px + env(safe-area-inset-top)) 16px 2px}
.top-status{font-size:13px;gap:6px}
main{padding:6px 16px 8px;gap:8px}
.phone-connect{padding:10px 12px;gap:8px;border-radius:12px}
.phone-connect p{font-size:13px;line-height:18px;margin-top:2px}
.phone-connect .actions .primary,.phone-connect .actions .secondary{min-height:38px;font-size:14px;padding:0 12px}
.phone-checks{font-size:12px;gap:2px 12px}
.phone-console-head{justify-content:flex-end;border-bottom:0}
.phone-heading-actions .secondary{min-height:32px;padding:0 10px;font-size:12px}
#phone-status{padding:4px 0}
.phone-dial-side{padding:2px 0 0;gap:8px}
.phone-console label{font-size:12px;margin:0 0 3px}
.phone-console input,.phone-console select{min-height:44px;font-size:16px;padding:0 14px}
.phone-number-entry{margin-bottom:4px}.phone-number-entry input{font-size:22px}.phone-number-entry button{top:5px;right:6px}
.phone-call-action{min-height:46px;font-size:16px;margin-top:2px}
.phone-keypad{grid-auto-rows:clamp(44px,6.8dvh,60px);gap:8px}
.phone-keypad b{font-size:22px}.phone-keypad small{font-size:9px;margin-top:2px}
.phone-keypad-help{display:none}
.phone-history-entry{padding:9px 0;font-size:13px}.phone-history-panel>header{padding:6px 0}
/* Short phones (about 700px tall or less): trim a little more so it still fits without scrolling. */
@media (max-height:760px){
  .phone-checks{display:none}
  .phone-keypad{grid-auto-rows:clamp(36px,5.6dvh,48px);gap:6px}
  .phone-console input,.phone-console select{min-height:40px}
  .phone-call-action{min-height:42px}
  .phone-dial-side{gap:6px}
}
