:root {
  color-scheme: light;
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-alt: #f7f9fb;
  --ink: #152033;
  --muted: #667085;
  --line: #d9e1ea;
  --line-soft: #edf1f5;
  --accent: #0b7d68;
  --accent-dark: #075f50;
  --accent-soft: #dcf7ed;
  --brand-navy: #11152d;
  --brand-rust: #b94f17;
  --brand-yellow: #f5c400;
  --gold: #b7791f;
  --red: #b42318;
  --green: #067647;
  --blue: #175cd3;
  --sidebar: #11152d;
  --shadow: 0 18px 42px rgba(24, 33, 47, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.auth-locked {
  min-height: 100vh;
  background: #f5f7fa;
}

body.auth-locked #app {
  display: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

#app {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 16px;
  background:
    linear-gradient(180deg, rgba(17, 21, 45, 0.98), rgba(14, 24, 48, 0.98) 64%, rgba(55, 24, 16, 0.98)),
    var(--sidebar);
  color: #f9fafb;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 18px;
  line-height: 1.05;
}

.brand span {
  color: #f5d56b;
  font-size: 12px;
  font-weight: 760;
  margin-top: 2px;
}

.mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #ffffff;
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 0;
  overflow: hidden;
}

.mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav {
  display: grid;
  gap: 5px;
}

.nav-section {
  padding: 12px 10px 3px;
  color: #8794a6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-item {
  width: 100%;
  min-height: 38px;
  padding: 9px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  font-weight: 650;
}

.nav-item:hover,
.nav-item.active {
  background: #243142;
  color: #ffffff;
}

.status-list {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #aeb8c7;
  font-size: 12px;
}

.status-row strong {
  color: #ffffff;
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding-bottom: 13px;
  border-bottom: 3px solid rgba(185, 79, 23, 0.16);
}

.topbar::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: min(280px, 46%);
  height: 3px;
  background: var(--brand-yellow);
}

.topbar-brandline {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: 100%;
  min-height: 44px;
  padding: 0 0 2px;
  color: var(--brand-navy);
  font-weight: 820;
}

.topbar-brandline::after {
  content: "";
  position: absolute;
  left: 24px;
  right: -18px;
  bottom: 5px;
  z-index: -1;
  height: 10px;
  background: rgba(245, 196, 0, 0.28);
  transform: skewX(-18deg);
}

.topbar-brandline img {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 10px 22px rgba(17, 21, 45, 0.13);
}

.topbar-brandline strong {
  font-size: 18px;
  letter-spacing: 0;
}

.topbar-brandline span {
  color: var(--brand-rust);
  font-size: 13px;
  font-weight: 760;
}

.signal-surface {
  position: relative;
  overflow: hidden;
}

.signal-surface > * {
  position: relative;
  z-index: 1;
}

.signal-surface::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--brand-rust), var(--brand-yellow) 48%, var(--accent));
}

.signal-surface::after {
  content: "";
  position: absolute;
  top: 22px;
  right: 22px;
  width: 170px;
  height: 170px;
  background: url("/assets/app-icon-192.png") center / contain no-repeat;
  opacity: 0.045;
  pointer-events: none;
  transform: rotate(-4deg);
}

.command-center.signal-surface::after {
  top: 44px;
  right: 30px;
  width: 190px;
  height: 190px;
}

.global-search-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin: -8px 0 20px;
}

.global-search-results[hidden] {
  display: none;
}

.search-result {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
}

.search-result span:last-child {
  color: var(--muted);
  font-size: 13px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.12;
}

h2 {
  font-size: 16px;
  line-height: 1.3;
}

.topbar p,
.panel-head span {
  color: var(--muted);
  margin-top: 5px;
}

.top-actions,
.quick-actions,
.dialog-actions,
.call-controls,
.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.panel-actions {
  padding: 0 16px 14px;
  justify-content: flex-start;
}

.panel-actions.inline {
  padding: 0;
  justify-content: flex-end;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search input {
  width: min(320px, 26vw);
  min-width: 220px;
}

.button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 720;
  white-space: nowrap;
}

.button.primary {
  background: var(--accent);
  color: #ffffff;
}

.button.primary:hover {
  background: var(--accent-dark);
}

.button.secondary {
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
}

.top-logout {
  border-color: #c9d4e2;
}

.button.danger {
  border-color: #ffd0c9;
  background: #fff5f3;
  color: var(--red);
}

.call-button {
  width: 100%;
  background: var(--green);
  color: #ffffff;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 20px;
}

.metrics,
.ops-board,
.queue-grid,
.analytics-grid,
.admin-grid,
.phone-grid,
.team-grid {
  display: grid;
  gap: 14px;
}

.metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric,
.panel,
.ops-card,
.queue-card,
.person-card,
.voicemail-item,
.thread-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric {
  display: grid;
  gap: 8px;
  padding: 17px;
}

.metric span,
.ops-card span,
.quality-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.metric strong {
  font-size: 30px;
  line-height: 1;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.8fr);
  gap: 20px;
}

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

