:root {
  --bg: #070c12;
  --bg2: #061823;
  --panel: #0f1c2b;
  --panel-border: #244968;
  --text: #d2e9ff;
  --muted: #79a7cb;
  --ok: #15d1a0;
  --warn: #ffd166;
  --err: #ff6b6b;
  --accent: #24d5ff;
  --button-bg: linear-gradient(180deg, #24d5ff 0%, #13a8d6 100%);
  --button-text: #031018;
  --button-border: rgba(66, 191, 228, 0.85);
  --ghost-bg: rgba(9, 18, 27, 0.72);
  --ghost-border: rgba(76, 111, 143, 0.74);
  --control-bg: rgba(8, 15, 23, 0.88);
  --control-border: rgba(67, 95, 123, 0.86);
}

:root[data-theme="emerald"] {
  --bg: #06100e;
  --bg2: #08241d;
  --panel: #0d251f;
  --panel-border: #23705d;
  --text: #ddfff6;
  --muted: #86caba;
  --ok: #27e6a4;
  --warn: #ffe08a;
  --err: #ff7d85;
  --accent: #32e7c2;
}

:root[data-theme="light"] {
  --bg: #edf5f8;
  --bg2: #dceef4;
  --panel: #ffffff;
  --panel-border: #b7ccda;
  --text: #102331;
  --muted: #516879;
  --ok: #087d63;
  --warn: #a06b00;
  --err: #b42334;
  --accent: #0c88c8;
  --button-bg: linear-gradient(180deg, #0fa3df 0%, #087fba 100%);
  --button-text: #ffffff;
  --button-border: rgba(12, 136, 200, 0.9);
  --ghost-bg: rgba(255, 255, 255, 0.84);
  --ghost-border: rgba(145, 175, 195, 0.9);
  --control-bg: rgba(255, 255, 255, 0.94);
  --control-border: #abc4d4;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  overscroll-behavior: none;
  background: radial-gradient(circle at 15% 10%, #0f2b3d 0%, var(--bg) 45%, #03060a 100%);
  color: var(--text);
  font-family: "Segoe UI", "Eurostile", "Trebuchet MS", sans-serif;
}

html {
  background: #03060a;
}

:root[data-theme="emerald"] html,
:root[data-theme="emerald"] body {
  background: radial-gradient(circle at 18% 12%, #0f463a 0%, var(--bg) 48%, #020705 100%);
}

:root[data-theme="light"] html,
:root[data-theme="light"] body {
  background: linear-gradient(180deg, #f4fbff 0%, #dcecf3 100%);
}

:root[data-theme="light"] .bg-grid {
  opacity: 0.18;
  background-image:
    linear-gradient(to right, rgba(12, 85, 125, 0.14) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(12, 85, 125, 0.14) 1px, transparent 1px);
}

:root[data-theme="light"] .app-bar,
:root[data-theme="light"] .side-nav,
:root[data-theme="light"] .profile-dropdown,
:root[data-theme="light"] .entity-card,
:root[data-theme="light"] .entity-empty,
:root[data-theme="light"] .settings-panel,
:root[data-theme="light"] .trunk-row,
:root[data-theme="light"] .upload-dropzone,
:root[data-theme="light"] .subscription-plan-card,
:root[data-theme="light"] .subscription-side-panel,
:root[data-theme="light"] .subscription-usage-card,
:root[data-theme="light"] .inbound-row {
  border-color: rgba(92, 129, 151, 0.55);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
}

:root[data-theme="light"] .page-head h1,
:root[data-theme="light"] .settings-panel strong,
:root[data-theme="light"] .entity-card strong,
:root[data-theme="light"] .subscription-plan-head h2,
:root[data-theme="light"] .app-brand span:last-child {
  color: #102331;
}

:root[data-theme="light"] input,
:root[data-theme="light"] textarea,
:root[data-theme="light"] select,
:root[data-theme="light"] .theme-picker button {
  border-color: #abc4d4;
  background: rgba(255, 255, 255, 0.94);
  color: #102331;
}

:root[data-theme="light"] .subscription-feature-grid span,
:root[data-theme="light"] .subscription-side-panel span,
:root[data-theme="light"] .usage-stats span {
  border-color: rgba(12, 136, 200, 0.18);
  background: rgba(12, 136, 200, 0.07);
  color: #233846;
}

:root[data-theme="light"] .ai-agent-hero-panel,
:root[data-theme="light"] .ai-agent-balance-card,
:root[data-theme="light"] .ai-runtime-panel,
:root[data-theme="light"] .ai-local-whisper {
  border-color: rgba(12, 136, 200, 0.2);
  background: rgba(255, 255, 255, 0.72);
}

:root[data-theme="light"] .ai-agent-hero-panel strong,
:root[data-theme="light"] .ai-local-whisper-head strong,
:root[data-theme="light"] .subscription-usage-head strong,
:root[data-theme="light"] .usage-stats strong {
  color: #102331;
}

:root[data-theme="light"] .app-modal {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(238, 247, 252, 0.98));
}

:root[data-theme="light"] .modal-head h2,
:root[data-theme="light"] .audio-panel-head label,
:root[data-theme="light"] .transport-main {
  color: #102331;
}

:root[data-theme="light"] .audio-panel,
:root[data-theme="light"] .segmented-control,
:root[data-theme="light"] .modal-close,
:root[data-theme="light"] .transport-picker button {
  border-color: rgba(145, 175, 195, 0.7);
  background: rgba(255, 255, 255, 0.72);
}

:root[data-theme="light"] .segmented-control button.active {
  background: rgba(12, 136, 200, 0.12);
  color: #0d5578;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

html.app-booting body {
  overflow: hidden;
}

html.app-booting:not(.login-ready) .shell,
html.app-booting .webphone-toggle,
html.app-booting .webphone-panel {
  opacity: 0;
  pointer-events: none;
}

html.app-booting:not(.login-ready) body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  background:
    radial-gradient(circle at 50% 45%, rgba(36, 213, 255, 0.13), transparent 28%),
    linear-gradient(180deg, rgba(7, 12, 18, 0.92), rgba(3, 6, 10, 0.98));
}

html.app-booting:not(.login-ready) body::before {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 101;
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px;
  border: 2px solid rgba(121, 167, 203, 0.22);
  border-top-color: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(36, 213, 255, 0.26);
  animation: p1BootSpin 0.8s linear infinite;
}

@keyframes p1BootSpin {
  to {
    transform: rotate(360deg);
  }
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(to right, rgba(84, 190, 255, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(84, 190, 255, 0.12) 1px, transparent 1px);
  background-size: 42px 42px;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1520px, calc(100vw - 32px));
  margin: 20px auto;
}

body[data-active-page="callcenter"] {
  overflow: hidden;
  background: #1e1f22;
}

body[data-active-page="callcenter"] .bg-grid {
  display: none;
}

body[data-active-page="callcenter"] .shell {
  display: grid;
  width: 100vw;
  height: 100vh;
  margin: 0;
  grid-template-rows: auto minmax(0, 1fr);
}

body[data-active-page="callcenter"] .app-bar {
  margin: 0;
  border-width: 0 0 1px;
  border-radius: 0;
}

.app-bar {
  position: sticky;
  top: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  margin-bottom: 14px;
  border: 1px solid rgba(56, 102, 135, 0.72);
  border-radius: 8px;
  background: rgba(8, 18, 29, 0.84);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  padding: 9px 10px 9px 12px;
}

.app-bar-left {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.nav-menu-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  gap: 4px;
  border-color: rgba(64, 93, 122, 0.9);
  background: rgba(14, 28, 43, 0.88);
  padding: 10px;
}

.nav-menu-button span {
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 999px;
  background: #dff7ff;
}

.app-brand,
.login-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.app-brand span:last-child {
  color: #edf8ff;
  font-size: 14px;
  font-weight: 800;
}

.login-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(36, 213, 255, 0.6);
  border-radius: 8px;
  background: linear-gradient(135deg, #0f8fb3, #15d1a0);
  color: #031018;
  font-size: 12px;
  font-weight: 900;
}

.profile-menu {
  position: relative;
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  max-width: min(280px, 54vw);
  height: 40px;
  border-color: rgba(64, 93, 122, 0.9);
  background: rgba(14, 28, 43, 0.88);
  color: #e9f7ff;
  padding: 0 10px 0 7px;
}

.profile-button #profile-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-caret {
  color: #9fb5c9;
  font-size: 10px;
  font-weight: 900;
}

.profile-avatar {
  width: 28px;
  height: 28px;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  width: 218px;
  gap: 4px;
  border: 1px solid rgba(58, 88, 116, 0.92);
  border-radius: 8px;
  background: #0a1623;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
  padding: 8px;
}

.profile-dropdown.hidden {
  display: none;
}

.profile-dropdown button {
  display: flex;
  height: 38px;
  align-items: center;
  gap: 10px;
  border-color: transparent;
  background: transparent;
  color: #cde7f9;
  text-align: left;
  padding: 0 9px;
}

.profile-dropdown button:not(:last-child) {
  border-bottom: 1px solid rgba(58, 88, 116, 0.2);
}

.menu-glyph {
  display: grid;
  width: 26px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  background: rgba(36, 213, 255, 0.1);
  color: #9eeaff;
  font-size: 9px;
  font-weight: 900;
}

.profile-dropdown button:hover {
  background: rgba(36, 213, 255, 0.12);
  color: #ffffff;
}

.topline {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 16px;
}

.title-wrap h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: 0;
}

.kicker {
  margin: 0 0 6px 0;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
}

.status-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.app-frame {
  display: block;
}

.side-nav {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 70;
  display: flex;
  width: min(310px, calc(100vw - 34px));
  flex-direction: column;
  gap: 7px;
  border: 1px solid rgba(31, 54, 78, 0.8);
  border-radius: 0 8px 8px 0;
  background: rgba(5, 10, 16, 0.96);
  box-shadow: 24px 0 54px rgba(0, 0, 0, 0.44);
  padding: 14px;
  transform: translateX(-104%);
  transition: transform 0.22s ease;
}

body.nav-open .side-nav {
  transform: translateX(0);
}

.side-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  margin-bottom: 6px;
  color: #edf8ff;
}

.side-nav-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.side-nav-brand strong {
  font-size: 14px;
  letter-spacing: 0;
}

.side-nav-brand .login-mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  font-size: 11px;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 65;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.48);
}

