/* EZZY IT Softphone — substantial visual redesign. UI-only: all existing IDs, controls and SIP/audio JS remain intact. */
:root{--wp-bg:#080d18;--wp-card:#111a2b;--wp-card2:#17243a;--wp-border:#273650;--wp-text:#f2f6ff;--wp-muted:#8e9db8;--wp-accent:#6c8cff;--wp-green:#30d6a0;--wp-red:#ff6676;--wp-shadow:0 18px 50px rgba(0,0,0,.22);--brand-blue:#6687ff;--panel:#101a2c}
html{background:var(--wp-bg)}body{background:radial-gradient(ellipse at 5% 0%,rgba(67,102,206,.18),transparent 33%),radial-gradient(ellipse at 100% 90%,rgba(27,180,146,.07),transparent 28%),var(--wp-bg)!important;color:var(--wp-text);font-family:Inter,"Segoe UI",system-ui,sans-serif;font-size:13px}
.wp-shell{width:min(1440px,calc(100% - 42px));margin:18px auto 24px}
.wp-header{min-height:76px;padding:10px 4px 18px;margin-bottom:20px;border-bottom:1px solid rgba(137,158,198,.15)}
.brand{gap:13px}.brand-mark{width:48px;height:48px;border-radius:16px;background:linear-gradient(145deg,#8ea5ff,#4d64e8 58%,#7e5bea);box-shadow:0 9px 25px rgba(82,108,239,.3);font-size:22px}.brand h1{font-size:21px;letter-spacing:-.045em}.brand p{font-size:11px;color:#8797b3;letter-spacing:.06em;text-transform:uppercase;margin-top:5px}
.header-actions{gap:10px}.status-pill{background:#111b2d;border:1px solid #2b3b58;border-radius:10px;padding:9px 12px;color:#b8c5dd;font-size:11px}.theme-toggle{background:#17233a;border-color:#2b3b58;border-radius:10px;font-size:11px}
.wp-card{background:linear-gradient(150deg,rgba(20,31,51,.98),rgba(13,22,38,.99))!important;border:1px solid #263650!important;border-radius:19px;box-shadow:0 15px 40px rgba(0,0,0,.18)!important;backdrop-filter:none}
/* Login is now a compact, centered connection panel with a bold brand accent. */
.setup{max-width:610px;margin:48px auto 70px;position:relative;overflow:hidden;border-radius:24px}.setup:before{content:"EZZY IT  /  VOICE";display:flex;align-items:flex-end;height:112px;padding:0 30px 20px;background:radial-gradient(circle at 82% 25%,rgba(255,255,255,.2),transparent 24%),linear-gradient(120deg,#283f9c,#536de7 56%,#6b5de0);color:#fff;font-size:11px;font-weight:800;letter-spacing:.18em}.setup .card-body{padding:28px 32px 32px}.setup h2{font-size:24px;letter-spacing:-.04em}.setup .muted{line-height:1.6}.field label{font-size:10px;letter-spacing:.1em;text-transform:uppercase;font-weight:800;color:#9aaaca}.field input,.field select{min-height:48px;background:#0a1323;border:1px solid #2a3a58;border-radius:10px;padding:12px 14px}.field input:focus{border-color:#8099ff;box-shadow:0 0 0 3px #6687ff25}.row2{gap:12px}.check{font-size:12px}.primary{min-height:48px;background:linear-gradient(100deg,#6484ff,#765fe8);border-radius:10px;box-shadow:0 8px 20px #4d62d933}.primary:hover{filter:brightness(1.08)}
/* Three distinct work areas: keypad, call stage, and activity rail. */
.phone-grid{grid-template-columns:minmax(250px,290px) minmax(340px,1fr) minmax(270px,330px);gap:14px;align-items:stretch}
.phone-grid>.account-card:first-child{grid-column:1;grid-row:1;padding:20px 18px;background:linear-gradient(180deg,#14213a,#101a2b)!important}
.phone-grid>.call-screen{grid-column:2;grid-row:1;min-width:0;min-height:640px;background:radial-gradient(ellipse at 50% 38%,rgba(79,108,213,.15),transparent 45%),linear-gradient(180deg,#121e32,#0e1727)!important}
.phone-grid>aside[style*="grid-column"]{grid-column:3!important;grid-row:1;padding:18px 16px;min-width:0;background:#101a2b!important}
.account-line{align-items:flex-start;padding-bottom:16px;border-bottom:1px solid rgba(143,165,207,.14)}.account-name{font-size:14px;font-weight:800;letter-spacing:-.02em;overflow-wrap:anywhere}.account-line .secondary{font-size:10px;padding:8px 9px;background:#18263e;border-color:#30415f}
.number-display{min-height:72px;margin:18px 0 14px;border-radius:12px;background:#080f1d!important;border:1px solid #2b3d5e!important;text-align:left!important;padding:18px 15px!important;font-size:25px!important;font-weight:600;letter-spacing:.02em;box-shadow:inset 0 3px 12px rgba(0,0,0,.16)}.number-display::placeholder{color:#526482}
.dialpad{gap:8px}.dial-key{min-height:61px;border-radius:12px;background:linear-gradient(150deg,#1b2942,#142037)!important;border:1px solid #2a3b58!important;font-size:22px;font-weight:600;box-shadow:none}.dial-key span{font-size:9px;letter-spacing:.17em;color:#8798b8;margin-top:4px}.dial-key:hover{background:#263b61!important;border-color:#6c8cff!important;transform:translateY(-1px)}.dial-actions{margin-top:13px;gap:8px}.call-btn{min-height:46px;border-radius:11px;background:linear-gradient(110deg,#32d6a0,#18b887)!important;color:#05271e!important;font-weight:850;box-shadow:0 7px 18px #1bc7961c}.clear-btn{min-height:46px;border-radius:11px;background:#18243a!important;border-color:#30405d!important}
.call-top{min-height:74px;padding:18px 22px;border-bottom:1px solid rgba(143,165,207,.14)}.call-top strong{font-size:14px;letter-spacing:-.02em}.call-state{margin-top:5px;color:#91a1bf}.call-top .status-pill{font-size:10px;padding:8px 10px}.call-main{padding:40px 25px}.avatar{width:112px;height:112px;border-radius:36px;background:linear-gradient(145deg,#7998ff,#5267e8 58%,#8a62e8);font-size:36px;box-shadow:0 18px 48px #5369e933;border:1px solid #ffffff20;position:relative}.avatar:after{content:"";position:absolute;inset:-9px;border:1px solid #718aff28;border-radius:43px}.peer{font-size:32px;font-weight:780;letter-spacing:-.045em;margin-top:7px}.timer{font-size:13px;color:#9aa9c4;letter-spacing:.12em}.incoming-actions,.call-controls{border-top:1px solid rgba(143,165,207,.14);padding:20px 16px 24px;gap:8px}.ctrl{min-height:43px;border-radius:11px;background:#1a2942!important;border:1px solid #304361!important;font-size:11px;font-weight:750}.ctrl.active{background:#263e6a!important;border-color:#7894ff!important}.ctrl.danger,.danger{background:#ef5367!important;color:#fff!important;border-color:#ef5367!important}
.phone-grid>aside[style*="grid-column"] .tabs{padding:4px;background:#0a1322!important;border:1px solid #263751;border-radius:10px;gap:3px}.tab{font-size:11px;font-weight:800;border-radius:8px;padding:10px 7px}.tab.active{background:#27395d!important;color:#fff!important;box-shadow:inset 0 0 0 1px #526ba6}.recent-list{max-height:560px;gap:8px}.recent-item{padding:12px 11px;border-radius:11px;background:#141f33!important;border:1px solid #273752!important;min-width:0}.recent-item strong{font-size:12px;overflow-wrap:anywhere}.recent-item small{font-size:10px;line-height:1.5;color:#8d9fbd}.recent-item.answered{border-left:3px solid #30d6a0!important}.recent-item.failed{border-left:3px solid #ff6676!important}.recent-status{font-weight:800}.settings-grid{grid-template-columns:1fr;gap:10px}.settings-section{background:#141f33!important;border:1px solid #293a57!important;border-radius:12px;padding:14px}.settings-section h3{font-size:10px;letter-spacing:.1em}.settings-section select{width:100%;min-height:42px;border-radius:9px;background:#0b1424!important;color:#edf3ff!important;border:1px solid #2a3b59!important}.footer{margin-top:16px;color:#687b9b;font-size:10px;letter-spacing:.12em;text-transform:uppercase}
/* Light theme keeps the new structure and brand hierarchy. */
html[data-theme="light"] body{background:radial-gradient(ellipse at 5% 0%,#e0e8ff,transparent 36%),#f0f3fa!important;color:#1b2943!important}
html[data-theme="light"] .wp-card{background:#fff!important;border-color:#dce4f1!important;box-shadow:0 12px 35px rgba(35,54,93,.07)!important}
html[data-theme="light"] .phone-grid>.account-card:first-child{background:linear-gradient(180deg,#fff,#f5f7fd)!important}
html[data-theme="light"] .phone-grid>.call-screen{background:radial-gradient(ellipse at 50% 38%,#e9eeff,transparent 46%),linear-gradient(180deg,#fff,#f7f9fd)!important}
html[data-theme="light"] .phone-grid>aside[style*="grid-column"]{background:#fff!important}
html[data-theme="light"] .account-line{border-color:#e5eaf3}html[data-theme="light"] .account-line .secondary{background:#f1f4fb!important;color:#34415c!important;border-color:#dce4f1!important}
html[data-theme="light"] .number-display{background:#f5f7fc!important;color:#1b2943!important;border-color:#dce4f1!important;box-shadow:inset 0 2px 7px #1a2b4a0a!important}html[data-theme="light"] .number-display::placeholder{color:#9aa6ba}
html[data-theme="light"] .dial-key{background:linear-gradient(150deg,#fff,#f1f4fb)!important;color:#253553!important;border-color:#dce4f1!important}html[data-theme="light"] .dial-key span{color:#8794ab}html[data-theme="light"] .dial-key:hover{background:#e9efff!important}
html[data-theme="light"] .clear-btn,html[data-theme="light"] .ctrl{background:#f1f4fb!important;color:#263553!important;border-color:#dce4f1!important}html[data-theme="light"] .ctrl.active{background:#e7edff!important;border-color:#a8b9f4!important}html[data-theme="light"] .ctrl.danger{background:#ef5367!important;color:#fff!important}
html[data-theme="light"] .phone-grid>aside[style*="grid-column"] .tabs{background:#f0f3f9!important;border-color:#e0e6f0!important}html[data-theme="light"] .tab{color:#71809b!important}html[data-theme="light"] .tab.active{background:#fff!important;color:#3856bb!important;box-shadow:0 2px 8px #26395e14!important}
html[data-theme="light"] .recent-item{background:#f9faff!important;border-color:#e3e9f3!important}html[data-theme="light"] .recent-item small{color:#71809b}html[data-theme="light"] .settings-section{background:#f7f9fd!important;border-color:#e0e7f2!important}html[data-theme="light"] .settings-section select{background:#fff!important;color:#263553!important;border-color:#dce4f1!important}html[data-theme="light"] .call-state,html[data-theme="light"] .timer{color:#71809b}
@media(max-width:1150px){.phone-grid{grid-template-columns:minmax(240px,280px) minmax(320px,1fr)}.phone-grid>.account-card:first-child{grid-column:1;grid-row:1}.phone-grid>.call-screen{grid-column:2;grid-row:1}.phone-grid>aside[style*="grid-column"]{grid-column:1/-1!important;grid-row:2;}.recent-list{max-height:330px}.settings-grid{grid-template-columns:1fr 1fr}}
@media(max-width:760px){.wp-shell{width:calc(100% - 24px);margin:12px auto 20px}.wp-header{align-items:flex-start;gap:12px}.brand h1{font-size:18px}.brand-mark{width:42px;height:42px}.header-actions{flex-direction:column-reverse;align-items:flex-end;gap:7px}.phone-grid{grid-template-columns:1fr;gap:12px}.phone-grid>.account-card:first-child,.phone-grid>.call-screen,.phone-grid>aside[style*="grid-column"]{grid-column:1!important;grid-row:auto!important}.phone-grid>.call-screen{min-height:420px}.phone-grid>aside[style*="grid-column"]{grid-column:1/-1!important}.settings-grid{grid-template-columns:1fr}.recent-list{max-height:300px}}
@media(max-width:500px){.wp-header{flex-wrap:wrap}.setup{margin:25px auto 35px}.setup:before{height:88px;padding:0 22px 17px}.setup .card-body{padding:23px 20px}.row2{grid-template-columns:1fr;gap:0}.peer{font-size:26px}.call-main{padding:28px 15px}.avatar{width:88px;height:88px;border-radius:29px}.avatar:after{border-radius:36px}.ctrl{min-width:70px;padding:10px 9px}.phone-grid>aside[style*="grid-column"]{padding:14px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;animation:none!important}}

/* Contrast fix: keep theme and history action labels readable in light mode. */
html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .header-actions .theme-toggle,
html[data-theme="light"] button.theme-toggle.secondary {
  background: #263d73 !important;
  background-image: linear-gradient(135deg, #304c88, #263d73) !important;
  color: #ffffff !important;
  border: 1px solid #1f3566 !important;
  box-shadow: 0 3px 10px rgba(31, 53, 102, .18) !important;
  text-shadow: none !important;
}
html[data-theme="light"] .theme-toggle:hover { background: #1e3260 !important; }
html[data-theme="light"] .recent-item > button.secondary,
html[data-theme="light"] .recent-item button {
  background: #167653 !important;
  background-image: linear-gradient(135deg, #18875f, #116c4b) !important;
  color: #ffffff !important;
  border: 1px solid #0e6243 !important;
  font-weight: 800 !important;
  text-shadow: none !important;
  box-shadow: 0 2px 7px rgba(17, 108, 75, .16) !important;
}
html[data-theme="light"] .recent-item > button.secondary:hover,
html[data-theme="light"] .recent-item button:hover { background: #0d5d40 !important; }
html[data-theme="light"] .recent-item.answered .recent-status { color: #087044 !important; }
html[data-theme="light"] .recent-item.failed .recent-status { color: #b42336 !important; }

/* Recording folder preference */
.recording-folder-path{margin:12px 0;padding:11px 12px;min-height:40px;border:1px solid var(--wp-border);border-radius:10px;background:rgba(90,120,170,.09);color:var(--wp-text);font-size:12px;line-height:1.5;overflow-wrap:anywhere;user-select:text}.recording-folder-actions{display:flex;gap:10px;flex-wrap:wrap}.recording-folder-actions button{min-height:38px}


/* Requested layout and light-theme recording contrast refinements. */
.account-line { align-items: center; }
.call-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#disconnectBtn.disconnect-btn,
html[data-theme="light"] #disconnectBtn.disconnect-btn {
  background: #d92f42 !important;
  background-image: linear-gradient(135deg, #ef5262, #c92136) !important;
  color: #ffffff !important;
  border: 1px solid #b91f31 !important;
  box-shadow: 0 4px 12px rgba(201, 33, 54, .18) !important;
  font-weight: 800 !important;
  text-shadow: none !important;
}
#disconnectBtn.disconnect-btn:hover { background: #b91f31 !important; filter: brightness(.98); }
/* Light Mode: Audio and Recording panels share the same readable palette. */
html[data-theme="light"] .settings-section.audio-settings,
html[data-theme="light"] .settings-section.recording-settings {
  background: #f7f9fd !important;
  border-color: #e0e7f2 !important;
  color: #263553 !important;
  box-shadow: none !important;
}
html[data-theme="light"] .settings-section.audio-settings h3,
html[data-theme="light"] .settings-section.recording-settings h3,
html[data-theme="light"] .settings-section.audio-settings label {
  color: #263553 !important;
}
html[data-theme="light"] .settings-section.audio-settings select,
html[data-theme="light"] .recording-folder-path {
  background: #ffffff !important;
  border: 1px solid #dce4f1 !important;
  color: #263553 !important;
  box-shadow: none !important;
}
html[data-theme="light"] .recording-settings .secondary {
  background: #ffffff !important;
  color: #263553 !important;
  border-color: #dce4f1 !important;
}
html[data-theme="light"] .account-line .status-pill {
  background: #ffffff !important;
  color: #263553 !important;
  border-color: #dce4f1 !important;
}
.account-line .status-pill { margin-left: auto; white-space: nowrap; }
@media (max-width: 760px) {
  .call-top { padding: 16px; }
}


/* Header status is shown on login/connecting screens; Disconnect replaces it after login. */
.header-actions #disconnectBtn.disconnect-btn {
  white-space: nowrap;
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 10px;
}
.call-top > .status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .header-actions #disconnectBtn.disconnect-btn { padding: 8px 10px; font-size: 11px; }
  .call-top > .status-pill { padding: 8px 9px; }
}

.header-actions #headerStatus { white-space: nowrap; }
.header-actions #headerStatus.hidden { display: none !important; }
.header-actions #disconnectBtn.hidden { display: none !important; }