.phone-grid,
.analytics-grid,
.admin-grid {
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.4fr);
}

.team-grid {
  grid-template-columns: minmax(0, 1fr);
}

.module-hero,
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 20px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 18px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px 0;
}

.status-card {
  display: grid;
  gap: 7px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--ink);
  text-align: left;
}

.status-card strong {
  font-size: 26px;
  line-height: 1;
}

.status-card span {
  color: var(--muted);
  font-size: 13px;
}

.module-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0;
}

.readiness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  padding: 16px 18px;
}

.readiness-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-alt);
}

.readiness-item strong,
.readiness-item span {
  min-width: 0;
}

.readiness-item span:not(.pill) {
  grid-column: 2;
  color: var(--muted);
  font-size: 13px;
}

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

.legal-link-grid .button {
  justify-content: center;
  min-height: 44px;
  text-decoration: none;
}

.inbox-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.7fr) minmax(0, 1.3fr);
  gap: 20px;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head.compact-head {
  min-height: 0;
  margin-top: 14px;
  padding: 14px 0 10px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.panel-head.compact-head h2 {
  font-size: 14px;
}

.panel-head div {
  min-width: 0;
}

.command-center {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.ops-board {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 18px;
}

.ops-card {
  display: grid;
  gap: 10px;
  box-shadow: none;
  padding: 14px;
}

.ops-card strong {
  font-size: 28px;
}

.bar {
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: #edf1f5;
}

.bar i {
  display: block;
  width: 8%;
  height: 100%;
  background: var(--accent);
}

.activity-stream,
.thread-list,
.conversation,
.voicemail-list,
.feature-list,
.agent-workspace,
.channel-board {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
}

.queue-grid > .empty,
.channel-board > .empty {
  grid-column: 1 / -1;
}

.activity-item,
.conversation-bubble,
.feature-item {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-alt);
}

.activity-item strong,
.conversation-bubble strong,
.thread-item strong,
.voicemail-item strong {
  font-size: 14px;
}

.activity-item span,
.conversation-bubble span,
.thread-item span,
.voicemail-item span,
.person-card span,
.feature-item span {
  color: var(--muted);
  font-size: 13px;
}

.dial-form {
  display: grid;
  gap: 13px;
  padding: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

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

.dialpad button {
  aspect-ratio: 1.55;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 18px;
  font-weight: 760;
}

.dialpad button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.home-call-card {
  display: grid;
  gap: 9px;
  padding: 18px;
  border-top: 1px solid var(--line-soft);
}

.home-call-card strong {
  font-size: 18px;
}

.home-call-card span:not(.pill) {
  color: var(--muted);
  line-height: 1.45;
}

.call-console-panel {
  overflow: hidden;
}

.dialpad-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 62px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.dialpad-topline h2 {
  margin: 0;
  font-size: 21px;
}

.dialpad-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dialpad-brand img {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 2px solid rgba(245, 196, 0, 0.5);
  border-radius: 11px;
  object-fit: cover;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
}

.dialpad-brand div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.dialpad-brand span {
  color: var(--brand-yellow);
  font-size: 12px;
  font-weight: 860;
  text-transform: uppercase;
}

.dialpad-state {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.dialpad-clock {
  min-width: 68px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
  text-align: center;
}

.call-console {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(260px, 1fr);
  align-items: start;
  gap: 22px;
  padding: clamp(16px, 3vw, 28px);
  background: #f8fafc;
}

.handset,
.call-side,
.softphone-setup {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.handset {
  width: 100%;
  max-width: 520px;
  justify-self: center;
  align-content: start;
  padding: clamp(14px, 2vw, 18px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(21, 32, 51, 0.08);
}

.call-side {
  align-content: start;
}

.number-entry {
  display: grid;
  gap: 7px;
}

.number-entry span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.number-entry input {
  min-height: 60px;
  font-size: 24px;
  font-weight: 800;
  text-align: center;
}

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

.handset-dialpad button {
  min-height: clamp(76px, 9vw, 96px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 29px;
  font-weight: 840;
  box-shadow: 0 10px 22px rgba(21, 32, 51, 0.05);
}

.handset-dialpad button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.primary-call-actions,
.active-call-actions {
  display: grid;
  gap: 10px;
}

.primary-call-actions {
  grid-template-columns: minmax(150px, 1.45fr) repeat(3, minmax(0, 1fr));
}

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

.call-primary-row .button,
.call-secondary-row .button {
  min-width: 0;
  min-height: 54px;
  padding-inline: 10px;
}

.call-primary-row .call-button {
  font-size: 17px;
}

.bucket-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bucket-actions .button {
  flex: 1 1 auto;
}

.active-call-summary {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-alt);
}

.active-call-summary div {
  display: grid;
  gap: 7px;
}

.active-call-summary strong {
  font-size: 18px;
}

.active-call-summary span:not(.pill) {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.control-bucket {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
}

.control-bucket summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  padding: 12px 14px;
  list-style: none;
  font-weight: 760;
}

.control-bucket summary::-webkit-details-marker {
  display: none;
}

.control-bucket summary::after {
  content: "+";
  color: var(--muted);
  font-weight: 840;
}

.control-bucket[open] summary::after {
  content: "-";
}

.control-bucket > :not(summary) {
  margin: 0 14px 14px;
}

.call-console-panel > .call-history-bucket {
  margin: 0 clamp(16px, 3vw, 28px) clamp(16px, 3vw, 28px);
}

.softphone-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.3fr);
  gap: 16px;
  padding: 16px;
  border-top: 1px solid var(--line-soft);
}

.softphone-setup,
.softphone-console {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.softphone-health {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-alt);
}

.softphone-health strong,
.softphone-health span {
  overflow-wrap: anywhere;
}

.softphone-health span {
  color: var(--muted);
  font-size: 12px;
}

.softphone-display {
  display: grid;
  gap: 7px;
  min-height: 96px;
  align-content: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.softphone-display strong {
  font-size: 20px;
  overflow-wrap: anywhere;
}

.softphone-display span {
  overflow-wrap: anywhere;
}

.softphone-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.softphone-dtmf {
  display: grid;
  grid-template-columns: repeat(6, minmax(42px, 1fr));
  gap: 8px;
}

.softphone-dtmf button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 17px;
  font-weight: 760;
}

.softphone-dtmf button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.handset-dialpad button {
  min-height: clamp(76px, 9vw, 96px);
  background: #ffffff;
  font-size: 29px;
  font-weight: 840;
}

.softphone-panel [data-softphone-list],
.call-history-bucket [data-softphone-list] {
  max-height: 440px;
  overflow: auto;
  border-top: 1px solid var(--line-soft);
}

.call-stage {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 13px;
  min-height: 310px;
  padding: 24px;
  text-align: center;
}

.call-route-plan {
  display: grid;
  width: 100%;
  gap: 12px;
  margin-top: 4px;
  text-align: left;
}

.route-summary,
.route-step {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-alt);
}

.route-summary strong,
.route-step strong {
  font-size: 14px;
}

.route-summary span,
.route-step span,
.route-step small {
  color: var(--muted);
  font-size: 12px;
}

.route-steps {
  display: grid;
  max-height: 300px;
  gap: 8px;
  overflow: auto;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

.fax-actions,
.channel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.call-stage strong {
  font-size: 24px;
}

.table {
  overflow-x: auto;
}

.row,
.table-head {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) minmax(130px, 1fr) minmax(120px, 0.8fr) minmax(160px, 1fr);
  align-items: center;
  min-width: 720px;
  gap: 16px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.table-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.row:last-child {
  border-bottom: 0;
}

.row strong,
.row span {
  display: block;
  overflow-wrap: anywhere;
}

.row span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

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

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.contact-actions {
  justify-content: flex-start;
  padding: 0 16px 10px;
}

.contact-live-panel {
  overflow: hidden;
}

.compact-tools-panel {
  overflow: hidden;
}

.tool-drawer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.tool-drawer summary::-webkit-details-marker {
  display: none;
}

.tool-drawer summary h2 {
  margin: 0;
}

.tool-drawer summary span {
  color: var(--muted);
}

.drawer-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.tool-drawer[open] .drawer-toggle {
  border-color: rgba(11, 125, 104, 0.3);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.tool-toggle-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  padding: 0 18px 18px;
}

.tool-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--ink);
  text-align: left;
}

.tool-toggle-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.tool-toggle-copy strong,
.tool-toggle-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-toggle-copy small,
.tool-toggle-state {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.switch-track {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #cfd8e3;
  transition: background 160ms ease;
}

.switch-track i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(21, 32, 51, 0.25);
  transition: transform 160ms ease;
}

.tool-toggle.is-on {
  border-color: rgba(11, 125, 104, 0.32);
  background: #f0fbf6;
}

.tool-toggle.is-on .switch-track {
  background: var(--accent);
}

.tool-toggle.is-on .switch-track i {
  transform: translateX(18px);
}

.tool-toggle.is-on .tool-toggle-state {
  color: var(--accent-dark);
}

.pill {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-height: 25px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.pill.ok {
  border-color: #abefc6;
  background: #ecfdf3;
  color: var(--green);
}

.pill.warn {
  border-color: #fedf89;
  background: #fffaeb;
  color: var(--gold);
}

.pill.danger {
  border-color: #fecdca;
  background: #fffbfa;
  color: var(--red);
}

.pill.info {
  border-color: #b2ddff;
  background: #eff8ff;
  color: var(--blue);
}

.empty {
  padding: 28px 18px;
  color: var(--muted);
}

.thread-item,
.voicemail-item,
.person-card,
.queue-card,
.module-card,
.channel-card,
.interaction-card {
  display: grid;
  gap: 7px;
  box-shadow: none;
  padding: 13px;
}

.module-card {
  align-content: start;
}

.module-card strong {
  font-size: 15px;
}

.module-card span,
.channel-card span,
.interaction-card span {
  color: var(--muted);
  font-size: 13px;
}

.feature-list.dense {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.feature-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.feature-item .pill {
  grid-row: 1 / span 2;
  grid-column: 2;
}

.feature-matrix {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.feature-section {
  display: grid;
  gap: 10px;
}

.feature-section h3 {
  margin: 0;
  font-size: 17px;
}

.feature-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 10px;
}

.compact-filter {
  min-width: 220px;
}

.thread-item {
  text-align: left;
  cursor: pointer;
}

.thread-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.conversation {
  min-height: 390px;
  align-content: start;
}

.conversation-bubble.outbound {
  margin-left: auto;
  max-width: 78%;
  background: #ecfdf3;
}

.conversation-bubble.inbound {
  margin-right: auto;
  max-width: 78%;
}

.composer {
  display: grid;
  grid-template-columns: minmax(150px, 0.65fr) minmax(220px, 1fr) minmax(160px, 0.7fr) auto;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}

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

.queue-card strong {
  font-size: 26px;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 18px;
}

.person-card {
  position: relative;
  min-height: 118px;
}

.presence {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
}

.presence-busy .presence,
.presence-dnd .presence,
.presence-on-call .presence {
  background: var(--gold);
}

.presence-offline .presence {
  background: var(--muted);
}

.webhook-box {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.webhook-box div {
  display: grid;
  gap: 6px;
}

.webhook-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

code {
  display: block;
  overflow-x: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  color: #263241;
}

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

.wide {
  grid-column: 1 / -1;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.check input {
  width: 18px;
  height: 18px;
}

.chart {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.chart-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
}

.chart-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.chart-track {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #e7edf3;
}

.chart-track i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.quality-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.auth-session-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 18px 0;
}

.auth-session-strip > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-alt);
}

.auth-session-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.auth-session-strip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-session-actions {
  align-content: start;
}

.supervisor-grid,
.security-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.supervisor-grid div,
.security-grid div {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-alt);
}

.supervisor-grid span,
.security-grid span {
  color: var(--muted);
  font-size: 13px;
}

.supervisor-grid strong {
  font-size: 24px;
}

.quality-grid div {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-alt);
}