.nav-backdrop.hidden {
  display: none;
}

.side-nav-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  height: 42px;
  border: 1px solid transparent;
  background: transparent;
  color: #aebed0;
  text-align: left;
  padding: 0 11px 0 7px;
}

.side-nav-item span {
  min-width: 0;
}

.side-nav-item > span:first-child {
  display: grid;
  height: 26px;
  place-items: center;
  border-radius: 6px;
  background: rgba(121, 167, 203, 0.1);
  color: #8abce0;
  font-size: 9px;
  font-weight: 900;
}

.side-nav-item .nav-item-text {
  display: inline-flex;
  height: auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 800;
}

.side-nav-item .nav-item-text em {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  border: 1px solid rgba(255, 193, 7, 0.36);
  border-radius: 999px;
  background: rgba(255, 193, 7, 0.08);
  color: #ffd875;
  padding: 0 7px;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.side-nav-item:hover,
.side-nav-item.active {
  border-color: rgba(21, 209, 160, 0.34);
  background: rgba(21, 209, 160, 0.1);
  color: #eafff8;
}

.side-nav-item.active > span:first-child {
  background: rgba(21, 209, 160, 0.18);
  color: #9effdb;
}

.side-nav-item.quiet {
  color: #8095aa;
}

.side-nav-spacer {
  flex: 1;
  min-height: 18px;
}

.page-host {
  min-width: 0;
}

body[data-active-page="callcenter"] .page-host {
  min-height: 0;
}

.app-page {
  display: none;
}

.app-page.active {
  display: block;
}

.app-page.callcenter-page.active {
  display: grid;
}

.callcenter-page {
  min-height: calc(100vh - 92px);
  grid-template-columns: 72px minmax(260px, 320px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(37, 50, 65, 0.95);
  border-radius: 8px;
  background: #1e1f22;
}

body[data-active-page="callcenter"] .callcenter-page {
  min-height: 0;
  height: 100%;
  border: 0;
  border-radius: 0;
}

.callcenter-rail {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px 10px;
  background: #1e1f22;
  border-right: 1px solid #111214;
}

.callcenter-mark,
.callcenter-rail-btn {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 0;
  border-radius: 16px;
  background: #313338;
  color: #f2f3f5;
  font-weight: 900;
}

.callcenter-rail-btn {
  cursor: pointer;
}

.callcenter-rail-btn.active,
.callcenter-rail-btn:hover {
  border-radius: 14px;
  background: #5865f2;
}

.callcenter-sidebar {
  height: 100%;
  min-height: 0;
  overflow: hidden auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 0;
  background: #2b2d31;
  box-shadow: none;
}

.callcenter-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  border: 0;
  border-left: 1px solid #1f2023;
  border-radius: 0;
  background: #313338;
  box-shadow: none;
}

.callcenter-topbar {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(17, 18, 20, 0.88);
  background: #313338;
}

.callcenter-topbar strong,
.callcenter-topbar span {
  display: block;
}

.callcenter-topbar strong {
  color: #f2f3f5;
}

.callcenter-topbar span {
  color: #b5bac1;
  font-size: 12px;
}

.callcenter-board {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px;
}

.callcenter-board .active-call-list {
  padding: 0;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.page-head h1 {
  margin: 0;
  color: #f4fbff;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: 0;
}

.page-title-inline {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.experimental-tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid rgba(255, 193, 7, 0.46);
  border-radius: 999px;
  background: rgba(255, 193, 7, 0.1);
  color: #ffd56a;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.page-head p:not(.kicker) {
  max-width: 760px;
  margin: 8px 0 0;
  color: #86a3bb;
  font-size: 14px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.page-actions button {
  min-width: 132px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  display: grid;
  min-height: 138px;
  height: auto;
  gap: 7px;
  align-content: start;
  border: 1px solid rgba(36, 74, 102, 0.86);
  background: linear-gradient(180deg, rgba(14, 29, 43, 0.94), rgba(7, 14, 22, 0.94));
  color: #dff4ff;
  padding: 15px;
  text-align: left;
}

.metric-kicker {
  color: #7ea3bd;
  font-size: 12px;
  font-weight: 800;
}

.metric-card strong {
  font-size: 30px;
}

.metric-card small {
  color: #89a7bd;
  font-size: 12px;
}

.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.entity-card,
.entity-empty,
.settings-panel,
.trunk-row {
  border: 1px solid rgba(36, 74, 102, 0.76);
  border-radius: 8px;
  background: rgba(8, 16, 24, 0.82);
}

.entity-card {
  display: grid;
  min-height: 138px;
  height: auto;
  gap: 11px;
  align-content: start;
  border-color: rgba(36, 74, 102, 0.86);
  background: linear-gradient(180deg, rgba(14, 29, 43, 0.94), rgba(7, 14, 22, 0.94));
  color: #dff3ff;
  padding: 15px;
  text-align: left;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.entity-card:hover {
  border-color: rgba(36, 213, 255, 0.72);
  background: linear-gradient(180deg, rgba(16, 35, 51, 0.98), rgba(7, 16, 25, 0.98));
  transform: translateY(-1px);
}

.entity-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.entity-title-wrap {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.entity-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(36, 213, 255, 0.22);
  border-radius: 8px;
  background: rgba(36, 213, 255, 0.08);
  color: #7ee7ff;
}

.entity-card strong {
  color: #f3fbff;
  font-size: 16px;
}

.entity-card-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(36, 213, 255, 0.22);
  border-radius: 999px;
  background: rgba(36, 213, 255, 0.08);
  color: #a9eaff;
  font-size: 11px;
  font-weight: 800;
  padding: 0 8px;
}

.entity-card small,
.entity-card p {
  color: #8ca9c0;
  font-size: 12px;
}

.entity-card p {
  margin: 0;
}

.entity-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: auto;
}

.entity-card-actions button {
  height: 34px;
  min-width: 84px;
  padding: 0 10px;
}

.entity-card-actions .ai-talk-action {
  min-width: 128px;
  height: 36px;
  margin-top: 0;
}

.entity-card-actions .ai-type-action {
  min-width: 86px;
}

.entity-empty {
  display: grid;
  min-height: 118px;
  place-items: center;
  gap: 4px;
  color: #8ca9c0;
  padding: 18px;
  text-align: center;
}

.entity-empty strong {
  color: #e7f8ff;
}

.trunk-table {
  display: grid;
  gap: 8px;
}

.trunk-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.2fr) 92px minmax(180px, 1fr) 120px;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  height: auto;
  background: rgba(8, 16, 24, 0.82);
  color: #dff3ff;
  padding: 10px 12px;
  text-align: left;
}

.trunk-row:hover {
  border-color: #24d5ff;
}

.trunk-row strong,
.trunk-row small {
  display: block;
}

.trunk-row small {
  margin-top: 2px;
  color: #7e9bb2;
  font-size: 11px;
}

.trunk-name-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.trunk-name-cell > span:last-child {
  min-width: 0;
}

.trunk-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(21, 209, 160, 0.28);
  border-radius: 8px;
  background: rgba(21, 209, 160, 0.1);
  color: #69ecc8;
}

.trunk-transport-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(36, 213, 255, 0.2);
  border-radius: 999px;
  background: rgba(36, 213, 255, 0.07);
  color: #bdefff;
  font-size: 12px;
  font-weight: 900;
  padding: 0 10px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.settings-grid-wide {
  grid-template-columns: minmax(260px, 0.8fr) minmax(420px, 1.4fr);
  align-items: start;
}

.settings-panel {
  display: grid;
  gap: 5px;
  padding: 16px;
}

.settings-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.settings-panel strong {
  color: #f0fbff;
}

.settings-panel span {
  color: #8ca9c0;
  font-size: 13px;
}

.theme-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.theme-picker button {
  height: 56px;
  border-color: rgba(52, 87, 115, 0.76);
  background: rgba(8, 16, 24, 0.82);
  color: #d9eefc;
}

.theme-picker button.active {
  border-color: var(--accent);
  background: rgba(36, 213, 255, 0.14);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(36, 213, 255, 0.28);
}

:root[data-theme="light"] .theme-picker button.active {
  color: #102331;
}

.inbound-panel {
  gap: 14px;
}

.inbound-form {
  gap: 12px;
}

.inbound-route-card,
.ai-runtime-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(36, 213, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(36, 213, 255, 0.07), transparent 52%),
    rgba(5, 18, 28, 0.56);
  padding: 14px;
}

.mini-section-head {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.mini-section-head .ui-icon {
  flex: 0 0 auto;
  color: var(--accent);
}

.mini-section-head strong,
.mini-section-head small {
  display: block;
}

.mini-section-head strong {
  color: #f0fbff;
  font-size: 13px;
}

.mini-section-head small {
  margin-top: 2px;
  color: #8ca9c0;
  font-size: 12px;
}

.compact-grid {
  gap: 10px;
}

.switch-row,
.field-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.switch-row label,
.field-chip-grid label {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(125, 218, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 0 10px;
  color: #cde7f7;
  font-size: 12px;
  font-weight: 800;
}

.switch-row input,
.field-chip-grid input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.inbound-list {
  display: grid;
  gap: 8px;
}

.inbound-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) minmax(80px, 0.5fr) minmax(120px, 0.8fr);
  align-items: center;
  gap: 10px;
  min-height: 58px;
  height: auto;
  border-color: rgba(36, 74, 102, 0.76);
  background: rgba(8, 16, 24, 0.72);
  color: #dff3ff;
  padding: 10px 12px;
  text-align: left;
}

.inbound-row.active,
.inbound-row:hover {
  border-color: var(--accent);
}

.inbound-row strong,
.inbound-row small {
  display: block;
}

.inbound-row small {
  margin-top: 2px;
  color: #86a3bb;
  font-size: 11px;
}

.inline-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: var(--ok);
  font-size: 12px;
  font-weight: 700;
}

.inline-status.error {
  color: var(--err);
}

.subscription-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(250px, 0.7fr);
  gap: 14px;
}

.subscription-plan-card,
.subscription-side-panel,
.subscription-usage-card {
  border: 1px solid rgba(36, 74, 102, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(14, 29, 43, 0.96), rgba(7, 14, 22, 0.96)),
    radial-gradient(circle at 88% 5%, rgba(36, 213, 255, 0.18), transparent 32%);
  padding: 20px;
}

.subscription-plan-card {
  display: grid;
  gap: 18px;
}

.subscription-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.subscription-plan-head h2 {
  margin: 0;
  color: #f4fbff;
  font-size: 34px;
}

.subscription-plan-head > span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(21, 209, 160, 0.42);
  border-radius: 999px;
  color: #b9ffe9;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.subscription-lead {
  max-width: 760px;
  margin: 0;
  color: #a7c7da;
}

.subscription-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.subscription-feature-grid span,
.subscription-side-panel span {
  border: 1px solid rgba(36, 213, 255, 0.16);
  border-radius: 8px;
  background: rgba(36, 213, 255, 0.07);
  color: #c5e8f5;
  padding: 10px;
  font-size: 13px;
}

.subscription-actions {
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.subscription-side-panel {
  display: grid;
  gap: 10px;
  align-content: start;
}

.subscription-usage-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
}

.subscription-usage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.subscription-usage-head strong {
  display: block;
  margin-top: 2px;
  color: #f0fbff;
  font-size: 18px;
}

.usage-meter {
  height: 11px;
  overflow: hidden;
  border: 1px solid rgba(21, 209, 160, 0.35);
  border-radius: 999px;
  background: rgba(8, 19, 28, 0.88);
}

.usage-meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #15d1a0, #24d5ff);
  transition: width 240ms ease;
}

.usage-meter.is-high {
  border-color: rgba(255, 190, 92, 0.48);
}

.usage-meter.is-high span {
  background: linear-gradient(90deg, #ffbe5c, #ff6d6d);
}

.usage-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.usage-stats span {
  border: 1px solid rgba(36, 213, 255, 0.16);
  border-radius: 8px;
  background: rgba(36, 213, 255, 0.07);
  color: #9ebed1;
  padding: 10px;
  font-size: 12px;
}

.usage-stats strong {
  display: block;
  margin-top: 3px;
  color: #f4fbff;
  font-size: 18px;
}

.subscription-usage-card p {
  margin: 0;
  color: #90afc3;
  font-size: 13px;
}

.telegram-page {
  display: none;
}

.telegram-page.active {
  display: block;
}

.ai-agent-form {
  gap: 16px;
}

.ai-agent-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ai-agent-tab-panel {
  display: grid;
  gap: 16px;
}

.ai-agent-tab-panel.hidden {
  display: none;
}

.ai-agent-hero-panel,
.ai-agent-balance-card {
  border: 1px solid rgba(36, 213, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(36, 213, 255, 0.12), transparent 46%),
    rgba(6, 16, 25, 0.78);
  padding: 16px;
}

.ai-agent-hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ai-agent-hero-panel strong {
  display: block;
  color: #f0fbff;
  font-size: 18px;
}

.ai-agent-hero-panel span {
  display: block;
  margin-top: 5px;
  color: #96b7ca;
  font-size: 13px;
}

.ai-agent-balance-card {
  display: grid;
  gap: 13px;
}

#ai-agent-balance-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid rgba(21, 209, 160, 0.34);
  border-radius: 999px;
  background: rgba(21, 209, 160, 0.08);
  color: #9effdb;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

#ai-agent-usage-note.error {
  color: var(--err);
}

.ai-pipeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ai-pipeline label,
.ai-agent-form label {
  min-width: 0;
}

.ai-pipeline select,
.ai-pipeline input {
  width: 100%;
}

.ai-pipeline .hidden,
.ai-agent-form label.hidden,
.ai-agent-form input.hidden {
  display: none;
}

.ai-local-whisper {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(21, 209, 160, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(21, 209, 160, 0.1), transparent 46%),
    rgba(4, 17, 14, 0.56);
  padding: 14px;
}

.ai-local-whisper.hidden {
  display: none;
}

.ai-whisper-advanced.hidden {
  display: none;
}

.ai-local-whisper-head {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ai-local-whisper-head .ui-icon {
  flex: 0 0 auto;
  color: #72efc9;
}

.ai-local-whisper-head strong {
  display: block;
  color: #effbff;
  font-size: 13px;
  font-weight: 900;
}

.ai-local-whisper-head small {
  display: block;
  margin-top: 3px;
  color: #8ca9c0;
  font-size: 12px;
}

.ai-agent-list {
  align-content: start;
}

.agent-runtime-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.agent-runtime-summary span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid rgba(125, 218, 255, 0.18);
  border-radius: 999px;
  background: rgba(125, 218, 255, 0.06);
  padding: 0 9px;
  color: #bfe9ff;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.token-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.token-status-row span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.token-ok {
  border: 1px solid rgba(21, 209, 160, 0.38);
  background: rgba(21, 209, 160, 0.1);
  color: #72efc9;
}

.token-missing {
  border: 1px solid rgba(255, 107, 107, 0.36);
  background: rgba(255, 107, 107, 0.08);
  color: #ff9d9d;
}

.telegram-grid {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(320px, 1fr);
  gap: 14px;
  align-items: start;
}

.telegram-config-panel,
.telegram-guide-panel,
.telegram-messages-panel {
  gap: 16px;
}

.telegram-connection-card {
  display: grid;
  min-height: 216px;
  place-items: center;
  gap: 10px;
  border: 1px solid rgba(36, 74, 102, 0.76);
  border-radius: 8px;
  background: rgba(4, 9, 13, 0.62);
  padding: 24px;
  text-align: center;
}

.telegram-connection-card.connected {
  border-color: rgba(21, 209, 160, 0.58);
  background: rgba(4, 32, 20, 0.72);
}

.telegram-orb {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 999px;
  background: rgba(121, 167, 203, 0.14);
  color: #b9d8ea;
  font-size: 13px;
  font-weight: 900;
}

.telegram-connection-card.connected .telegram-orb {
  background: rgba(21, 209, 160, 0.18);
  color: #24f1af;
}

.telegram-connection-card h2 {
  margin: 0;
  color: #f3fbff;
  font-size: 22px;
}

.telegram-connection-card.connected h2 {
  color: #35e7ae;
}

.telegram-connection-card p {
  margin: 0;
  color: #91a8b8;
}

.telegram-connected-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  width: 100%;
  margin-top: 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.34);
  padding: 12px;
  text-align: left;
}

.telegram-connected-meta strong {
  text-align: right;
}

.telegram-form {
  gap: 14px;
}

.telegram-actions {
  grid-template-columns: minmax(90px, auto) minmax(116px, auto) minmax(140px, 1fr);
}

.telegram-guide {
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(58, 88, 116, 0.28);
}

.telegram-guide div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(58, 88, 116, 0.24);
}

.telegram-guide div > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(121, 167, 203, 0.28);
  border-radius: 999px;
  color: #dff2ff;
  font-weight: 900;
}

.telegram-guide p {
  margin: 0;
}

.telegram-guide small {
  display: block;
  margin-top: 6px;
  color: #8ca9c0;
}

.telegram-tip {
  border: 1px solid rgba(36, 139, 255, 0.34);
  border-radius: 8px;
  background: rgba(36, 139, 255, 0.08);
  color: #8ecaff;
  padding: 12px;
  font-size: 13px;
  font-weight: 700;
}

.telegram-messages-panel {
  margin-top: 14px;
}

.telegram-toggle-grid,
.telegram-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.telegram-switch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 58px;
  border: 1px solid rgba(36, 74, 102, 0.64);
  border-radius: 8px;
  background: rgba(4, 9, 13, 0.54);
  padding: 0 12px;
  color: #dff3ff;
  font-weight: 800;
}

.telegram-switch input {
  width: 40px;
  height: 22px;
  accent-color: #15d1a0;
}

.telegram-preview {
  border: 1px solid rgba(36, 74, 102, 0.64);
  border-radius: 8px;
  background: rgba(4, 9, 13, 0.54);
  padding: 14px;
}

.telegram-preview p {
  margin: 10px 0 0;
  color: #9db8ca;
  line-height: 1.55;
}

.status-badge.ok {
  border-color: rgba(21, 209, 160, 0.5);
  color: #72f0c5;
}

.pill {
  border: 1px solid #2c6b83;
  background: rgba(10, 36, 52, 0.7);
  color: #a9f2ff;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  white-space: nowrap;
}

.pill.muted {
  color: #b9cce0;
  border-color: #3a4f67;
}

.login-page {
  min-height: 100vh;
}

.login-shell {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  border: 1px solid rgba(45, 104, 139, 0.8);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(17, 34, 51, 0.96), rgba(7, 16, 26, 0.98)),
    radial-gradient(circle at 78% 0%, rgba(36, 213, 255, 0.14), transparent 34%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
  padding: 22px;
}