.quality-grid strong {
  font-size: 22px;
}

dialog {
  width: min(520px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 28px 80px rgba(17, 24, 39, 0.28);
}

.wide-dialog {
  width: min(840px, calc(100vw - 28px));
}

dialog::backdrop {
  background: rgba(17, 24, 39, 0.42);
}

.dialog-body {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.dialog-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

[data-activation-link-output] {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-all;
  resize: vertical;
}

.compact-form {
  padding: 0;
}

.mfa-setup {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 12px 14px;
  align-items: start;
}

.mfa-setup label {
  min-width: 0;
}

.mfa-qr {
  display: grid;
  grid-row: span 2;
  place-items: center;
  width: 240px;
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.mfa-setup label:nth-of-type(1),
.mfa-setup label:nth-of-type(2) {
  grid-column: 2;
}

.mfa-setup label:nth-of-type(3),
.mfa-setup label:nth-of-type(4) {
  grid-column: 1 / -1;
}

.mfa-qr svg {
  display: block;
  width: 220px;
  height: 220px;
}

.ivr-builder {
  display: grid;
  gap: 10px;
}

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

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

.ivr-option-row {
  display: grid;
  grid-template-columns: 84px minmax(130px, 1.25fr) minmax(124px, 1fr) minmax(160px, 1.25fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-alt);
}

.ivr-option-row .button {
  min-height: 41px;
}

.route-option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.thread-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.auth-dialog {
  width: min(440px, calc(100vw - 28px));
}

body.auth-locked .auth-dialog[open],
body.auth-locked .mfa-dialog[open] {
  display: grid;
  place-items: center;
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 247, 250, 0.96)),
    #f5f7fa;
  box-shadow: none;
}

body.auth-locked .auth-dialog::backdrop,
body.auth-locked .mfa-dialog::backdrop {
  background: #f5f7fa;
}

.auth-dialog-body {
  gap: 14px;
}

body.auth-locked .auth-dialog-body,
body.auth-locked .mfa-dialog .dialog-body {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(24, 33, 47, 0.12);
}

body.auth-locked .auth-dialog-body {
  width: min(440px, calc(100vw - 32px));
}

.auth-dialog-body h2 {
  margin: 0 0 6px;
}

.auth-dialog-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.auth-error {
  padding: 10px 12px;
  border: 1px solid #ffd0c9;
  border-radius: 7px;
  background: #fff5f3;
  color: var(--red);
  font-size: 13px;
  font-weight: 720;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(460px, calc(100vw - 40px));
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--sidebar);
  color: #ffffff;
  box-shadow: var(--shadow);
}