.login-brand {
  margin-bottom: 22px;
}

.login-brand h1 {
  margin: 0;
  color: #f2fbff;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0;
}

.login-form {
  gap: 10px;
}

.login-form button {
  margin-top: 6px;
  height: 42px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 12px;
}

.left-stack {
  display: grid;
  gap: 12px;
  align-content: start;
}

.right-stack {
  display: grid;
  min-width: 0;
  gap: 12px;
  align-content: start;
}

.panel {
  background: linear-gradient(180deg, rgba(20, 35, 54, 0.94), rgba(12, 20, 35, 0.96));
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 16px;
  min-height: 100%;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.35);
}

.panel h2 {
  margin: 0;
  font-size: 18px;
}

.panel-hint {
  margin: 8px 0 14px;
  font-size: 12px;
  color: var(--muted);
}

form {
  display: grid;
  gap: 8px;
}

label {
  font-size: 12px;
  color: var(--muted);
}

input {
  width: 100%;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--control-border);
  padding: 0 13px;
  background: var(--control-bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border-radius: 8px;
  border: 1px solid var(--control-border);
  padding: 12px 13px;
  background: var(--control-bg);
  color: var(--text);
  font: inherit;
  line-height: 1.45;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

select {
  width: 100%;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--control-border);
  padding: 0 13px;
  background: var(--control-bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(36, 213, 255, 0.15);
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(36, 213, 255, 0.15);
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(36, 213, 255, 0.15);
}

button {
  height: 42px;
  border: 1px solid var(--button-border);
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
  box-shadow: none;
}

.ghost {
  height: 36px;
  padding: 0 12px;
  border-color: var(--ghost-border);
  background: var(--ghost-bg);
  color: #c3def0;
  font-weight: 800;
}

.button-with-icon,
.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.ui-icon {
  position: relative;
  display: inline-block;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.ui-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ui-icon.is-svg::before,
.ui-icon.is-svg::after {
  display: none;
}

.ui-icon::before,
.ui-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.ui-icon[data-icon="rocket"]::before {
  inset: 2px 5px 3px 5px;
  border: 2px solid currentColor;
  border-radius: 9px 9px 7px 7px;
  transform: rotate(42deg);
}

.ui-icon[data-icon="rocket"]::after {
  left: 1px;
  bottom: 1px;
  width: 6px;
  height: 6px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.ui-icon[data-icon="file-audio"]::before,
.ui-icon[data-icon="file-up"]::before {
  inset: 1px 3px 1px 4px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.ui-icon[data-icon="file-audio"]::after {
  left: 7px;
  top: 5px;
  width: 5px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.ui-icon[data-icon="file-up"]::after,
.ui-icon[data-icon="upload"]::after {
  left: 5px;
  top: 4px;
  width: 7px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
}

.ui-icon[data-icon="upload"]::before {
  left: 3px;
  right: 3px;
  bottom: 3px;
  height: 5px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 3px 3px;
}

.ui-icon[data-icon="sparkles"]::before {
  left: 7px;
  top: 1px;
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: currentColor;
}

.ui-icon[data-icon="sparkles"]::after {
  left: 1px;
  top: 7px;
  width: 15px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
}

.ui-icon[data-icon="plus"]::before {
  left: 7px;
  top: 2px;
  width: 3px;
  height: 13px;
  border-radius: 3px;
  background: currentColor;
}

.ui-icon[data-icon="plus"]::after {
  left: 2px;
  top: 7px;
  width: 13px;
  height: 3px;
  border-radius: 3px;
  background: currentColor;
}

.ui-icon[data-icon="play"]::before {
  left: 5px;
  top: 3px;
  border-top: 5.5px solid transparent;
  border-bottom: 5.5px solid transparent;
  border-left: 8px solid currentColor;
}

.ui-icon[data-icon="save"]::before {
  inset: 2px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.ui-icon[data-icon="save"]::after {
  left: 5px;
  bottom: 3px;
  width: 7px;
  height: 5px;
  border: 2px solid currentColor;
  border-bottom: 0;
}

.ui-icon[data-icon="trash"]::before {
  left: 4px;
  top: 5px;
  width: 9px;
  height: 10px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 3px 3px;
}

.ui-icon[data-icon="trash"]::after {
  left: 3px;
  top: 2px;
  width: 11px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.ui-icon[data-icon="x"]::before,
.ui-icon[data-icon="x"]::after {
  left: 7px;
  top: 2px;
  width: 2px;
  height: 13px;
  border-radius: 2px;
  background: currentColor;
}

.ui-icon[data-icon="x"]::before {
  transform: rotate(45deg);
}

.ui-icon[data-icon="x"]::after {
  transform: rotate(-45deg);
}

.ui-icon[data-icon="plug"]::before {
  left: 4px;
  top: 5px;
  width: 9px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.ui-icon[data-icon="plug"]::after {
  left: 6px;
  top: 1px;
  width: 5px;
  height: 6px;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.ui-icon[data-icon="refresh"]::before {
  inset: 2px;
  border: 2px solid currentColor;
  border-left-color: transparent;
  border-radius: 999px;
}

.ui-icon[data-icon="refresh"]::after {
  right: 2px;
  top: 1px;
  width: 6px;
  height: 6px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(20deg);
}

.ui-icon[data-icon="list"]::before {
  left: 5px;
  top: 3px;
  width: 9px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor;
}

.ui-icon[data-icon="list"]::after {
  left: 2px;
  top: 3px;
  width: 2px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor;
}

.ui-icon[data-icon="radio"]::before {
  inset: 2px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.ui-icon[data-icon="radio"]::after {
  left: 6px;
  top: 6px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
}

.ui-icon[data-icon="route"]::before {
  left: 2px;
  top: 7px;
  width: 13px;
  height: 3px;
  border-radius: 3px;
  background: currentColor;
}

.ui-icon[data-icon="route"]::after {
  right: 2px;
  top: 4px;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.ui-icon[data-icon="lock"]::before {
  left: 3px;
  top: 7px;
  width: 11px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.ui-icon[data-icon="lock"]::after {
  left: 5px;
  top: 2px;
  width: 7px;
  height: 8px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.danger {
  border-color: #854047;
  background: rgba(89, 22, 32, 0.45);
  color: #ffb6bb;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
}

.contacts-panel {
  min-height: auto;
}

.contact-favorite-row {
  margin-top: 2px;
}

.contact-actions {
  grid-template-columns: 1fr auto auto;
}

.contacts-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.contact-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  height: auto;
  border: 1px solid #2d5578;
  border-radius: 6px;
  background: rgba(9, 22, 35, 0.7);
  color: var(--text);
  padding: 8px;
  text-align: left;
}

.contact-item:hover,
.contact-item.active {
  border-color: #5bc9ff;
  background: rgba(18, 42, 62, 0.72);
}

.contact-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #15d1a0, #24d5ff);
  color: #031018;
  font-size: 12px;
  font-weight: 900;
}

.contact-text {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.contact-text strong,
.contact-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-text strong {
  color: #f1fbff;
  font-size: 13px;
}

.contact-text span {
  color: var(--muted);
  font-size: 11px;
}

.contact-call-icon {
  display: grid;
  min-width: 42px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(21, 209, 160, 0.55);
  border-radius: 6px;
  color: #a9ffe7;
  background: rgba(21, 209, 160, 0.12);
  font-size: 10px;
  font-weight: 900;
}

.sip-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.sip-item {
  border: 1px solid #2d5578;
  border-radius: 6px;
  padding: 10px;
  background: rgba(9, 22, 35, 0.7);
  cursor: pointer;
  height: auto;
  min-height: 76px;
  text-align: left;
  color: var(--text);
}

.sip-item:hover {
  border-color: #4ba5d6;
}

.sip-item.active {
  border-color: #5bc9ff;
  box-shadow: 0 0 0 1px rgba(91, 201, 255, 0.4) inset;
}

.sip-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.sip-item-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
}

.sip-item-meta {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
}

.status-badge {
  font-size: 11px;
  border-radius: 999px;
  padding: 4px 9px;
  border: 1px solid #32556f;
  color: #b7d4e9;
  background: rgba(31, 57, 79, 0.45);
}

.status-up {
  border-color: #17896b;
  color: #9effdb;
  background: rgba(21, 91, 70, 0.35);
}

.status-down,
.status-error {
  border-color: #913a46;
  color: #ffb9c1;
  background: rgba(110, 28, 40, 0.35);
}

.form-message {
  min-height: 18px;
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.form-message.ok {
  color: var(--ok);
}

.form-message.error {
  color: var(--err);
}

.console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.console {
  background: linear-gradient(180deg, #07131d, #04080c);
  border: 1px solid #244968;
  border-radius: 6px;
  min-height: 390px;
  max-height: calc(100vh - 220px);
  overflow: auto;
  font-family: Consolas, "Lucida Console", monospace;
  font-size: 12px;
  padding: 8px 9px;
}

.live-ops {
  display: grid;
  grid-template-columns: minmax(230px, 0.72fr) minmax(320px, 1.28fr);
  gap: 12px;
  margin-bottom: 10px;
}

.team-voice-panel,
.active-call-pane {
  border: 1px solid rgba(37, 50, 65, 0.95);
  border-radius: 8px;
  background: linear-gradient(180deg, #242830, #1c2027);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.team-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(12, 16, 22, 0.72);
  background: #2b3038;
}

.team-header strong,
.team-header span {
  display: block;
}

.team-header strong {
  color: #f4f6fb;
  font-size: 14px;
}

.team-header div > span {
  margin-top: 2px;
  color: #9aa4b2;
  font-size: 11px;
}

.team-speaker {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  background: #111827;
  color: #b7c2d1;
  font-size: 9px;
  font-weight: 900;
}

.team-presence-light {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #7ce35b;
  box-shadow: 0 0 14px rgba(124, 227, 91, 0.68);
}

.team-members {
  display: grid;
  gap: 4px;
  padding: 10px 8px 8px;
}

.team-member {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 34px;
  padding: 4px 7px;
  border-radius: 6px;
  color: #b5bac1;
  cursor: grab;
}

.team-member:hover,
.team-member.self {
  background: rgba(78, 86, 101, 0.42);
  color: #f2f4f7;
}

.team-member.muted .team-avatar,
.team-member.deafened .team-avatar {
  filter: grayscale(0.8);
}

.team-avatar {
  position: relative;
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #5865f2, #2dd4bf);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  overflow: hidden;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  transition:
    box-shadow 140ms ease,
    filter 140ms ease;
}

.team-avatar.has-image {
  color: transparent;
  text-shadow: none;
}

.team-avatar.speaking {
  box-shadow:
    0 0 0 2px #23a55a,
    0 0 0 5px rgba(35, 165, 90, 0.28),
    0 0 18px rgba(35, 165, 90, 0.55);
}

.team-avatar.speaking::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid #23a55a;
  border-radius: inherit;
  box-shadow: inset 0 0 0 2px rgba(35, 165, 90, 0.28);
  pointer-events: none;
}

.team-avatar.guest-avatar {
  background: linear-gradient(135deg, #4b5563, #14b8a6);
}

.team-member strong,
.team-member span:not(.voice-state-icons, .voice-state-icon) {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-member strong {
  font-size: 13px;
}

.team-member span:not(.voice-state-icons, .voice-state-icon) {
  color: #8f98a5;
  font-size: 11px;
}

.voice-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 2px;
  color: #8f98a5;
  font-size: 11px;
  font-weight: 900;
}

.voice-section-label button {
  width: 24px;
  height: 22px;
  border: 0;
  background: transparent;
  color: #a5adba;
  font-size: 18px;
  line-height: 1;
}

.ops-section-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(12, 16, 22, 0.72);
  background: #20242c;
}

.ops-section-head h3 {
  margin: 0;
  color: #f4f6fb;
  font-size: 13px;
}

.ops-section-head span {
  color: #8f98a5;
  font-size: 11px;
}

.ops-section-head button {
  flex: 0 0 auto;
  margin-left: auto;
}

.active-call-list,
.voice-channel-list {
  display: grid;
  gap: 8px;
}

.voice-channel-list {
  padding: 4px 8px 10px;
}

.active-call-list {
  padding: 10px;
}

.empty-live-state {
  display: grid;
  min-height: 56px;
  place-items: center;
  border: 1px dashed rgba(143, 152, 165, 0.22);
  border-radius: 6px;
  color: #8f98a5;
  font-size: 12px;
}

.active-call-card,
.voice-channel {
  border: 1px solid rgba(78, 86, 101, 0.62);
  border-radius: 7px;
  background: rgba(38, 42, 50, 0.82);
  padding: 9px;
}

.active-call-card {
  display: grid;
  gap: 8px;
  text-align: left;
  color: var(--text);
  height: auto;
  min-height: 112px;
  cursor: pointer;
}

.active-call-card.selected {
  border-color: #5865f2;
  box-shadow: 0 0 0 1px rgba(88, 101, 242, 0.35) inset;
}

.active-call-top,
.channel-head,
.participant-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.active-call-title,
.channel-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #d7dbe2;
  font-size: 13px;
  font-weight: 800;
}

.active-call-meta {
  display: grid;
  gap: 3px;
  color: #9aa4b2;
  font-size: 11px;
}

.call-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.call-actions button,
.channel-actions button {
  height: 30px;
  padding: 0 8px;
  font-size: 11px;
}

.voice-channel {
  min-height: 72px;
  border-color: transparent;
  background: transparent;
  cursor: pointer;
}

.voice-channel:hover,
.voice-channel.joined {
  background: rgba(78, 86, 101, 0.36);
}

.voice-channel.joined {
  border-color: rgba(88, 101, 242, 0.42);
}

.voice-channel.hold-channel {
  border-color: rgba(248, 113, 113, 0.28);
}

.voice-channel.drag-over {
  border-color: #7ce35b;
  background: rgba(64, 76, 58, 0.52);
}

.channel-body {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.participant-pill {
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #b5bac1;
  padding: 5px 7px 5px 24px;
  cursor: grab;
  font-size: 12px;
  position: relative;
}

.participant-pill::before {
  content: "";
  position: absolute;
  left: 7px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #7ce35b;
}

.participant-pill:active {
  cursor: grabbing;
}

.participant-pill.call {
  background: rgba(79, 84, 99, 0.45);
  color: #ffffff;
  padding-left: 7px;
}

.participant-pill.call::before {
  display: none;
}

.participant-pill.worker.self {
  background: rgba(88, 101, 242, 0.22);
  color: #ffffff;
}

.participant-pill.worker {
  padding-left: 7px;
}

.participant-pill.worker::before {
  display: none;
}

.participant-label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.participant-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-label .team-avatar {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

.participant-pill.muted,
.participant-pill.deafened {
  color: #a4a9b3;
}

.participant-pill .participant-status {
  white-space: nowrap;
}

.worker-profile-popover {
  position: fixed;
  z-index: 40;
  width: min(318px, calc(100vw - 20px));
  overflow: hidden;
  border: 1px solid rgba(67, 79, 97, 0.95);
  border-radius: 8px;
  background: #111318;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.52);
}

.worker-profile-popover.hidden {
  display: none;
}

.p1-context-menu {
  position: fixed;
  z-index: 60;
  display: grid;
  width: 212px;
  border: 1px solid rgba(67, 79, 97, 0.95);
  border-radius: 8px;
  background: #111318;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.48);
  padding: 6px;
}

.p1-context-menu.hidden {
  display: none;
}

.p1-context-menu button {
  height: 34px;
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
  color: #d9dee7;
  padding: 0 9px;
  text-align: left;
}

.p1-context-menu button:hover:not(:disabled) {
  background: rgba(88, 101, 242, 0.22);
  color: #ffffff;
}

.p1-context-menu button:disabled {
  cursor: default;
  color: #6d7480;
}

.context-volume {
  display: grid;
  gap: 7px;
  margin: 4px 0;
  padding: 9px;
  border: 1px solid rgba(217, 222, 231, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.context-volume.hidden {
  display: none;
}

.context-volume-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #d9dee7;
  font-size: 11px;
}

.context-volume-head strong {
  color: #32e7c2;
  font-size: 11px;
}

.context-volume input {
  width: 100%;
  accent-color: #32e7c2;
}

.context-voice-controls {
  display: grid;
  gap: 2px;
  margin: 4px 0;
  padding-top: 4px;
  border-top: 1px solid rgba(217, 222, 231, 0.1);
}

.context-voice-controls.hidden {
  display: none;
}

.context-check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 34px;
  padding: 0 9px;
  border-radius: 6px;
  color: #ff7878;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.context-check-row:hover {
  background: rgba(239, 68, 68, 0.16);
}

.context-check-row input {
  width: 14px;
  height: 14px;
  accent-color: #ef4444;
}

.p1-context-menu button.danger-action {
  color: #ff7878;
}

.p1-context-menu button.danger-action:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.18);
  color: #ffffff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 12%, rgba(36, 213, 255, 0.1), transparent 34%),
    rgba(0, 0, 0, 0.82);
  padding: 28px;
}

.modal-backdrop.hidden {
  display: none;
}

.app-modal {
  width: min(700px, calc(100vw - 32px));
  max-height: calc(100vh - 56px);
  overflow: hidden auto;
  border: 1px solid rgba(70, 105, 136, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(14, 23, 32, 0.98), rgba(6, 10, 15, 0.98)),
    #0b0f14;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.app-modal.wide {
  width: min(920px, calc(100vw - 32px));
}

.app-modal.ai-chat-modal {
  width: min(760px, calc(100vw - 32px));
}

.app-modal.hidden {
  display: none;
}

.modal-head {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(58, 88, 116, 0.44);
  padding: 0 22px;
}

.modal-title-group {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.modal-title-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(36, 213, 255, 0.26);
  border-radius: 8px;
  background: rgba(36, 213, 255, 0.09);
  color: #7ee7ff;
}

.modal-title-group > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.modal-head h2 {
  margin: 0;
  color: #f3fbff;
  font-size: 22px;
}

.modal-title-group > div > span {
  color: #89a7bc;
  font-size: 12px;
  font-weight: 800;
}

.modal-close {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(88, 116, 143, 0.44);
  background: rgba(6, 12, 18, 0.6);
  color: #9eb6c9;
  font-size: 0;
}

.modal-close .ui-icon {
  width: 18px;
  height: 18px;
}

.modal-close:hover {
  border-color: rgba(36, 213, 255, 0.55);
  background: rgba(36, 213, 255, 0.1);
  color: #ffffff;
}

.modal-body {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.ai-chat-body {
  gap: 12px;
}

.ai-chat-log {
  display: grid;
  min-height: 320px;
  max-height: min(52vh, 460px);
  align-content: start;
  gap: 10px;
  overflow: auto;
  border: 1px solid rgba(58, 88, 116, 0.5);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(9, 20, 31, 0.9), rgba(3, 8, 13, 0.9)),
    #071019;
  padding: 14px;
}

.ai-chat-empty {
  display: grid;
  min-height: 250px;
  place-items: center;
  align-content: center;
  gap: 6px;
  color: #8ca9c0;
  text-align: center;
}

.ai-chat-empty strong {
  color: #effbff;
}

.ai-chat-bubble {
  width: min(82%, 520px);
  border: 1px solid rgba(67, 101, 130, 0.5);
  border-radius: 8px;
  background: rgba(14, 29, 43, 0.9);
  padding: 10px 12px;
}

.ai-chat-bubble.user {
  justify-self: end;
  border-color: rgba(36, 213, 255, 0.36);
  background: rgba(20, 82, 103, 0.36);
}

.ai-chat-bubble.assistant {
  justify-self: start;
  border-color: rgba(21, 209, 160, 0.34);
  background: rgba(5, 31, 24, 0.76);
}

.ai-chat-bubble span {
  display: block;
  margin-bottom: 4px;
  color: #9eb6c9;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.ai-chat-bubble p {
  margin: 0;
  color: #e9f8ff;
  font-size: 13px;
  line-height: 1.45;
}

.ai-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 124px;
  gap: 10px;
}

.ai-chat-form input {
  min-height: 46px;
}

.ai-chat-form .modal-primary {
  margin-top: 0;
}

.ai-chat-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ai-chat-actions button {
  min-width: 132px;
}

#script-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#script-form > .form-field,
#script-form > .script-routing-card,
#script-form > .modal-action-row,
#script-form > .form-message {
  grid-column: 1 / -1;
}

.modal-body label span,
.form-field > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.form-field {
  display: grid;
  gap: 0;
}

.modal-body label .field-label-with-icon,
.field-label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.modal-body label .field-label-with-icon,
.modal-body label .field-label-with-icon > span,
.modal-body label .select-icon-shell,
.modal-body label .input-icon-shell,
.modal-body label .field-leading-icon,
.modal-body label .field-leading-icon > span {
  margin-bottom: 0;
}

.modal-body label .field-label-with-icon {
  margin-bottom: 8px;
}

.modal-body label .field-label-with-icon > span {
  display: inline-flex;
}

.field-label-with-icon .ui-icon {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.modal-body label .select-icon-shell,
.modal-body label .input-icon-shell,
.select-icon-shell {
  position: relative;
  display: block;
}

.select-icon-shell::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid #9dc1dc;
  border-bottom: 2px solid #9dc1dc;
  pointer-events: none;
  transform: translateY(-64%) rotate(45deg);
}

.icon-select-field select,
.icon-input-field input {
  padding-left: 54px;
}

.icon-select-field select {
  padding-right: 48px;
  appearance: none;
  -webkit-appearance: none;
}

.field-leading-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  z-index: 1;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: #77e8ca;
  pointer-events: none;
  transform: translateY(-50%);
}

.select-icon-shell.is-up .field-leading-icon {
  color: #42e8a6;
}

.select-icon-shell.is-down .field-leading-icon {
  color: #ff6b6b;
}

.field-leading-icon .ui-icon {
  width: 17px;
  height: 17px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid rgba(52, 87, 115, 0.72);
  border-radius: 8px;
  background: rgba(4, 8, 12, 0.7);
  padding: 5px;
}

#script-form .segmented-control-icons {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.segmented-control button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  border-color: transparent;
  background: transparent;
  color: #9fb6c8;
}

.segmented-control button.active {
  border-color: rgba(36, 213, 255, 0.38);
  background: rgba(36, 213, 255, 0.16);
  color: #e7faff;
  box-shadow: inset 0 0 0 1px rgba(36, 213, 255, 0.1);
}

.segmented-control button:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
}

.script-routing-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  border: 1px solid rgba(52, 87, 115, 0.58);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(36, 213, 255, 0.08), transparent 38%),
    rgba(4, 9, 14, 0.72);
  padding: 7px;
}

.script-ai-agent-panel {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
  border: 1px solid rgba(52, 87, 115, 0.58);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(21, 209, 160, 0.1), transparent 42%),
    rgba(4, 9, 14, 0.68);
  padding: 14px;
}

.script-ai-agent-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.script-ai-agent-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(21, 209, 160, 0.38);
  border-radius: 8px;
  background: rgba(21, 209, 160, 0.1);
  color: #72efc9;
}

.script-ai-agent-icon .ui-icon {
  width: 21px;
  height: 21px;
}

.script-ai-agent-head strong {
  display: block;
  color: #effbff;
  font-size: 14px;
  font-weight: 900;
}

.script-ai-agent-head small {
  display: block;
  margin-top: 3px;
  color: #87a8bd;
  font-size: 12px;
  line-height: 1.45;
}

.script-ai-agent-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.script-ai-agent-steps span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  gap: 7px;
  border: 1px solid rgba(52, 87, 115, 0.48);
  border-radius: 8px;
  background: rgba(3, 8, 13, 0.54);
  color: #cde8f7;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.script-ai-agent-steps .ui-icon {
  width: 15px;
  height: 15px;
  color: #72efc9;
}

.script-live-toggle,
.script-seconds-control {
  display: grid;
  align-items: center;
  min-width: 0;
  min-height: 46px;
  border: 1px solid rgba(52, 87, 115, 0.42);
  border-radius: 8px;
  background: rgba(3, 8, 13, 0.54);
  padding: 8px 10px;
}

.script-live-toggle {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  cursor: pointer;
}

.script-live-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.modal-body label .script-toggle-track,
.modal-body label .script-live-toggle > span:last-child,
.modal-body label .script-seconds-control > span:first-child,
.modal-body label .script-stepper-shell,
.modal-body label .script-stepper-shell .ui-icon {
  margin-bottom: 0;
}

.script-toggle-track {
  position: relative;
  display: block;
  width: 40px;
  height: 22px;
  border: 1px solid rgba(125, 160, 187, 0.42);
  border-radius: 999px;
  background: rgba(11, 22, 31, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.script-toggle-track span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #8aa6ba;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.38);
  transition: transform 0.18s ease, background 0.18s ease;
}

.script-live-toggle input:checked + .script-toggle-track {
  border-color: rgba(21, 209, 160, 0.78);
  background: rgba(21, 209, 160, 0.18);
}

.script-live-toggle input:checked + .script-toggle-track span {
  background: #72efc9;
  transform: translateX(18px);
}

.script-live-toggle strong,
.script-seconds-control strong {
  display: block;
  margin: 0;
  color: #effbff;
  font-size: 13px;
  font-weight: 900;
}

.script-live-toggle small,
.script-seconds-control small {
  display: none;
  margin-top: 0;
  color: #83a2b8;
  font-size: 11px;
  font-weight: 700;
}

.script-seconds-control {
  grid-template-columns: auto auto;
  gap: 10px;
}

.script-stepper-shell {
  display: inline-grid;
  grid-template-columns: 32px 54px 32px;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(52, 87, 115, 0.68);
  border-radius: 8px;
  background: rgba(3, 8, 13, 0.82);
}

.modal-body label .script-stepper-shell {
  display: inline-grid;
}

.script-stepper-shell .script-stepper-btn,
.script-stepper-shell input {
  height: 32px;
  border: 0;
  border-radius: 0;
}

.script-stepper-shell .script-stepper-btn {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 0;
  background: transparent;
  color: #8ebbd8;
}

.script-stepper-shell .script-stepper-btn:hover:not(:disabled) {
  background: rgba(36, 213, 255, 0.1);
  color: #ffffff;
  transform: none;
  box-shadow: none;
}

.script-stepper-shell input {
  min-width: 0;
  padding: 0;
  border-left: 1px solid rgba(52, 87, 115, 0.48);
  border-right: 1px solid rgba(52, 87, 115, 0.48);
  background: rgba(8, 18, 27, 0.88);
  color: #e7f6ff;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}

.script-stepper-shell input::-webkit-outer-spin-button,
.script-stepper-shell input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.audio-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(52, 87, 115, 0.58);
  border-radius: 8px;
  background: rgba(4, 9, 14, 0.54);
  padding: 14px;
}

.audio-panel.is-playing {
  border-color: rgba(21, 209, 160, 0.56);
  box-shadow: inset 0 0 0 1px rgba(21, 209, 160, 0.08), 0 0 18px rgba(21, 209, 160, 0.08);
}

.audio-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.audio-panel-head div {
  display: grid;
  gap: 3px;
}

.audio-panel-head label {
  color: #e9f8ff;
  font-size: 13px;
  font-weight: 900;
}

.audio-panel-head span:not(.audio-chip) {
  color: #7e9bb2;
  font-size: 12px;
}

.audio-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(21, 209, 160, 0.3);
  border-radius: 999px;
  background: rgba(21, 209, 160, 0.09);
  color: #72efc9;
  font-size: 11px;
  font-weight: 900;
  padding: 0 10px;
}

.preview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.preview-row .ghost {
  height: 38px;
}

.preview-row .accent-action {
  border-color: rgba(36, 213, 255, 0.46);
  background: rgba(36, 213, 255, 0.1);
  color: #c9f4ff;
}

.preview-row .stop-action {
  border-color: rgba(255, 91, 91, 0.58);
  background: rgba(105, 18, 30, 0.42);
  color: #ff8f8f;
}

.preview-row .stop-action:hover:not(:disabled) {
  border-color: rgba(255, 107, 107, 0.88);
  background: rgba(255, 107, 107, 0.16);
  color: #ffffff;
}

.upload-dropzone {
  display: grid;
  min-height: 118px;
  justify-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed rgba(36, 213, 255, 0.38);
  border-radius: 8px;
  background: rgba(4, 9, 13, 0.58);
  color: #dff3ff;
  padding: 16px;
  text-align: center;
}

.upload-dropzone .ui-icon {
  color: #6fe3ff;
}

.upload-dropzone strong {
  max-width: 100%;
  overflow: hidden;
  color: #f3fbff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-dropzone small {
  color: #8ca9c0;
  font-size: 12px;
}

.audio-progress {
  height: 7px;
  overflow: hidden;
  border: 1px solid rgba(21, 209, 160, 0.34);
  border-radius: 999px;
  background: rgba(3, 13, 14, 0.74);
}

.audio-progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #19c37d, #7df7ca);
  box-shadow: 0 0 14px rgba(21, 209, 160, 0.45);
  transition: width 0.12s linear;
}

.script-upload-control.hidden,
.script-tts-control.hidden,
.script-ai-agent-panel.hidden,
.form-field.hidden,
.preview-row .hidden,
.audio-progress.hidden {
  display: none;
}

.modal-action-row {
  display: grid;
  grid-template-columns: minmax(112px, auto) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 2px;
}

.modal-action-row .modal-primary {
  margin-top: 0;
}

.danger-button {
  border-color: rgba(255, 107, 107, 0.42);
  background: rgba(79, 18, 28, 0.34);
  color: #ff8f8f;
}

.danger-button:hover:not(:disabled) {
  border-color: rgba(255, 107, 107, 0.8);
  background: rgba(255, 107, 107, 0.14);
  color: #ffffff;
}

.modal-primary {
  height: 46px;
  margin-top: 4px;
  background: var(--button-bg);
  color: var(--button-text);
  box-shadow: 0 12px 26px rgba(19, 168, 214, 0.16);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.inbound-actions {
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr) minmax(120px, auto);
}

.inbound-actions .inline-status {
  justify-content: center;
}

.transport-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.transport-picker button {
  display: grid;
  height: 66px;
  align-content: center;
  justify-items: center;
  gap: 6px;
  border-color: rgba(52, 87, 115, 0.76);
  background: rgba(8, 16, 24, 0.82);
  color: #d9eefc;
}

.transport-picker button.active {
  border-color: #15d1a0;
  box-shadow: inset 0 0 0 1px rgba(21, 209, 160, 0.35);
}

.transport-picker button.probe-up {
  border-color: rgba(21, 209, 160, 0.64);
}

.transport-picker button.probe-down {
  border-color: rgba(255, 107, 107, 0.42);
  color: #9fb2c2;
}

.transport-main {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #eefaff;
  font-size: 13px;
  font-weight: 900;
}

.transport-picker button .transport-sub {
  color: #86a3bb;
  font-size: 11px;
}

.app-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 110;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  width: min(420px, calc(100vw - 32px));
  border: 1px solid rgba(21, 209, 160, 0.7);
  border-radius: 8px;
  background: rgba(5, 31, 22, 0.96);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  padding: 14px;
  overflow: hidden;
}