@media (max-width: 1180px) {
	  .workspace-grid,
	  .phone-grid,
  .call-console,
	  .softphone-grid,
	  .inbox-layout,
  .analytics-grid,
  .admin-grid,
  .module-hero,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .search input {
    min-width: 180px;
    width: 22vw;
  }
}

@media (max-width: 920px) {
  #app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav,
  .metrics,
  .status-strip,
  .ops-board,
  .queue-grid,
  .quality-grid,
  .form-grid,
  .module-grid.two,
  .supervisor-grid,
  .security-grid,
  .auth-session-strip,
  .fax-composer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ivr-option-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ivr-option-row label:nth-of-type(2),
  .ivr-option-row label:nth-of-type(4) {
    grid-column: 1 / -1;
  }

  .topbar,
  .split {
    display: grid;
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: start;
  }

  .search {
    width: 100%;
  }

  .search input {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .main {
    padding: 16px;
  }

  .nav,
  .metrics,
  .status-strip,
  .ops-board,
  .queue-grid,
  .quality-grid,
  .form-grid,
  .composer,
  .module-grid.two,
  .supervisor-grid,
  .security-grid,
  .auth-session-strip,
	  .fax-composer {
	    grid-template-columns: 1fr;
	  }

  .dialpad-topline {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }

  .dialpad-state {
    justify-content: space-between;
    width: 100%;
  }

  .call-console {
    gap: 12px;
    padding: 12px;
  }

  .handset {
    padding: 12px;
    box-shadow: none;
  }

  .number-entry input {
    min-height: 56px;
    font-size: 22px;
  }

  .mfa-setup {
    grid-template-columns: 1fr;
  }

	  .mfa-qr {
	    grid-row: auto;
	    justify-self: center;
    width: min(280px, 100%);
    min-height: min(280px, calc(100vw - 80px));
	  }

  .mfa-qr svg {
    width: min(252px, calc(100vw - 112px));
    height: min(252px, calc(100vw - 112px));
  }

  .mfa-setup label:nth-of-type(1),
  .mfa-setup label:nth-of-type(2),
  .mfa-setup label:nth-of-type(3),
	  .mfa-setup label:nth-of-type(4) {
	    grid-column: auto;
	  }

  .primary-call-actions,
  .active-call-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bucket-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .primary-call-actions .call-button {
    grid-column: 1 / -1;
  }

  .primary-call-actions .button,
  .active-call-actions .button,
  .bucket-actions .button {
    width: 100%;
    min-width: 0;
  }

  .handset-dialpad button {
    min-height: 72px;
    font-size: 28px;
  }

  .ivr-option-row {
    grid-template-columns: 1fr;
  }

  .ivr-option-row label:nth-of-type(2),
  .ivr-option-row label:nth-of-type(4) {
    grid-column: auto;
  }

  .ivr-builder-head {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-head .button,
  .top-actions .button {
    width: 100%;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* Clean console overrides */
:root {
  --bg: #f5f7fa;
  --shadow: 0 10px 24px rgba(24, 33, 47, 0.06);
}

#app {
  grid-template-columns: 238px minmax(0, 1fr);
}

.sidebar {
  padding: 18px 14px;
}

.brand {
  padding-bottom: 16px;
}

.nav {
  gap: 3px;
}

.nav-item {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 13px;
}

.main {
  padding: 22px;
}

.topbar {
  margin-bottom: 18px;
}

.view.active {
  gap: 16px;
}

.metric {
  gap: 7px;
  padding: 14px;
}

.metric strong {
  font-size: 25px;
}

.panel-head {
  min-height: 58px;
  padding: 13px 16px;
}

.module-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
  padding: 14px;
}

.module-card {
  border-color: var(--line-soft);
  background: var(--surface-alt);
}

.activity-stream,
.thread-list,
.conversation,
.voicemail-list,
.feature-list,
.agent-workspace,
.channel-board {
  gap: 8px;
  padding: 14px 16px;
}

.dial-form,
.fax-composer {
  gap: 11px;
  padding: 16px;
}

.call-stage {
  min-height: 260px;
  padding: 20px;
}

.feature-list.dense {
  grid-template-columns: 1fr;
}

.feature-drawer {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.feature-drawer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  padding: 13px 16px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.feature-drawer summary::-webkit-details-marker {
  display: none;
}

.feature-drawer summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 840;
}

.feature-drawer[open] summary {
  border-bottom: 1px solid var(--line-soft);
}

.feature-drawer[open] summary::after {
  content: "-";
}

.feature-drawer summary strong {
  font-size: 14px;
}

.feature-drawer summary span:not(.pill) {
  flex: 1 1 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.feature-drawer > .panel-actions {
  padding: 14px 16px;
}

.feature-drawer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}

.feature-matrix {
  gap: 16px;
  padding: 16px;
}

.feature-section-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

.supervisor-grid,
.security-grid {
  gap: 10px;
  padding: 16px;
}

.file-warning {
  padding: 10px 14px;
  border-bottom: 1px solid #fedf89;
  background: #fffaeb;
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
}

.compact-table .row,
.compact-table .table-head {
  min-width: 640px;
}

@media (max-width: 920px) {
  #app {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .main {
    padding: 16px;
  }

}

/* Navigation and dialpad final pass */
.topbar-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.nav-toggle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(21, 32, 51, 0.06);
}

.nav-toggle span,
.nav-toggle::before,
.nav-toggle::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}

.nav-toggle {
  gap: 4px;
}

.nav-backdrop {
  display: none;
}

@media (min-width: 921px) {
  body.nav-collapsed #app {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  body.nav-collapsed .sidebar {
    padding: 18px 12px;
    align-items: center;
  }

  body.nav-collapsed .brand {
    justify-content: center;
    padding: 0 0 14px;
    border-color: transparent;
    background: transparent;
  }

  body.nav-collapsed .brand strong,
  body.nav-collapsed .brand span,
  body.nav-collapsed .nav-section,
  body.nav-collapsed .status-list {
    display: none;
  }

  body.nav-collapsed .mark {
    width: 48px;
    height: 48px;
  }

  body.nav-collapsed .nav {
    width: 52px;
  }

  body.nav-collapsed .nav-item {
    display: grid;
    place-items: center;
    min-height: 44px;
    padding: 0;
    font-size: 0;
  }

  body.nav-collapsed .nav-item::before {
    content: attr(data-short);
    font-size: 12px;
    font-weight: 860;
    letter-spacing: 0;
  }
}

.call-console-panel {
  border-color: #d8e3de;
  background: #11161d;
  box-shadow: 0 22px 54px rgba(20, 28, 38, 0.12);
}