.app-toast.hidden {
  display: none;
}

.app-toast.toast-success {
  border-color: rgba(21, 209, 160, 0.72);
  background: rgba(5, 31, 22, 0.96);
}

.app-toast.toast-error {
  border-color: rgba(255, 91, 108, 0.75);
  background: rgba(43, 9, 17, 0.96);
}

.toast-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: rgba(21, 209, 160, 0.18);
  color: #25f0b4;
  font-size: 11px;
  font-weight: 900;
}

.app-toast.toast-error .toast-icon {
  background: rgba(255, 91, 108, 0.18);
  color: #ff9aa6;
}

.app-toast strong,
.app-toast span {
  display: block;
}

.app-toast strong {
  color: #f1fff9;
}

.app-toast span {
  margin-top: 4px;
  color: #a8c6ba;
  font-size: 13px;
}

.app-toast button {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #8fb6a7;
}

.toast-timer {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: #15d1a0;
  transform-origin: right center;
  animation: toastDrain var(--toast-duration, 4200ms) linear forwards;
}

.app-toast.toast-error .toast-timer {
  background: #ff5b6c;
}

.app-toast.toast-reset .toast-timer {
  animation: none;
}

@keyframes toastDrain {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.worker-profile-banner {
  height: 74px;
  background:
    linear-gradient(135deg, rgba(88, 101, 242, 0.92), rgba(35, 165, 90, 0.78)),
    #2b3038;
}

.worker-profile-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(7, 12, 18, 0.64);
  color: #f4f7fb;
}