.call-console-panel.signal-surface::before {
  background: linear-gradient(90deg, var(--brand-yellow), var(--brand-rust) 44%, var(--accent));
}

.call-console-panel.signal-surface::after {
  top: 76px;
  right: 34px;
  width: 220px;
  height: 220px;
  opacity: 0.055;
  z-index: 0;
}

.dialpad-topline {
  border-bottom-color: rgba(255, 255, 255, 0.1);
  background: #151a22;
  color: #ffffff;
}

.dialpad-topline h2 {
  font-size: 22px;
}

.dialpad-clock {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.call-console {
  position: relative;
  grid-template-columns: minmax(320px, 560px) minmax(260px, 0.9fr);
  gap: clamp(16px, 3vw, 30px);
  overflow: hidden;
  background:
    linear-gradient(135deg, #151a22 0%, #151a22 48%, #eef5f1 48%, #eef5f1 100%);
}

.call-console::after {
  content: "";
  position: absolute;
  right: clamp(18px, 4vw, 48px);
  bottom: clamp(16px, 3vw, 34px);
  width: min(28vw, 260px);
  aspect-ratio: 1;
  background: url("/assets/app-icon-192.png") center / contain no-repeat;
  opacity: 0.07;
  pointer-events: none;
  transform: rotate(-5deg);
}

.call-console > * {
  position: relative;
  z-index: 1;
}

.handset {
  max-width: 560px;
  padding: clamp(16px, 2.2vw, 22px);
  border: 0;
  background: #fbfdfc;
  box-shadow:
    0 26px 58px rgba(7, 13, 20, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.softphone-display {
  min-height: 108px;
  border-color: rgba(255, 255, 255, 0.08);
  background: #11161d;
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.softphone-display strong {
  font-size: 21px;
}

.softphone-display span {
  color: #bcc7d6;
}

.number-entry input {
  min-height: 64px;
  border-color: #cfd9e3;
  background: #ffffff;
  font-size: 26px;
  box-shadow: inset 0 1px 0 rgba(21, 32, 51, 0.04);
}

.handset-dialpad {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.handset-dialpad button {
  min-height: clamp(86px, 9vw, 106px);
  border: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f2f5f8 100%);
  font-size: 31px;
  box-shadow:
    0 12px 24px rgba(21, 32, 51, 0.08),
    inset 0 -1px 0 rgba(21, 32, 51, 0.08);
}

.handset-dialpad button:hover {
  background: linear-gradient(180deg, #effaf7 0%, #dcf3ed 100%);
}

.call-telemetry-panel {
  border-color: #d7e3df;
}

.telemetry-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px;
}

.call-telemetry {
  min-width: 0;
}

.telemetry-gauge-deck {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid #111c28;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 28%),
    radial-gradient(circle at 50% 0%, rgba(83, 128, 174, 0.22), transparent 42%),
    linear-gradient(180deg, #101923 0%, #070b10 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -18px 42px rgba(0, 0, 0, 0.32),
    0 14px 30px rgba(15, 23, 42, 0.16);
}

.instrument-gauge {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 0;
}

.instrument-face {
  position: relative;
  min-height: 178px;
  border: 1px solid rgba(8, 15, 25, 0.82);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.18), transparent 24%),
    radial-gradient(circle at 50% 56%, #253141 0%, #111a25 55%, #05080d 100%);
  box-shadow:
    inset 0 0 0 5px #d8e2ec,
    inset 0 0 0 9px #141e2b,
    inset 0 0 0 12px rgba(255, 255, 255, 0.04),
    inset 0 28px 50px rgba(255, 255, 255, 0.05),
    0 12px 22px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

.instrument-face::after {
  content: "";
  position: absolute;
  inset: 8px 10px auto;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent);
  pointer-events: none;
}

.instrument-svg {
  position: absolute;
  inset: 10px 10px auto;
  width: calc(100% - 20px);
  height: 132px;
}

.instrument-arc {
  fill: none;
  stroke: rgba(209, 222, 237, 0.7);
  stroke-width: 4;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px rgba(116, 170, 219, 0.25));
}

.instrument-tick {
  stroke: #f5f8fb;
  stroke-width: 2;
  stroke-linecap: round;
}

.instrument-tick-label {
  fill: #cdd8e6;
  font-size: 10px;
  font-weight: 760;
  text-anchor: middle;
  dominant-baseline: middle;
}

.instrument-needle-line {
  stroke: #eff8ff;
  stroke-width: 4;
  stroke-linecap: round;
  filter:
    drop-shadow(0 0 5px rgba(86, 168, 255, 0.7))
    drop-shadow(0 3px 3px rgba(0, 0, 0, 0.4));
}

.instrument-cap-svg {
  fill: #111a25;
  stroke: #dbe7f4;
  stroke-width: 5;
  filter: drop-shadow(0 7px 7px rgba(0, 0, 0, 0.42));
}

.instrument-cap-pin {
  fill: #86c6f3;
}

.instrument-readout {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(159, 176, 196, 0.24);
  border-radius: 7px;
  background: #070c12;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.instrument-readout strong,
.instrument-readout span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.instrument-readout strong {
  color: #e9f5ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 18px;
  line-height: 1;
}

.instrument-readout span {
  color: #8fa6bd;
  font-size: 11px;
  font-weight: 800;
}

.instrument-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.instrument-meta strong,
.instrument-meta span,
.instrument-meta small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.instrument-meta strong {
  color: #eef6ff;
  font-size: 14px;
  font-weight: 880;
}

.instrument-meta span {
  color: #b7c6d8;
  font-size: 12px;
  font-weight: 760;
}

.instrument-meta small {
  color: #8394a8;
  font-size: 11px;
  line-height: 1.35;
}

.instrument-gauge.is-unavailable .instrument-needle-line,
.instrument-gauge.is-unavailable .instrument-cap-pin {
  opacity: 0.36;
}

.instrument-gauge.is-unavailable .instrument-readout strong {
  color: #9fb0c4;
}

.telemetry-metrics {
  display: block;
  min-width: 0;
}

.telemetry-detail-drawer {
  display: block;
  min-width: 0;
}

.telemetry-detail-drawer > summary {
  display: inline-grid;
  grid-template-columns: 18px auto auto 22px;
  gap: 8px;
  align-items: center;
  max-width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
}

.telemetry-detail-drawer > summary::-webkit-details-marker {
  display: none;
}

.telemetry-detail-drawer > summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.telemetry-detail-drawer[open] > summary {
  margin-bottom: 10px;
}

.telemetry-detail-drawer[open] > summary::after {
  content: "-";
}

.telemetry-detail-icon {
  position: relative;
  width: 18px;
  height: 18px;
  border: 1px solid #96a7ba;
  border-radius: 999px;
}

.telemetry-detail-icon::before,
.telemetry-detail-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 2px;
  border-radius: 999px;
  background: #137c70;
  transform: translateX(-50%);
}

.telemetry-detail-icon::before {
  top: 4px;
  height: 2px;
}

.telemetry-detail-icon::after {
  top: 8px;
  height: 6px;
}

.telemetry-detail-drawer > summary strong,
.telemetry-detail-drawer > summary span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.telemetry-detail-drawer > summary strong {
  font-size: 13px;
  font-weight: 880;
}

.telemetry-detail-drawer > summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.telemetry-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 10px;
  align-content: start;
  max-height: min(520px, calc(100vh - 220px));
  overflow: auto;
  padding-right: 2px;
}

.telemetry-detail-drawer:not([open]) > .telemetry-section-grid,
.telemetry-section:not([open]) > .telemetry-rows {
  display: none;
}

.telemetry-section {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.telemetry-section summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  background: #f8fafc;
  cursor: pointer;
  list-style: none;
}

.telemetry-section summary::-webkit-details-marker {
  display: none;
}

.telemetry-section summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  grid-column: 2;
  grid-row: 1 / span 2;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 900;
}

.telemetry-section[open] summary::after {
  content: "-";
}

.telemetry-section summary strong,
.telemetry-section summary span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.telemetry-section summary strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 880;
}

.telemetry-section summary span {
  grid-column: 1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.telemetry-rows {
  display: grid;
  border-top: 1px solid var(--line-soft);
}

.telemetry-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.75fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
}

.telemetry-row:last-child {
  border-bottom: 0;
}

.telemetry-row span,
.telemetry-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.telemetry-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.telemetry-row strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 830;
}

.telemetry-row .pill {
  padding: 3px 7px;
  font-size: 10px;
}

@media (max-width: 520px) {
  .telemetry-layout {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .telemetry-gauge-deck {
    grid-template-columns: 1fr;
  }

  .instrument-face {
    min-height: 168px;
  }

  .instrument-readout strong {
    font-size: 17px;
  }

  .telemetry-metrics {
    max-height: none;
  }

  .telemetry-section-grid {
    grid-template-columns: 1fr;
    max-height: 620px;
  }

  .telemetry-detail-drawer > summary {
    grid-template-columns: 18px auto minmax(0, 1fr) 22px;
  }

  .telemetry-row {
    grid-template-columns: minmax(88px, 0.65fr) minmax(0, 1fr) auto;
  }
}

.call-primary-row .button,
.call-secondary-row .button {
  min-height: 58px;
  border-radius: 8px;
}

.primary-call-actions.call-primary-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.call-primary-row .button {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
}

.call-primary-row .button.primary {
  background: #0d8f75;
  box-shadow: 0 12px 24px rgba(13, 143, 117, 0.26);
}

.call-primary-row .button.primary:hover {
  background: #0b7964;
}

.call-side .active-call-summary,
.call-side .control-bucket {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 28px rgba(11, 18, 26, 0.1);
}

.inbox-layout {
  grid-template-columns: minmax(300px, 0.62fr) minmax(0, 1.38fr);
  gap: 16px;
}

.thread-list-panel,
.conversation-panel {
  min-height: min(760px, calc(100vh - 140px));
}

.thread-list-panel [data-thread-list] {
  max-height: calc(100vh - 240px);
  overflow: auto;
}

.conversation-panel {
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr) auto;
}