.worker-profile-body {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.worker-profile-avatar {
  width: 74px;
  height: 74px;
  margin-top: -34px;
  border: 5px solid #111318;
  border-radius: 999px;
  background: #111318;
}

.worker-profile-avatar .team-avatar {
  width: 64px;
  height: 64px;
  font-size: 20px;
}

.worker-profile-body h2 {
  margin: 0;
  color: #ffffff;
  font-size: 21px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.worker-profile-status {
  margin: -4px 0 0;
  color: #b8c0cc;
  font-size: 13px;
}

.worker-profile-meta {
  display: grid;
  gap: 7px;
  border-top: 1px solid rgba(78, 86, 101, 0.55);
  padding-top: 10px;
}

.worker-profile-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #d7dbe2;
  font-size: 12px;
}

.worker-profile-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.worker-profile-actions button[hidden] {
  display: none;
}

.voice-state-icons {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-left: auto;
}

.participant-label .voice-state-icons {
  margin-left: 0;
}

.voice-state-icons.empty {
  display: none;
}

.voice-state-icon {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: #9ca3af;
}

.voice-state-icon.server {
  color: #ed4245;
}

.voice-state-icon svg {
  display: block;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.05;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.participant-status,
.call-state-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(121, 167, 203, 0.34);
  border-radius: 999px;
  padding: 2px 7px;
  color: #a8d9f1;
  font-size: 10px;
  text-transform: uppercase;
}

.call-state-badge.held {
  border-color: #ffd166;
  color: #ffe6a0;
}

.channel-actions {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.log-line {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 6px 0;
}

.lvl-info {
  color: #8ac8ff;
}

.lvl-success {
  color: var(--ok);
}

.lvl-warn {
  color: var(--warn);
}

.lvl-error {
  color: var(--err);
}

.lvl-ami {
  color: #f6ffb3;
}

.lvl-pbx {
  color: #f6ffb3;
}

.webphone-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  width: 92px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid #32e7c2;
  background: linear-gradient(135deg, #102126, #163b3b 58%, #243018);
  color: #ccfff4;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 22px rgba(50, 231, 194, 0.2);
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.toggle-light {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #31ff8b;
  box-shadow: 0 0 12px rgba(49, 255, 139, 0.85);
}

.webphone-toggle span:last-child {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.webphone-panel {
  position: fixed;
  right: 18px;
  bottom: 74px;
  z-index: 21;
  width: min(382px, calc(100vw - 26px));
  max-height: calc(100vh - 92px);
  overflow: hidden auto;
  background:
    linear-gradient(180deg, rgba(38, 47, 53, 0.98), rgba(20, 29, 35, 0.99)),
    linear-gradient(90deg, rgba(50, 231, 194, 0.14), rgba(255, 77, 109, 0.08));
  border: 1px solid #6d8790;
  border-radius: 8px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(50, 231, 194, 0.1) inset;
  padding: 14px 14px 10px;
}

.webphone-panel.hidden {
  display: none;
}

.webphone-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(120deg, transparent 0%, rgba(50, 231, 194, 0.18) 42%, transparent 58%);
  background-size: 100% 7px, 180px 100%;
}

.webphone-head,
.webphone-view,
.webphone-settings,
.form-message,
.webphone-console,
#wp-remote-audio {
  position: relative;
  z-index: 1;
}

.webphone-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding-bottom: 12px;
}

.webphone-identity p {
  margin: 0 0 8px;
  font-size: 13px;
  color: #aebcc0;
}

.webphone-identity strong {
  color: #f7fbff;
}

#wp-mic-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #7d5d25;
  color: #ffd480;
  background: rgba(82, 53, 12, 0.45);
  font-size: 10px;
  font-weight: 800;
}