.conversation {
  min-height: 420px;
  max-height: calc(100vh - 300px);
  overflow: auto;
  background: #f8fafc;
}

.conversation-bubble {
  max-width: min(78%, 620px);
}

.composer {
  grid-template-columns: minmax(190px, 0.55fr) minmax(240px, 1fr) minmax(150px, 0.5fr) auto;
}

@media (max-width: 920px) {
  #app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 40;
    inset: 0 auto 0 0;
    width: min(300px, calc(100vw - 56px));
    height: 100vh;
    transform: translateX(-104%);
    transition: transform 180ms ease;
    box-shadow: 18px 0 40px rgba(10, 16, 24, 0.24);
  }

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

  body.nav-open .nav-backdrop {
    display: block;
    position: fixed;
    z-index: 35;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.42);
  }

  .topbar-title {
    align-items: center;
  }
}

@media (max-width: 700px) {
  .legal-link-grid {
    grid-template-columns: 1fr;
  }

  .call-console {
    background: #11161d;
  }

  .handset-dialpad button {
    min-height: 74px;
    font-size: 28px;
  }

  .call-side {
    grid-row: auto;
  }

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

  .thread-list-panel,
  .conversation-panel {
    min-height: auto;
  }

  .thread-list-panel [data-thread-list],
  .conversation {
    max-height: none;
  }

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

/* Drawer navigation and mobile-safe dialpad */
#app,
body.nav-collapsed #app {
  grid-template-columns: minmax(0, 1fr);
}

.sidebar,
body.nav-collapsed .sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  width: min(320px, calc(100vw - 52px));
  height: 100vh;
  padding: 20px 16px;
  align-items: stretch;
  transform: translateX(-104%);
  transition: transform 180ms ease;
  box-shadow: 18px 0 40px rgba(10, 16, 24, 0.24);
}

body.nav-open .sidebar,
body.nav-collapsed.nav-open .sidebar {
  transform: translateX(0);
}

body.nav-open .nav-backdrop,
body.nav-collapsed.nav-open .nav-backdrop {
  display: block;
  position: fixed;
  z-index: 35;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.42);
}

body.nav-collapsed .brand {
  justify-content: flex-start;
  padding: 10px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

body.nav-collapsed .brand strong,
body.nav-collapsed .brand span,
body.nav-collapsed .nav-section,
body.nav-collapsed .status-list {
  display: block;
}

body.nav-collapsed .status-list {
  display: grid;
}

body.nav-collapsed .mark {
  width: 58px;
  height: 58px;
}

body.nav-collapsed .nav {
  width: auto;
}

body.nav-collapsed .nav-item {
  display: block;
  min-height: 38px;
  padding: 9px 11px;
  font-size: 15px;
  text-align: left;
}

body.nav-collapsed .nav-item::before {
  content: none;
}

.nav-footer {
  display: grid;
  gap: 12px;
}

.nav-logout {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-logout:hover {
  background: rgba(255, 255, 255, 0.14);
}

.call-console,
.handset,
.call-side,
.primary-call-actions,
.active-call-actions {
  min-width: 0;
}

.call-primary-row .button,
.call-secondary-row .button {
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .call-console {
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }

  .handset {
    max-width: none;
    justify-self: stretch;
  }

  .primary-call-actions.call-primary-row,
  .active-call-actions.call-secondary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .primary-call-actions .call-button {
    grid-column: 1 / -1;
  }

  .call-secondary-row .button:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  .main {
    padding: 12px;
  }

  .call-console {
    padding: 10px;
  }

  .handset {
    padding: 10px;
  }

  .handset-dialpad {
    gap: 8px;
  }

  .handset-dialpad button {
    min-height: 64px;
    font-size: 26px;
  }
}