#wp-mic-badge.ready {
  border-color: #16895d;
  color: #9dffd5;
  background: rgba(13, 84, 61, 0.4);
}

#wp-open-settings {
  height: auto;
  margin-left: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #32e7c2;
  font-size: 12px;
  font-weight: 800;
}

.webphone-head-actions {
  display: flex;
  align-items: start;
  gap: 6px;
}

.icon-button,
.logout {
  height: 30px;
  min-width: 34px;
  border-radius: 4px;
  border: 1px solid #7b3d4a;
  background: rgba(64, 21, 31, 0.45);
  color: #ff9eaf;
  padding: 0 9px;
  font-size: 11px;
}

.icon-button {
  border-color: #4d6d78;
  color: #d9eef3;
  background: rgba(18, 34, 40, 0.72);
}

.webphone-settings {
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid #50666d;
  border-radius: 8px;
  background: rgba(17, 28, 33, 0.86);
}

.webphone-settings.hidden {
  display: none;
}

.advanced-sip-fields.hidden {
  display: none;
}

.route-summary,
.route-strip {
  border: 1px solid rgba(211, 233, 238, 0.18);
  border-radius: 8px;
  background: rgba(12, 22, 27, 0.34);
  color: #d9eef3;
}

.route-summary {
  min-height: 38px;
  padding: 9px 10px;
  font-size: 12px;
  line-height: 1.35;
}

.live-only-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 8px;
  align-items: center;
}

.launch-live-only-row {
  grid-template-columns: minmax(0, 1fr) 152px;
  align-items: stretch;
}

.switch-row,
.ring-window {
  min-height: 38px;
  border: 1px solid rgba(211, 233, 238, 0.18);
  border-radius: 8px;
  background: rgba(12, 22, 27, 0.34);
  color: #d9eef3;
}

.switch-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0 10px;
  font-size: 12px;
}

.switch-row input {
  width: 18px;
  height: 18px;
  accent-color: #32e7c2;
}

.ring-window {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 6px;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
}

.ring-window input {
  width: 100%;
  height: 26px;
  border: 1px solid rgba(211, 233, 238, 0.18);
  border-radius: 6px;
  background: rgba(18, 34, 40, 0.72);
  color: #f7fbff;
  text-align: center;
}

.voice-sensitivity {
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px 38px;
  gap: 9px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(211, 233, 238, 0.18);
  border-radius: 8px;
  background: rgba(12, 22, 27, 0.34);
  color: #d9eef3;
  font-size: 12px;
}

.voice-sensitivity input {
  width: 100%;
  accent-color: #32e7c2;
}

.voice-sensitivity strong {
  color: #32e7c2;
  font-size: 11px;
  text-align: right;
}

.launch-live-only-row .switch-row,
.launch-live-only-row .ring-window {
  min-height: 46px;
}

.launch-live-only-row .ring-window {
  grid-template-columns: minmax(0, 1fr) 64px;
  padding: 0 10px 0 12px;
  border-color: rgba(36, 213, 255, 0.32);
  background: rgba(8, 24, 32, 0.58);
  font-size: 12px;
}

.launch-live-only-row .ring-window input {
  height: 34px;
  border-color: rgba(36, 213, 255, 0.46);
  background: rgba(4, 13, 20, 0.92);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
}

.route-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px 10px;
}

.route-strip span {
  color: #9eb6bc;
  font-size: 12px;
}

.route-strip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f7fbff;
}

.route-strip button {
  height: 28px;
  padding: 0 8px;
  border-color: #4d6d78;
  background: rgba(18, 34, 40, 0.72);
  color: #32e7c2;
  font-size: 11px;
}

.webphone-grid {
  display: grid;
  gap: 8px;
}

.webphone-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.webphone-view {
  display: none;
}

.webphone-view.active {
  display: block;
}

.dial-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 9px;
  align-items: center;
  margin: 0 0 14px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(93, 105, 113, 0.55);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22) inset;
}

.dial-entry input {
  height: 44px;
  border: 0;
  background: transparent;
  color: #f7fbff;
  text-align: center;
  font-size: 14px;
  font-family: Consolas, "Lucida Console", monospace;
}

.dial-entry input::placeholder {
  color: rgba(230, 238, 240, 0.42);
}

.call-button {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid #0cc56c;
  background: linear-gradient(135deg, #30f28b, #068448);
  color: #052214;
  font-size: 10px;
  box-shadow: 0 0 24px rgba(48, 242, 139, 0.28);
}

.webphone-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 -14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.webphone-tabs button {
  height: 48px;
  border: 0;
  border-radius: 0;
  background: rgba(34, 43, 48, 0.92);
  color: #f4f7f8;
  font-size: 14px;
}

.webphone-tabs button.active {
  background: linear-gradient(180deg, rgba(46, 79, 84, 0.96), rgba(39, 86, 92, 0.96));
  color: #ffffff;
}

.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
}

.dialpad {
  margin: 0 -14px;
  padding: 14px 22px 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 18px;
  background:
    linear-gradient(180deg, rgba(46, 92, 98, 0.88), rgba(42, 82, 88, 0.9)),
    linear-gradient(to right, rgba(50, 231, 194, 0.12), rgba(255, 77, 109, 0.08));
  border: 1px solid rgba(180, 206, 211, 0.16);
  border-top: 0;
  border-radius: 0 0 8px 8px;
}

.dialpad button {
  height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #f5fbfc;
  font-weight: 800;
  display: grid;
  gap: 1px;
  place-items: center;
}

.dialpad button:hover,
.dialpad button:focus-visible {
  border-color: rgba(50, 231, 194, 0.56);
  background: rgba(255, 255, 255, 0.06);
}

.dialpad span {
  font-size: 15px;
  line-height: 1;
}

.dialpad small {
  color: rgba(229, 239, 242, 0.7);
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
}

.history-list {
  min-height: 250px;
  margin: 0 -14px;
  padding: 12px 12px 18px;
  background: rgba(42, 82, 88, 0.88);
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid rgba(180, 206, 211, 0.16);
  border-top: 0;
  border-radius: 0 0 8px 8px;
}

.history-empty,
.history-item {
  border: 1px solid rgba(211, 233, 238, 0.18);
  border-radius: 8px;
  background: rgba(12, 22, 27, 0.34);
  color: #ecf8fa;
  padding: 10px;
  font-size: 12px;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  text-align: left;
}

.history-item b,
.history-item span {
  display: block;
}

.history-item span {
  color: #b8c9ce;
  margin-top: 3px;
}

.call-view {
  min-height: min(620px, calc(100vh - 170px));
  padding: 44px 8px 16px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(47, 86, 94, 0.9), rgba(42, 76, 82, 0.94)),
    linear-gradient(90deg, rgba(50, 231, 194, 0.1), rgba(255, 77, 109, 0.08));
  border: 1px solid rgba(180, 206, 211, 0.25);
  border-radius: 8px;
  overflow: hidden;
}

.call-view h2 {
  margin: 0;
  font-size: 28px;
  color: #ffffff;
}

.call-state {
  margin: 146px 0 0;
  color: #ffffff;
  font-size: 26px;
  font-weight: 800;
}

.call-number {
  margin: 78px 0 0;
  color: #ffffff;
  font-size: 48px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.call-carrier {
  margin: 26px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 22px;
  font-weight: 800;
}

.call-timer {
  display: none;
  margin: 14px 0 0;
  color: #9dffd5;
  font-family: Consolas, "Lucida Console", monospace;
  font-size: 15px;
}

.call-orbit {
  position: absolute;
  left: 50%;
  top: 190px;
  width: 130px;
  height: 130px;
  transform: translateX(-50%);
  pointer-events: none;
}

.call-orbit span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid rgba(50, 231, 194, 0.38);
  animation: ringPulse 2.4s infinite ease-out;
}

.call-orbit span:nth-child(2) {
  animation-delay: 0.45s;
  border-color: rgba(255, 77, 109, 0.26);
}

.call-orbit span:nth-child(3) {
  animation-delay: 0.9s;
  border-color: rgba(255, 209, 102, 0.22);
}

.call-controls {
  display: none;
  gap: 10px;
  margin: 34px 0 18px;
}

.incoming-controls {
  grid-template-columns: 1fr 1fr;
}

.active-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.control-button,
.answer-button,
.hangup-button {
  height: 58px;
  border-radius: 8px;
  color: #f7fbff;
}

.control-button {
  border-color: rgba(221, 238, 242, 0.34);
  background: rgba(16, 27, 33, 0.46);
}

.control-button.active {
  border-color: #ffd166;
  color: #fff2c2;
  background: rgba(113, 76, 16, 0.45);
}

.answer-button {
  border-color: #30f28b;
  background: linear-gradient(135deg, #2dde83, #077241);
  color: #052214;
}

.hangup-button,
.hangup-strip {
  border-color: #ff6177;
  background: linear-gradient(135deg, #d94758, #76202c);
  color: #ffe9ed;
}

.hangup-strip {
  display: none;
  width: min(100%, 260px);
  height: 82px;
  margin: 28px auto 0;
  border-radius: 8px;
  font-size: 12px;
  letter-spacing: 0;
}

.webphone-panel.mode-calling .hangup-strip,
.webphone-panel.mode-active .hangup-strip {
  display: block;
}

.webphone-panel.mode-incoming .incoming-controls,
.webphone-panel.mode-active .active-controls {
  display: grid;
}

.webphone-panel.mode-active .call-timer {
  display: block;
}

.webphone-panel.mode-active .call-state {
  margin-top: 86px;
}

.webphone-panel.mode-active .call-number {
  margin-top: 44px;
  font-size: 42px;
}

.webphone-panel.mode-active .call-carrier {
  margin-top: 16px;
  font-size: 19px;
}

.webphone-panel.mode-active .hangup-strip {
  height: 58px;
  margin-top: 10px;
}

.webphone-console {
  display: none;
}

@keyframes ringPulse {
  0% {
    transform: scale(0.45);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

@media (max-width: 960px) {
  .dashboard-grid,
  .settings-grid,
  .settings-grid-wide,
  .subscription-showcase,
  .subscription-feature-grid,
  .subscription-actions,
  .ai-pipeline,
  .telegram-grid,
  .telegram-toggle-grid,
  .telegram-preview-grid {
    grid-template-columns: 1fr;
  }

  .trunk-row,
  .inbound-row,
  .form-grid-2,
  #script-form,
  .ai-chat-form,
  .script-routing-card,
  #script-form .segmented-control-icons,
  .script-ai-agent-steps,
  .script-seconds-control,
  .transport-picker,
  .ai-agent-tabs,
  .theme-picker,
  .inbound-actions,
  .telegram-actions,
  .modal-action-row {
    grid-template-columns: 1fr;
  }

  .ai-agent-hero-panel {
    display: grid;
  }

  .page-head {
    display: grid;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .live-ops {
    grid-template-columns: 1fr;
  }

  .app-bar {
    align-items: center;
  }

  .callcenter-page,
  body[data-active-page="callcenter"] .callcenter-page {
    grid-template-columns: 58px minmax(190px, 42vw) minmax(0, 1fr);
  }

  .callcenter-rail {
    padding: 10px 6px;
  }

  .callcenter-mark,
  .callcenter-rail-btn {
    width: 44px;
    height: 44px;
  }

  .title-wrap h1 {
    font-size: 32px;
  }

  .console {
    max-height: 460px;
    min-height: 300px;
  }

  .webphone-panel {
    right: 10px;
    bottom: 64px;
    width: calc(100vw - 20px);
    max-height: calc(100vh - 78px);
  }

  .webphone-toggle {
    right: 10px;
    bottom: 10px;
  }

  .call-view {
    min-height: min(560px, calc(100vh - 150px));
  }

  .call-state {
    margin-top: 118px;
  }

  .call-number {
    margin-top: 58px;
    font-size: 38px;
  }

  .worker-profile-popover {
    left: 10px !important;
    right: 10px;
    width: auto;
  }
}
