/* Softphone: status tones, modals, media toggles, captions. Layout comes from Tailwind. */

.soft-phone-numbers-section {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  gap: 0.75rem;
  height: auto;
  min-height: 0;
  width: 100%;
}

.soft-phone-page.analytics-page {
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
}

.sp-numbers-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.sp-numbers-title {
  margin: 0;
  font-family: var(--body-font);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--color-text-heading);
}

.sp-numbers-subtitle {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.sp-numbers-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.sp-numbers-toolbar .sp-numbers-search {
  position: relative;
  display: block;
  flex: 1 1 12rem;
  min-width: 0;
  width: auto;
  max-width: none;
}

.sp-numbers-toolbar .sp-numbers-search .sp-numbers-search-decoy {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  border: 0;
  pointer-events: none;
}

.sp-numbers-toolbar .sp-numbers-search .analytics-input {
  width: 100%;
}

.sp-numbers-list-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sp-numbers-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sp-numbers-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 0.85rem;
  min-height: 3.75rem;
  padding: 0.7rem 0.55rem;
  border-radius: 0.65rem;
  background: color-mix(in srgb, var(--color-accent) 14%, var(--color-surface));
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.sp-numbers-item:hover,
.sp-numbers-item:focus-visible {
  background: color-mix(in srgb, var(--color-accent) 22%, var(--color-surface));
  outline: none;
}

.sp-numbers-item-leading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  grid-column: 1;
  min-width: 0;
}

.sp-numbers-item-emoji {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-size: 1.35rem;
  line-height: 1;
}

.sp-numbers-item-identity {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.sp-numbers-item .soft-phone-number-name {
  display: block;
  min-width: 0;
}

.sp-numbers-item-name {
  display: block;
  overflow: hidden;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text-heading);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-numbers-item-number {
  display: block;
  overflow: hidden;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--color-text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-numbers-item-location {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  grid-column: 2;
  max-width: 11rem;
  min-width: 0;
  font-size: 0.8125rem;
  line-height: 1.3;
  color: var(--color-text-muted);
}

.sp-numbers-item-location .soft-phone-country-flag.fi {
  flex: 0 0 auto;
  width: 1rem;
  line-height: 1;
  border-radius: 2px;
}

.sp-numbers-item-location-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-numbers-item-trailing {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  grid-column: 3;
  min-width: 0;
}

.sp-numbers-item-members {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

@media (max-width: 640px) {
  .sp-numbers-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .sp-numbers-item-location {
    display: none;
  }

  .sp-numbers-item-trailing {
    grid-column: 2;
  }
}

.sp-numbers-item-avatars {
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
}

.sp-numbers-item-avatars .activity-member-avatar {
  width: 1.85rem;
  height: 1.85rem;
  margin-left: -0.45rem;
  border: 2px solid color-mix(in srgb, var(--color-accent) 14%, var(--color-surface));
  font-size: 0.62rem;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-hairline) 70%, transparent);
}

.sp-numbers-item-avatars .activity-member-avatar:last-child {
  margin-left: 0;
}

.sp-numbers-item:hover .sp-numbers-item-avatars .activity-member-avatar,
.sp-numbers-item:focus-visible .sp-numbers-item-avatars .activity-member-avatar {
  border-color: color-mix(in srgb, var(--color-accent) 22%, var(--color-surface));
}

.sp-numbers-item-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  opacity: 0.55;
}

.sp-numbers-item-chevron svg,
.sp-numbers-item-chevron i {
  width: 1rem;
  height: 1rem;
}

.sp-numbers-item:hover .sp-numbers-item-chevron,
.sp-numbers-item:focus-visible .sp-numbers-item-chevron {
  opacity: 0.9;
}

.sp-numbers-empty {
  padding: 1.75rem 0.35rem 0.5rem;
}

.sp-numbers-empty-label {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-heading);
}

.sp-numbers-empty-hint {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.soft-phone-number-settings {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  margin: 0;
}

.ns-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.ns-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: var(--body-font);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-decoration: none;
  cursor: pointer;
}

.ns-back:hover {
  color: var(--color-text-heading);
}

.ns-back svg,
.ns-back i {
  width: 0.95rem;
  height: 0.95rem;
}

.ns-identity {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.ns-identity-emoji {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 9999px;
  background: var(--color-surface-secondary);
  font-size: 1.35rem;
  line-height: 1;
}

.ns-identity-emoji[hidden] {
  display: none;
}

.ns-title-block {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.ns-title {
  margin: 0;
  font-family: var(--body-font);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--color-text-heading);
}

.ns-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.ns-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  width: 100%;
  margin: 0 0 2rem;
  padding: 0;
  border: 0;
  overflow: visible;
  background: transparent;
}

.ns-tabs::before {
  display: none;
}

.ns-tab-glider {
  display: none !important;
}

.ns-tab {
  display: inline-flex;
  flex: 1 1 0;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-sizing: border-box;
  position: relative;
  min-width: 0;
  min-height: 2.1rem;
  margin: 0;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  background: transparent;
  font-family: var(--button-font-family);
  font-size: 12px;
  font-weight: var(--button-font-weight);
  line-height: 1.25;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--color-text-heading);
  white-space: nowrap;
  cursor: pointer;
  z-index: 1;
  overflow: hidden;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.ns-tab-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 0;
}

.ns-tab-icon,
.ns-tab-icon.lucide,
.ns-tab svg.lucide {
  flex-shrink: 0;
  width: 0.95rem;
  height: 0.95rem;
  opacity: 1;
}

.ns-tab-label {
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ns-tab:hover {
  border-color: var(--color-text-heading);
  color: var(--color-text-heading);
}

.ns-tab.is-active {
  border-color: var(--color-border);
  background: var(--btn-soft-fill);
  color: var(--color-text-heading);
}

.ns-tab:focus-visible {
  outline: 2px solid var(--color-accent, var(--color-text-heading));
  outline-offset: 2px;
}

.ns-panels {
  display: flex;
  flex-direction: column;
}

.ns-panel[hidden] {
  display: none;
}

.ns-panel.is-active.is-entering {
  animation: ns-panel-in 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes ns-panel-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ns-panel.is-active.is-entering {
    animation: none;
  }
}

@media (max-width: 767px) {
  .ns-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .ns-tab {
    flex: none;
    min-height: 2.1rem;
    padding: 0.4rem 0.5rem;
    white-space: normal;
    text-align: center;
    font-size: 11px;
    letter-spacing: 1px;
  }

  .ns-tab-inner {
    flex-direction: column;
    align-items: center;
    gap: 0.28rem;
    width: 100%;
  }

  .ns-tab-label {
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
}

.ns-panel-intro {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.35rem;
}

.ns-panel-title {
  margin: 0;
  font-family: var(--body-font);
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--color-text-heading);
}

.ns-panel-desc {
  margin: 0;
  font-family: var(--body-font);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.ns-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ns-subsection {
  margin-top: 0.25rem;
}

.ns-subsection-header {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 12px;
}

.ns-subsection-title {
  display: block;
  margin: 0;
  font-family: var(--body-font);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text-heading) 72%, var(--color-text-muted));
  cursor: pointer;
}

.ns-subsection-hint {
  margin: 0;
  font-family: var(--body-font);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
  color: color-mix(in srgb, var(--color-text-muted) 78%, transparent);
}

.ns-name-field {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  max-width: 36rem;
}

.ns-name-field .ns-text-input {
  flex: 1 1 auto;
}

.ns-name-field .settings-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.ns-text-input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface);
  font-family: var(--body-font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-text-heading);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.ns-text-input::placeholder {
  color: var(--color-text-muted);
}

.ns-text-input:hover {
  border-color: color-mix(in srgb, var(--color-text-heading) 22%, var(--color-border));
}

.ns-text-input:focus,
.ns-text-input:focus-visible {
  border-color: var(--color-text-heading);
  box-shadow: 0 0 0 1px var(--color-text-heading);
  outline: none;
}

.ns-field-hint {
  margin: 8px 0 0;
  font-family: var(--body-font);
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-danger);
}

.ns-field-hint[hidden] {
  display: none;
}

.ns-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 18rem);
  gap: 1.25rem;
  align-items: start;
  padding: 1.15rem 0;
  border-top: 1px solid color-mix(in srgb, var(--color-border) 45%, transparent);
}

.ns-row-copy {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.ns-row-label {
  margin: 0;
  font-family: var(--body-font);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-heading);
}

.ns-row-hint {
  margin: 0;
  font-family: var(--body-font);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.ns-row-control {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}

.ns-row-control--name {
  gap: 0.5rem;
}

.ns-emoji-field {
  position: relative;
  flex: 0 0 auto;
}

.ns-emoji-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  background: var(--color-surface);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.ns-emoji-btn:hover {
  border-color: color-mix(in srgb, var(--color-text-heading) 22%, var(--color-border));
}

.ns-emoji-popover {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 30;
  padding: 0.35rem;
  border: 1px solid var(--color-border);
  border-radius: 0.55rem;
  background: var(--color-surface);
  box-shadow: 0 10px 28px color-mix(in srgb, #000 12%, transparent);
}

.ns-emoji-popover .soft-phone-emoji-keyboard-wrap,
.ns-emoji-popover .soft-phone-emoji-keyboard {
  width: min(22rem, 78vw);
}

.ns-input {
  width: 100%;
  min-width: 0;
  height: 2.4rem;
  padding: 0 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 0.45rem;
  background: var(--color-surface);
  color: var(--color-text-heading);
  font-family: var(--body-font);
  font-size: 0.9rem;
}

.ns-input:focus {
  outline: 2px solid color-mix(in srgb, var(--color-accent) 35%, transparent);
  outline-offset: 1px;
}

.ns-row-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 1rem;
}

.ns-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.25rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  background: var(--color-surface);
  color: var(--color-text-heading);
  font-family: var(--body-font);
  font-size: 0.875rem;
  font-weight: 550;
  cursor: pointer;
}

.ns-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ns-btn--primary {
  background: var(--color-text-heading);
  color: var(--color-surface);
}

.ns-btn--primary:hover:not(:disabled) {
  opacity: 0.92;
}

.ns-btn--secondary {
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-heading);
}

.ns-btn--secondary:hover:not(:disabled) {
  background: var(--color-surface-secondary);
}

.ns-btn--danger-outline {
  border-color: color-mix(in srgb, var(--color-danger) 55%, var(--color-border));
  color: var(--color-danger);
  background: var(--color-surface);
}

.ns-btn--danger-outline:hover:not(:disabled) {
  background: color-mix(in srgb, var(--color-danger) 8%, var(--color-surface));
}

.ns-error {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--color-danger);
}

.ns-error[hidden] {
  display: none;
}

.ns-hours-fields {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.ns-hours-days {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  margin-top: 0.45rem;
}

.ns-hours-day {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--body-font);
  font-size: 0.8125rem;
  color: var(--color-text-heading);
  cursor: pointer;
}

.ns-hours-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.ns-hours-callers {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.ns-hours-caller-add {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.ns-hours-caller-add .ns-text-input {
  flex: 1;
  min-width: 0;
}

.ns-hours-caller-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ns-hours-caller-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 0.45rem;
  background: var(--color-surface);
}

.ns-hours-caller-item span {
  font-family: var(--body-font);
  font-size: 0.875rem;
  color: var(--color-text-heading);
}

@media (max-width: 640px) {
  .ns-hours-times {
    grid-template-columns: 1fr;
  }
}

.ns-danger {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 2.75rem;
  padding-top: 0.25rem;
}

.ns-danger-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.18rem 0.55rem;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--color-danger) 12%, var(--color-surface));
  color: var(--color-danger);
  font-family: var(--body-font);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.ns-danger-title {
  margin: 0.15rem 0 0;
  font-family: var(--body-font);
  font-size: 1rem;
  font-weight: 650;
  color: var(--color-text-heading);
}

.ns-danger-desc {
  margin: 0;
  max-width: 40rem;
  font-family: var(--body-font);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.ns-danger-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 0.65rem;
}

.ns-danger-confirm-field {
  flex: 1 1 16rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 22rem;
}

.soft-phone-number-settings .soft-phone-am-form {
  gap: 1.15rem;
}

.soft-phone-number-settings .notif-field {
  margin: 0;
}

@media (max-width: 720px) {
  .ns-row {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .ns-row-control {
    justify-content: flex-start;
  }

  .ns-danger-confirm {
    flex-direction: column;
  }

  .ns-danger-confirm .ns-btn {
    width: 100%;
  }
}

.soft-phone-numbers-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Shared by blocklist / contact-scope tables (not the numbers list page). */
.soft-phone-numbers-card {
  display: block;
  flex: 0 0 auto;
  align-self: stretch;
  width: 100%;
  height: auto;
  max-height: none;
  min-height: 0;
  margin: 0;
  padding: 1.15rem 1.15rem 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface);
  box-sizing: border-box;
}

.soft-phone-numbers-card .analytics-card-title {
  margin-bottom: 0;
}

.soft-phone-numbers-table-wrap {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  min-height: 0;
  margin-top: 0.85rem;
  margin-bottom: -1px;
  overflow-x: auto;
  overflow-y: visible;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  background: transparent;
}

.soft-phone-numbers-table {
  width: 100%;
  height: auto;
  margin-bottom: 0;
}

.soft-phone-numbers-card .data-table thead {
  background: transparent;
}

.soft-phone-numbers-card .data-table tbody tr:hover {
  background: color-mix(in srgb, var(--color-primary) 4%, var(--gray-100, #f5f5f5));
}

.soft-phone-numbers-card .data-table tbody tr:last-child td {
  border-bottom: 1px solid var(--color-border);
}

.soft-phone-numbers-card:has(.analytics-empty) {
  padding-bottom: 1.25rem;
  overflow: visible;
}

.soft-phone-numbers-card:has(.analytics-empty) .soft-phone-numbers-table-wrap {
  margin-bottom: 0;
}

.soft-phone-numbers-tools {
  position: relative;
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  overflow: visible;
}

.soft-phone-numbers-tools .settings-contact-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  min-height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: var(--btn-soft-fill);
  color: var(--color-on-accent);
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    opacity 0.5s ease,
    background-color 0.15s ease;
}

.soft-phone-numbers-tools .settings-contact-action:hover:not(:disabled) {
  background: var(--btn-soft-fill-hover);
  color: var(--color-on-accent);
}

.soft-phone-numbers-tools .settings-contact-action--danger {
  background: color-mix(in srgb, var(--color-danger) 16%, var(--color-surface));
  color: var(--color-danger);
}

.soft-phone-numbers-tools .settings-contact-action--danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--color-danger) 24%, var(--color-surface));
  color: var(--color-danger);
}

.soft-phone-numbers-tools .soft-phone-release.is-confirming-icon {
  background: color-mix(in srgb, var(--color-danger) 20%, var(--color-surface));
  color: var(--color-danger);
}

.soft-phone-numbers-tools .soft-phone-release.is-confirming-icon > svg.lucide,
.soft-phone-numbers-tools .soft-phone-release.is-confirming-icon > i[data-lucide] {
  animation: team-confirm-icon-pop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.settings-btn.settings-btn--primary.soft-phone-numbers-buy-btn {
  box-sizing: border-box;
  flex: 0 0 auto;
  height: 2.5rem;
  min-height: 2.5rem;
  padding-top: 0;
  padding-bottom: 0;
  border: 1px solid var(--color-border);
  white-space: nowrap;
}

.settings-btn.settings-btn--primary.soft-phone-numbers-buy-btn:hover:not(:disabled) {
  border-color: var(--color-border);
}

.soft-phone-number-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.activity-member-avatar {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--palette-muted-surface);
  color: var(--color-text-heading);
  font-size: 0.65rem;
  font-weight: 500;
  line-height: 1;
}

.activity-member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.soft-phone-number-emoji {
  flex-shrink: 0;
  line-height: 1;
}

.soft-phone-emoji-keyboard-wrap {
  overflow: hidden;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-button);
  background: var(--color-surface);
}

.soft-phone-emoji-keyboard {
  --background: var(--color-surface);
  --border-color: transparent;
  --border-radius: 0;
  --button-active-background: var(--color-surface-secondary);
  --button-hover-background: var(--color-surface-secondary);
  --category-font-color: var(--color-text-muted);
  --category-font-size: 12px;
  --emoji-padding: 0.4rem;
  --emoji-size: 1.25rem;
  --input-border-color: var(--color-hairline);
  --input-border-radius: var(--radius-button);
  --input-font-color: var(--color-text-heading);
  --input-font-size: 13px;
  --input-placeholder-color: var(--color-text-muted);
  --indicator-color: var(--color-text-heading);
  --num-columns: 12;
  --outline-color: var(--color-accent);
  display: block;
  width: 100%;
  height: 14rem;
  max-height: min(14rem, 38vh);
  border: 0;
}

.soft-phone-modal-panel--rename {
  max-width: 40rem;
}

.soft-phone-country {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.soft-phone-country-flag.fi {
  width: 1.15em;
  line-height: 1;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.soft-phone-country-code {
  font-family: var(--mono-font);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--color-text-heading);
}

.soft-phone-country-combo {
  position: relative;
}

.soft-phone-country-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 34px 8px 12px;
  border: 1px solid var(--palette-black);
  border-radius: var(--radius-button);
  background-color: var(--color-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9L12 15L18 9' stroke='%236a6662' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  color: var(--color-text-heading);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.soft-phone-country-toggle-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono-font);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.soft-phone-country-list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  max-height: 14rem;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--palette-black);
  border-radius: var(--radius-button);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.soft-phone-country-option {
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--color-text-heading);
  font-family: var(--mono-font);
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
}

.soft-phone-country-option > span:last-child {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.soft-phone-country-option:hover,
.soft-phone-country-option.is-active {
  background: var(--color-surface-secondary);
}

.soft-phone-country-option.is-selected {
  background: color-mix(in srgb, var(--color-accent) 28%, var(--color-surface));
}

.soft-phone-country-option .soft-phone-country-flag.fi,
.soft-phone-country-toggle .soft-phone-country-flag.fi {
  width: 1.25em;
  height: 1em;
  flex-shrink: 0;
}

body.lead-modal-open {
  overflow: hidden;
}

.soft-phone-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
  background: var(--gray-300);
  color: var(--color-text-muted);
}
.soft-phone-status[data-tone="ready"],
.soft-phone-status[data-tone="active"] {
  background: var(--color-surface-secondary);
  color: var(--color-primary);
}
.soft-phone-status[data-tone="pending"] {
  background: var(--gray-300);
  color: var(--color-text-primary);
}
.soft-phone-status[data-tone="offline"] {
  background: color-mix(in srgb, var(--color-danger) 12%, var(--gray-100));
  color: var(--color-danger);
}
.soft-phone-status[data-tone="muted"] {
  background: var(--gray-300);
  color: var(--color-text-muted);
}

.soft-phone-reconnect-btn {
  display: block;
  margin-top: 6px;
  border: 0;
  background: transparent;
  color: var(--color-primary);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}

.soft-phone-reconnect-btn[hidden] {
  display: none;
}

.soft-phone-media-btn .soft-phone-media-icon--active {
  display: none;
}
.soft-phone-media-btn[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--color-danger) 45%, transparent);
  background: color-mix(in srgb, var(--color-danger) 10%, var(--gray-100));
  color: var(--color-danger);
}
.soft-phone-media-btn[aria-pressed="true"] .soft-phone-media-icon--idle {
  display: none;
}
.soft-phone-media-btn[aria-pressed="true"] .soft-phone-media-icon--active {
  display: block;
}

#soft-phone-captions-btn[aria-pressed="true"] {
  border-color: var(--color-primary);
  background: var(--color-surface);
  color: var(--color-text-primary);
}

#soft-phone-captions-btn.is-active,
#soft-phone-captions-btn[aria-pressed="false"] {
  border-color: color-mix(in srgb, var(--palette-black) 16%, transparent);
  background: color-mix(in srgb, var(--palette-black) 5%, var(--gray-100, #f3f3f3));
  color: var(--color-text-muted);
}

.sp-dialer-media #soft-phone-captions-btn:disabled {
  border-color: color-mix(in srgb, var(--palette-black) 12%, transparent);
  background: color-mix(in srgb, var(--palette-black) 4%, var(--gray-100, #f3f3f3));
  color: color-mix(in srgb, var(--color-text-muted) 75%, transparent);
  position: relative;
}

.sp-dialer-media #soft-phone-captions-btn:disabled i {
  position: relative;
  display: inline-block;
}

.sp-dialer-media #soft-phone-captions-btn:disabled i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.35em;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(-42deg);
  pointer-events: none;
}

.soft-phone-history-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--gray-300);
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
}
.soft-phone-history-status[data-status="completed"] {
  background: var(--color-surface-secondary);
  color: var(--color-primary);
}
.soft-phone-history-status[data-status="missed"],
.soft-phone-history-status[data-status="failed"],
.soft-phone-history-status[data-status="rejected"] {
  background: color-mix(in srgb, var(--color-danger) 12%, var(--gray-100));
  color: var(--color-danger);
}
.soft-phone-history-status[data-status="canceled"] {
  background: var(--gray-300);
  color: var(--color-text-muted);
}

.copy-number {
  color: var(--color-primary);
  cursor: pointer;
  font-family: var(--mono-font);
}
.copy-number:hover {
  text-decoration: underline;
}
.copy-number.is-copied {
  color: var(--color-success);
}

.soft-phone-areacode-option.is-active {
  background: var(--color-surface-secondary);
}

.soft-phone-areacode-combo {
  position: relative;
}

#buy_areacode_list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 14rem;
  width: 100%;
  overflow: auto;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-button, 6px);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.soft-phone-areacode-group {
  position: sticky;
  top: 0;
  padding: 0.375rem 0.75rem;
  background: var(--color-background);
  color: var(--color-text-muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.soft-phone-areacode-option {
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.soft-phone-areacode-option:hover {
  background: var(--color-surface-secondary);
}

/* Always-dark call chrome: do not use remapped --palette-off-white. */
.sp-active-call,
.soft-phone-incoming-panel,
.soft-phone-live-captions-panel {
  --sp-dock-bg: #141414;
  --sp-dock-fg: #f3efe6;
  --sp-dock-muted: color-mix(in srgb, #f3efe6 55%, transparent);
  --sp-dock-soft: color-mix(in srgb, #f3efe6 72%, transparent);
  --sp-dock-faint: color-mix(in srgb, #f3efe6 42%, transparent);
  --sp-dock-dim: color-mix(in srgb, #f3efe6 38%, transparent);
  --sp-dock-line: color-mix(in srgb, #f3efe6 10%, transparent);
  --sp-dock-line-strong: color-mix(in srgb, #f3efe6 14%, transparent);
  --sp-dock-line-focus: color-mix(in srgb, #f3efe6 28%, transparent);
  --sp-dock-chip: color-mix(in srgb, #f3efe6 8%, transparent);
  --sp-dock-chip-strong: color-mix(in srgb, #f3efe6 12%, transparent);
  --sp-dock-chip-hover: color-mix(in srgb, #f3efe6 14%, transparent);
  --sp-dock-fill: color-mix(in srgb, #f3efe6 6%, transparent);
  --sp-dock-fill-focus: color-mix(in srgb, #f3efe6 9%, transparent);
}

.soft-phone-incoming-modal {
  z-index: 65;
}

.soft-phone-incoming-panel {
  position: relative;
  z-index: 10;
  width: min(22rem, calc(100vw - 1.5rem));
  padding: 0;
  border: 1px solid var(--sp-dock-line);
  border-radius: 18px;
  background: var(--sp-dock-bg);
  color: var(--sp-dock-fg);
  box-shadow: 0 18px 48px color-mix(in srgb, #000 55%, transparent);
  overflow: hidden;
}

.soft-phone-incoming-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--sp-dock-line);
}

.soft-phone-incoming-status {
  margin: 0;
  min-width: 0;
  font-size: 13px;
  color: var(--sp-dock-muted);
  white-space: nowrap;
}

.soft-phone-incoming-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 0;
  border-radius: 8px;
  background: var(--sp-dock-chip);
  color: var(--sp-dock-soft);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.soft-phone-incoming-close:hover {
  background: var(--sp-dock-chip-hover);
  color: var(--sp-dock-fg, #f3efe6);
}

.soft-phone-incoming-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px 20px;
  text-align: center;
}

.soft-phone-incoming-avatar-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 112px;
  margin-bottom: 18px;
}

.soft-phone-incoming-pulse {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: var(--sp-dock-chip-hover);
  animation: soft-phone-pulse 1.6s ease-out infinite;
}

.soft-phone-incoming-pulse--delay {
  animation-delay: 0.8s;
}

@keyframes soft-phone-pulse {
  0% {
    transform: scale(0.85);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

.soft-phone-incoming-avatar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border-radius: 9999px;
  overflow: hidden;
  background: var(--sp-dock-chip-strong);
  color: var(--sp-dock-fg, #f3efe6);
  font-family: var(--body-font);
  font-size: 28px;
  font-weight: 600;
}

.soft-phone-incoming-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.soft-phone-incoming-avatar-icon {
  font-size: 36px;
  line-height: 1;
}

.soft-phone-incoming-initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.soft-phone-incoming-avatar.has-image .soft-phone-incoming-avatar-icon,
.soft-phone-incoming-avatar.has-image .soft-phone-incoming-initials,
.soft-phone-incoming-avatar.has-initials .soft-phone-incoming-avatar-icon {
  display: none;
}

.soft-phone-incoming-avatar.is-unknown {
  background: color-mix(in srgb, var(--color-accent) 55%, var(--color-surface));
  color: var(--color-text-heading);
}

.soft-phone-incoming-avatar.is-unknown .soft-phone-incoming-avatar-icon {
  font-size: 40px;
}

.soft-phone-incoming-name {
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--body-font);
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--sp-dock-fg, #f3efe6);
}

.soft-phone-incoming-calling {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 8px 0 0;
  max-width: 100%;
  font-family: var(--body-font);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--sp-dock-muted);
}

.soft-phone-incoming-calling-emoji {
  flex-shrink: 0;
  font-size: 15px;
  line-height: 1;
  color: initial;
  opacity: 1;
}

.soft-phone-incoming-calling-emoji:empty {
  display: none;
}

.soft-phone-incoming-calling-line {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.soft-phone-incoming-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 28px;
}

.soft-phone-incoming-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-button);
  font-family: var(--body-font);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.soft-phone-incoming-btn:hover:not(:disabled) {
  filter: brightness(1.06);
}

.soft-phone-incoming-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.soft-phone-incoming-btn i {
  font-size: 18px;
  line-height: 1;
}

.soft-phone-incoming-btn--decline {
  background: #e8590c;
}

.soft-phone-incoming-btn--accept {
  background: #2f9e44;
}

.soft-phone-incoming-hint {
  margin: 16px 0 0;
  max-width: 16rem;
  font-size: 12px;
  line-height: 1.4;
  color: var(--sp-dock-faint);
}

/* Same shell as the dialer dock; only placement/cursor differ for the confirm. */
.sp-active-call.soft-phone-leave-panel {
  position: relative;
  right: auto;
  bottom: auto;
  z-index: 10;
  box-shadow: 0 18px 48px color-mix(in srgb, #000 55%, transparent);
  animation: sp-active-call-enter 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.soft-phone-leave-header {
  cursor: default;
  touch-action: auto;
}

.soft-phone-leave-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  padding: 4px 2px 0;
}

.soft-phone-leave-title {
  margin: 0;
  font-family: var(--body-font);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--sp-dock-fg, #f3efe6);
}

.soft-phone-leave-copy {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--sp-dock-muted);
}

.soft-phone-leave-meta {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--sp-dock-fg, #f3efe6);
}

.soft-phone-leave-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 8px;
}

.soft-phone-leave-actions .sp-active-call-btn {
  flex-direction: row;
  gap: 8px;
  min-height: 48px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
}

.soft-phone-leave-actions .sp-active-call-btn i {
  font-size: 18px;
  line-height: 1;
}

/* Hangup grid placement is for the dialer row; keep leave as a normal cell. */
.soft-phone-leave-actions .sp-active-call-btn--hangup {
  grid-column: auto;
  grid-row: auto;
}

@media (prefers-reduced-motion: reduce) {
  .sp-active-call.soft-phone-leave-panel {
    animation: none;
  }
}

.soft-phone-transcript-spinner {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid var(--gray-400);
  border-top-color: var(--color-primary);
  border-radius: 9999px;
  animation: soft-phone-spin 0.7s linear infinite;
}
@keyframes soft-phone-spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- Dial pad ------------------------------------------------------------ */

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

.soft-phone-dialpad-key {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-button);
  background: var(--color-surface);
  color: var(--color-text-heading);
  font-family: var(--mono-font);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.soft-phone-dialpad-key:hover {
  border-color: var(--color-primary);
  background: var(--color-surface-secondary);
}

.soft-phone-dialpad-key-sub {
  font-family: var(--body-font);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
}

.soft-phone-dial-display {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-button);
  background: var(--color-surface);
  color: var(--color-text-heading);
  font-family: var(--mono-font);
  font-size: 22px;
  letter-spacing: 0.02em;
  text-align: center;
}

.soft-phone-dial-display:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 55%, transparent);
}

.soft-phone-call-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: var(--radius-button);
  background: var(--color-button-primary-bg);
  color: var(--color-button-primary-text);
  font-family: var(--button-font-family);
  font-size: var(--button-font-size);
  font-weight: var(--button-font-weight);
  line-height: var(--button-line-height);
  letter-spacing: var(--button-letter-spacing);
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.soft-phone-call-button:hover:not(:disabled) {
  background: var(--color-button-primary-bg-hover);
}

.soft-phone-call-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.soft-phone-call-button--end {
  background: var(--color-danger);
  color: #fff;
}

.soft-phone-call-button--end:hover:not(:disabled) {
  background: color-mix(in srgb, var(--color-danger) 82%, var(--palette-black));
}

/* --- Modals -------------------------------------------------------------- */

.soft-phone-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--overlay-backdrop);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.auth-page .soft-phone-modal {
  z-index: 90;
}

.soft-phone-modal[hidden] {
  display: none;
}

/* Must follow .soft-phone-modal so leave confirms sit above the call dock. */
.soft-phone-leave-modal {
  z-index: 80;
}

.soft-phone-modal-panel {
  width: 100%;
  max-width: 32rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}

.soft-phone-compose-modal-panel {
  max-width: 26rem;
}

.soft-phone-compose-form .field-textarea {
  min-height: 7.5rem;
  resize: vertical;
}

.soft-phone-compose-meta {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.soft-phone-compose-count {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Compose SMS — Messages layout, dialer dock palette */
.soft-phone-compose-modal {
  --sp-dock-bg: #141414;
  --sp-dock-fg: #f3efe6;
  --sp-dock-muted: color-mix(in srgb, #f3efe6 55%, transparent);
  --sp-dock-soft: color-mix(in srgb, #f3efe6 72%, transparent);
  --sp-dock-faint: color-mix(in srgb, #f3efe6 42%, transparent);
  --sp-dock-dim: color-mix(in srgb, #f3efe6 38%, transparent);
  --sp-dock-line: color-mix(in srgb, #f3efe6 10%, transparent);
  --sp-dock-line-focus: color-mix(in srgb, #f3efe6 28%, transparent);
  --sp-dock-chip: color-mix(in srgb, #f3efe6 8%, transparent);
  --sp-dock-chip-hover: color-mix(in srgb, #f3efe6 14%, transparent);
  --sp-dock-fill: color-mix(in srgb, #f3efe6 6%, transparent);
  --sp-dock-fill-focus: color-mix(in srgb, #f3efe6 9%, transparent);
}

.sp-compose-panel {
  display: flex;
  flex-direction: column;
  width: min(28rem, calc(100vw - 1.5rem));
  height: min(36rem, calc(100vh - 3rem));
  max-height: min(36rem, calc(100vh - 3rem));
  overflow: hidden;
  border: 1px solid var(--sp-dock-line);
  border-radius: 18px;
  background: var(--sp-dock-bg);
  color: var(--sp-dock-fg);
  box-shadow: var(--shadow-lg);
}

.sp-compose-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 48px;
  padding: 12px 44px;
  border-bottom: 1px solid var(--sp-dock-line);
}

.sp-compose-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--sp-dock-fg);
  text-align: center;
}

.sp-compose-close {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
}

.sp-compose-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.sp-compose-to {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-height: 44px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--sp-dock-line);
}

.sp-compose-to-label {
  flex-shrink: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--sp-dock-muted);
}

.sp-compose-to-input {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--sp-dock-fg);
  font-size: 14px;
  line-height: 1.3;
  outline: none;
}

.sp-compose-to-input::placeholder {
  color: var(--sp-dock-dim);
}

.sp-compose-to-picker {
  position: relative;
  flex-shrink: 0;
}

.sp-compose-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--sp-dock-line);
  border-radius: 999px;
  background: transparent;
  color: var(--sp-dock-soft);
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sp-compose-icon-btn:hover {
  background: var(--sp-dock-chip-hover);
  border-color: var(--sp-dock-line-focus);
  color: var(--sp-dock-fg);
}

.sp-compose-icon-btn i,
.sp-compose-icon-btn svg {
  width: 14px;
  height: 14px;
}

.sp-compose-contact-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: min(16.5rem, calc(100vw - 3rem));
  max-height: 14rem;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--sp-dock-line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--sp-dock-bg) 94%, #000);
  box-shadow: var(--shadow-lg);
}

.sp-compose-contact-menu[hidden] {
  display: none !important;
}

.sp-compose-contact-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sp-dock-fg);
  text-align: left;
  cursor: pointer;
}

.sp-compose-contact-option:hover,
.sp-compose-contact-option:focus-visible {
  outline: none;
  background: var(--sp-dock-chip-hover);
}

.sp-compose-contact-option-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sp-compose-contact-option-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
}

.sp-compose-contact-option-phone {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--sp-dock-muted);
}

.sp-compose-contact-empty {
  margin: 0;
  padding: 12px 10px;
  font-size: 12px;
  color: var(--sp-dock-muted);
  text-align: center;
}

.sp-compose-body {
  flex: 1 1 auto;
  min-height: 16rem;
  background: transparent;
}

.sp-compose-error {
  flex-shrink: 0;
  margin: 0;
  padding: 0 14px 8px;
  font-size: 12px;
  color: color-mix(in srgb, var(--color-danger, #e35d5d) 85%, #fff);
}

.sp-compose-error[hidden] {
  display: none !important;
}

.sp-compose-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 10px 12px 12px;
}

.sp-compose-bar > .sp-compose-icon-btn,
.sp-compose-bar .sp-compose-emoji-wrap > .sp-compose-icon-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}

.sp-compose-emoji-wrap {
  position: relative;
  flex-shrink: 0;
}

.sp-compose-snippets-wrap {
  flex-shrink: 0;
}

.sp-compose-bar > .sp-compose-snippets-wrap > .sp-compose-icon-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}

.sp-compose-emoji-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 40;
  width: min(20rem, calc(100vw - 3rem));
  overflow: hidden;
  border: 1px solid var(--sp-dock-line);
  border-radius: 12px;
  background: var(--sp-dock-bg);
  box-shadow: var(--shadow-lg);
}

.sp-compose-emoji-popover[hidden] {
  display: none !important;
}

.sp-compose-emoji-picker {
  --background: var(--sp-dock-bg);
  --border-color: transparent;
  --border-radius: 0;
  --button-active-background: var(--sp-dock-chip-hover);
  --button-hover-background: var(--sp-dock-chip);
  --category-font-color: var(--sp-dock-muted);
  --category-font-size: 11px;
  --emoji-padding: 0.35rem;
  --emoji-size: 1.15rem;
  --input-border-color: var(--sp-dock-line);
  --input-border-radius: 8px;
  --input-font-color: var(--sp-dock-fg);
  --input-font-size: 12px;
  --input-placeholder-color: var(--sp-dock-dim);
  --input-background: var(--sp-dock-fill);
  --indicator-color: var(--sp-dock-fg);
  --num-columns: 8;
  --outline-color: var(--color-accent, #f2cf3f);
  display: block;
  width: 100%;
  height: 16rem;
  max-height: min(16rem, 42vh);
  border: 0;
}

.sp-compose-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 36px;
  padding: 4px 14px;
  border: 1px solid var(--sp-dock-line);
  border-radius: 999px;
  background: var(--sp-dock-fill);
}

.sp-compose-input-wrap:focus-within {
  border-color: var(--sp-dock-line-focus);
  background: var(--sp-dock-fill-focus);
}

.sp-compose-input {
  display: block;
  width: 100%;
  min-height: 28px;
  max-height: 88px;
  margin: 0;
  padding: 0;
  border: 0;
  resize: none;
  background: transparent;
  color: var(--sp-dock-fg);
  font-family: var(--body-font);
  font-size: 14px;
  line-height: 28px;
  outline: none;
}

.sp-compose-input::placeholder {
  color: var(--sp-dock-dim);
  line-height: 28px;
}

.sp-compose-count {
  position: absolute;
  right: 14px;
  bottom: -16px;
  font-size: 10px;
  color: var(--sp-dock-faint);
}

.sp-compose-count.is-near-limit,
.sp-compose-count.is-at-limit {
  display: inline;
}

.sp-compose-send {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 72%, #fff);
  color: #141414;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease, color 0.15s ease;
}

.sp-compose-send:hover:not(:disabled) {
  background: var(--palette-yellow, #f2cf3f);
  color: #141414;
}

.sp-compose-send:disabled {
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 22%, var(--sp-dock-bg));
  color: color-mix(in srgb, #141414 55%, var(--sp-dock-fg));
  opacity: 1;
  cursor: not-allowed;
}

.sp-compose-send > i,
.sp-compose-send > svg.lucide {
  display: block;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  vertical-align: middle;
  color: inherit;
  stroke: currentColor;
}

.sp-compose-send:disabled > i,
.sp-compose-send:disabled > svg.lucide {
  color: inherit;
  stroke: currentColor;
}

.sp-compose-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px 12px;
}

.sp-compose-attachments[hidden] {
  display: none !important;
}

.sp-compose-attachment {
  position: relative;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--sp-dock-line);
  background: var(--sp-dock-fill);
}

.sp-compose-attachment img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sp-compose-attachment.is-file,
.sp-composer-attachment.is-file {
  display: flex;
  align-items: center;
  justify-content: center;
}

.sp-mms-file-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  height: 100%;
  padding: 6px 4px;
  color: color-mix(in srgb, var(--palette-black) 70%, transparent);
  font-family: var(--body-font);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-transform: uppercase;
}

.sp-mms-file-chip .lucide {
  width: 16px;
  height: 16px;
}

.sp-compose-attachment-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, #000 65%, transparent);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
}

/* Schedule SMS modal — purchase-number style surface card */
.soft-phone-schedule-panel {
  position: relative;
  z-index: 10;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 80vw;
  height: 80vh;
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  overflow: hidden;
  border: 0;
  box-shadow: var(--shadow-lg);
}

.soft-phone-schedule-layout {
  display: grid;
  grid-template-columns: 1fr;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .soft-phone-schedule-layout {
    grid-template-columns: 30% 70%;
  }
}

.soft-phone-schedule-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: color-mix(in srgb, var(--color-surface) 92%, var(--palette-cream, #f7f3ea));
}

.soft-phone-schedule-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: auto;
}

.soft-phone-schedule-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  gap: 1rem;
}

.soft-phone-schedule-footer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1rem;
  flex: 0 0 auto;
}

.soft-phone-schedule-footer:has(#soft-phone-schedule-cancel-edit:not([hidden])) {
  flex-direction: row;
  align-items: stretch;
}

.soft-phone-schedule-results-wrap {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow: auto;
}

/* Never stretch the schedule table to full wrap height — that inflates thead
   when only an empty row remains (unlike many buy skeleton rows). */
#soft-phone-schedule-modal .soft-phone-schedule-results-wrap .data-table {
  height: auto;
}

#soft-phone-schedule-modal .soft-phone-schedule-results-wrap .data-table thead th {
  height: auto;
  line-height: 1.35;
}

#soft-phone-schedule-modal .soft-phone-buy-skeleton-row td {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  vertical-align: middle;
}

#soft-phone-schedule-modal .soft-phone-schedule-empty-row td,
#soft-phone-schedule-modal .table-skeleton-row td {
  height: auto;
  padding: 1.5rem 1rem;
  text-align: center;
  vertical-align: middle;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.soft-phone-schedule-sidebar .data-table tbody tr.is-editing td {
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 12%, var(--color-surface));
}

.soft-phone-schedule-sidebar .data-table td[data-schedule-send-at] {
  white-space: nowrap;
}

.soft-phone-schedule-message-cell {
  max-width: 0;
}

.soft-phone-schedule-message-preview {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-schedule-item-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.45rem;
}

/* Reuse soft-phone-numbers-tools circle buttons; lock size so leftover
   settings-btn / confirm-label styles cannot expand or spill text. */
.sp-schedule-item-actions.soft-phone-numbers-tools .settings-contact-action,
.sp-schedule-item-actions.soft-phone-numbers-tools .settings-contact-action.is-confirming,
.sp-schedule-item-actions.soft-phone-numbers-tools .settings-contact-action.is-confirming-icon {
  position: static;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  z-index: auto;
  box-sizing: border-box;
  width: 2rem;
  min-width: 2rem;
  max-width: 2rem;
  height: 2rem;
  min-height: 2rem;
  max-height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  overflow: hidden;
  gap: 0;
  font-size: 0;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
  white-space: nowrap;
}

.sp-schedule-item-actions.soft-phone-numbers-tools .settings-contact-action > svg.lucide,
.sp-schedule-item-actions.soft-phone-numbers-tools .settings-contact-action > i[data-lucide] {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.sp-schedule-item-actions.soft-phone-numbers-tools .settings-contact-action span {
  display: none !important;
}

.soft-phone-schedule-footer [hidden] {
  display: none !important;
}

.soft-phone-schedule-footer .settings-btn {
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
}

.soft-phone-schedule-footer:has(#soft-phone-schedule-cancel-edit:not([hidden])) .settings-btn {
  flex: 1 1 0;
  width: 50%;
  min-width: 0;
}

.soft-phone-schedule-footer .settings-btn i,
.soft-phone-schedule-footer .settings-btn svg {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.soft-phone-schedule-panel .soft-phone-schedule-composer {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0;
  height: 11.5rem;
  min-height: 11.5rem;
  max-height: 11.5rem;
  overflow: visible;
}

/* Mounted on #soft-phone-schedule-modal so panel/layout overflow cannot clip it. */
#soft-phone-schedule-modal > #soft-phone-schedule-emoji-popover {
  z-index: 70;
}

.soft-phone-schedule-panel .soft-phone-schedule-composer .sp-composer-attachments {
  flex: 0 1 auto;
  flex-wrap: nowrap;
  max-height: 4.25rem;
  overflow-x: auto;
  overflow-y: hidden;
}

.soft-phone-schedule-panel .soft-phone-schedule-composer .sp-composer-field {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.soft-phone-schedule-panel .soft-phone-schedule-composer .sp-composer-toolbar {
  flex: 0 0 auto;
}

.soft-phone-schedule-panel .soft-phone-schedule-composer .sp-composer-input {
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  resize: none;
}

.soft-phone-schedule-gap-hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--color-text-muted);
}

.soft-phone-schedule-when {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.soft-phone-schedule-when-field {
  min-width: 0;
  width: 100%;
}

.soft-phone-schedule-when-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
}

.soft-phone-schedule-when-row--ymd {
  grid-template-columns: 1fr 1fr 1fr;
}

.soft-phone-schedule-when-row .soft-phone-schedule-when-field {
  width: auto;
}

.soft-phone-schedule-time-wrap {
  position: relative;
}

.soft-phone-schedule-time-input {
  padding-right: 2.6rem;
}

.soft-phone-schedule-time-input::-webkit-calendar-picker-indicator {
  display: none;
}

.soft-phone-schedule-time-clock-btn {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.soft-phone-schedule-time-clock-btn:hover,
.soft-phone-schedule-time-clock-btn[aria-expanded="true"] {
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 22%, var(--color-surface));
  color: var(--color-text-heading);
}

.soft-phone-schedule-time-clock-btn i,
.soft-phone-schedule-time-clock-btn svg {
  width: 1.05rem;
  height: 1.05rem;
}

.soft-phone-schedule-time-picker {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  z-index: 90;
  box-sizing: border-box;
  width: min(100%, 17.5rem);
  padding: 0.85rem;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-button);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}

.soft-phone-schedule-time-picker-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  margin-bottom: 0.75rem;
}

.soft-phone-schedule-time-digit {
  min-width: 2.4rem;
  padding: 0.2rem 0.35rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-heading);
  font-family: var(--mono-font, ui-monospace, monospace);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.soft-phone-schedule-time-digit.is-active {
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 28%, var(--color-surface));
}

.soft-phone-schedule-time-colon {
  font-family: var(--mono-font, ui-monospace, monospace);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.soft-phone-schedule-time-ampm {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-left: 0.55rem;
}

.soft-phone-schedule-ampm-btn {
  min-width: 2.35rem;
  padding: 0.15rem 0.35rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--button-font-family);
  font-size: 0.65rem;
  font-weight: var(--button-font-weight);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.soft-phone-schedule-ampm-btn.is-active {
  border-color: var(--color-hairline);
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 24%, var(--color-surface));
  color: var(--color-text-heading);
}

.soft-phone-schedule-clock {
  display: flex;
  justify-content: center;
}

.soft-phone-schedule-clock-face {
  position: relative;
  width: 13.5rem;
  height: 13.5rem;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--palette-black) 4%, var(--color-surface));
  touch-action: none;
  user-select: none;
}

.soft-phone-schedule-clock-hand {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 34%;
  background: var(--palette-ink, #1c1917);
  border-radius: 9999px;
  transform-origin: bottom center;
  transform: translate(-50%, -100%) rotate(0deg);
  pointer-events: none;
  z-index: 1;
}

.soft-phone-schedule-clock-center {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
  background: var(--palette-ink, #1c1917);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.soft-phone-schedule-clock-nums {
  position: absolute;
  inset: 0;
}

.soft-phone-schedule-clock-num {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--color-text-heading);
  font-family: var(--mono-font, ui-monospace, monospace);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.soft-phone-schedule-clock-num.is-selected {
  background: var(--btn-soft-fill, var(--palette-yellow, #f2cf3f));
  color: var(--color-on-accent, var(--palette-ink, #1c1917));
}

.soft-phone-buy-panel {
  position: relative;
  z-index: 10;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: min(28rem, calc(100vw - 2rem)) !important;
  height: auto !important;
  max-width: calc(100vw - 2rem) !important;
  max-height: calc(100vh - 2rem) !important;
  overflow: visible;
  border: 0;
  border-radius: var(--radius-button, 6px);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}

#soft-phone-buy-modal.is-results-visible .soft-phone-buy-panel {
  width: min(34rem, calc(100vw - 2rem)) !important;
  height: min(85vh, calc(100vh - 2rem)) !important;
  overflow: hidden;
}

/* Keep buy-modal layout self-contained (works without Tailwind on auth pages). */
.soft-phone-modal > [data-close-buy-modal],
.soft-phone-modal > [data-close-purchase-assign-modal] {
  position: absolute;
  inset: 0;
}

.soft-phone-buy-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex: 0 0 auto;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-hairline);
}

.soft-phone-buy-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
  overflow: visible;
}

#soft-phone-buy-modal.is-results-visible .soft-phone-buy-form {
  overflow: hidden;
}

.soft-phone-buy-filters {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
  overflow: visible;
  gap: 1rem;
  padding: 1.5rem;
  border: 0;
}

.soft-phone-buy-form.is-results-visible .soft-phone-buy-filters {
  display: none;
}

.soft-phone-buy-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.soft-phone-buy-footer {
  margin-top: auto;
  padding-top: 0.25rem;
  flex: 0 0 auto;
}

.soft-phone-buy-footer .settings-btn {
  width: 100%;
}

.soft-phone-buy-footer .field-hint {
  margin: 0;
  text-align: center;
}

.soft-phone-buy-results {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 1rem 1.5rem 1.5rem;
}

.soft-phone-buy-form.is-results-visible .soft-phone-buy-results:not([hidden]) {
  display: flex;
}

.soft-phone-buy-results-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin: 0;
}

.soft-phone-buy-results-back {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 0;
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  background: transparent;
  box-shadow: none;
  color: color-mix(in srgb, var(--color-text-muted) 72%, transparent);
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.3;
  cursor: pointer;
}

.soft-phone-buy-results-back:hover {
  color: var(--color-text-muted);
  background: color-mix(in srgb, var(--color-text-muted) 6%, transparent);
}

.soft-phone-buy-results-wrap {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow: auto;
}

.soft-phone-buy-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
  min-width: 0;
}

.soft-phone-buy-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 10rem;
  padding: 2rem 1rem;
  text-align: center;
}

.soft-phone-buy-empty .sp-numbers-empty-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-heading);
}

.soft-phone-buy-empty .sp-numbers-empty-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

button.sp-numbers-item.soft-phone-buy-result {
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0.85rem 1.1rem;
  border: 0;
  column-gap: 1rem;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

button.sp-numbers-item.soft-phone-buy-result .sp-numbers-item-name {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.3;
}

button.sp-numbers-item.soft-phone-buy-result .sp-numbers-item-location {
  justify-content: flex-end;
}

button.sp-numbers-item.soft-phone-buy-result .sp-numbers-item-trailing,
button.sp-numbers-item.soft-phone-buy-result .sp-numbers-item-chevron {
  display: none !important;
}

.soft-phone-buy-result-meta {
  display: none;
  max-width: 9rem;
  overflow: hidden;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--color-text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 641px) {
  .soft-phone-buy-result-meta {
    display: inline-block;
  }
}

.soft-phone-buy-skeleton-card {
  pointer-events: none;
}

.soft-phone-buy-skeleton-card .sp-numbers-item-identity {
  gap: 0.45rem;
  width: 100%;
}

.soft-phone-buy-skeleton-bar--emoji {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
}

.soft-phone-buy-results-wrap:has(.soft-phone-buy-skeleton-card) {
  min-height: 12rem;
}

.soft-phone-buy-skeleton-bar {
  display: block;
  height: 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--palette-yellow) 28%, var(--palette-cream));
  opacity: 0.7;
}

.soft-phone-buy-skeleton-bar--xs {
  width: 1.1rem;
}

.soft-phone-buy-skeleton-bar--sm {
  width: 2.4rem;
}

.soft-phone-buy-skeleton-bar--md {
  width: 4.5rem;
}

.soft-phone-buy-skeleton-bar--lg {
  width: 7.5rem;
  max-width: 100%;
}

.soft-phone-buy-skeleton-bar--btn {
  width: 4.75rem;
  height: 0.7rem;
}

.soft-phone-buy-filters .field-input,
.soft-phone-buy-filters .field-select {
  border-color: var(--color-primary);
}

.soft-phone-buy-filters .field-input:focus,
.soft-phone-buy-filters .field-select:focus {
  border-color: var(--color-primary);
}

#soft-phone-buy-modal.is-name-step .soft-phone-buy-panel {
  width: min(28rem, calc(100vw - 2rem)) !important;
  height: auto !important;
  max-height: calc(100vh - 2rem) !important;
  overflow: hidden;
}

#soft-phone-buy-modal.is-name-step .soft-phone-buy-form {
  display: none !important;
}

#soft-phone-buy-modal .soft-phone-purchase-assign-form {
  display: none;
  flex-direction: column;
  gap: 1rem;
  flex: 1 1 auto;
  min-height: 0;
  padding: 1.5rem;
  overflow: auto;
}

#soft-phone-buy-modal.is-name-step .soft-phone-purchase-assign-form:not([hidden]) {
  display: flex;
}

#soft-phone-buy-modal .soft-phone-buy-name-subtitle:not([hidden]) {
  display: block;
}

#soft-phone-buy-modal .soft-phone-purchase-assign-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#soft-phone-buy-modal .soft-phone-purchase-assign-fields > div {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

#soft-phone-buy-modal .soft-phone-purchase-assign-form .field-label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1rem;
  color: var(--color-text-muted);
}

#soft-phone-buy-modal .soft-phone-purchase-assign-form .field-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  padding: 0 1rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface);
  color: var(--color-text-heading);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.25rem;
  box-shadow: none;
}

#soft-phone-buy-modal .soft-phone-purchase-assign-form .field-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 20%, transparent);
}

#soft-phone-buy-modal .soft-phone-emoji-keyboard-wrap {
  border-color: var(--color-border);
  border-radius: 4px;
}

#soft-phone-buy-modal .soft-phone-emoji-keyboard--full {
  height: min(22rem, 48vh);
  max-height: min(22rem, 48vh);
  --num-columns: 8;
  --emoji-size: 1.35rem;
}

#soft-phone-buy-modal .soft-phone-purchase-assign-form .soft-phone-buy-footer {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0;
  padding-top: 0;
}

#soft-phone-buy-modal .soft-phone-purchase-assign-cancel {
  margin: 0;
  text-align: center;
}

@media (max-width: 639px) {
  .soft-phone-buy-panel {
    width: calc(100vw - 2rem) !important;
    height: auto !important;
  }

  #soft-phone-buy-modal.is-results-visible .soft-phone-buy-panel {
    height: min(85vh, calc(100vh - 2rem)) !important;
  }
}

.soft-phone-modal-title {
  margin: 0;
  font-family: var(--display-font);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--color-text-heading);
}

.soft-phone-modal-number {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.3;
  color: var(--color-text-muted);
}

.soft-phone-am-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.soft-phone-am-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.25rem;
}

#soft-phone-am-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#soft-phone-am-form label.notif-field-label,
#soft-phone-vm-form label.notif-field-label {
  float: none;
  margin: 0 0 0.2rem;
}

#soft-phone-vm-max-wrap .soft-phone-am-enabled-hint {
  margin-top: 0.35rem;
}

#soft-phone-am-audio-fields {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

#soft-phone-am-audio-fields .field-hint {
  margin: 0;
}

#soft-phone-am-audio-player.sp-rec-player,
#soft-phone-am-tts-player.sp-rec-player {
  margin-top: 0;
}

#soft-phone-am-details[hidden],
#soft-phone-am-text-fields[hidden],
#soft-phone-am-audio-fields[hidden],
#soft-phone-am-audio-player[hidden],
#soft-phone-am-tts-player[hidden] {
  display: none;
}

#soft-phone-am-form .border-t {
  margin-top: 0.25rem;
  padding-top: 1rem;
}

.soft-phone-am-greeting-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
  padding: 10px 12px 8px;
  border: 1px solid var(--palette-black);
  border-radius: var(--radius-button);
  background: var(--color-surface);
}

.soft-phone-am-greeting-wrap:focus-within {
  box-shadow: 0 0 0 1px var(--palette-black);
}

.soft-phone-am-greeting-wrap .field-textarea {
  height: auto;
  min-height: 1.35rem;
  max-height: 7.5rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  resize: none;
  overflow-y: auto;
  box-shadow: none;
}

.soft-phone-am-greeting-wrap .field-textarea:focus {
  outline: none;
  box-shadow: none;
}

.soft-phone-am-greeting-wrap .sp-composer-count {
  margin: 0;
}

#soft-phone-am-text-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.soft-phone-am-text-col {
  min-width: 0;
}

.soft-phone-am-voice-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.soft-phone-am-voice-row .soft-phone-voice-combo {
  flex: 1 1 0;
  min-width: 0;
}

#soft-phone-am-tts-generate {
  position: relative;
  flex: 0 0 auto;
  margin-top: 0;
  align-self: stretch;
  overflow: hidden;
  --am-tts-p: 0;
}

#soft-phone-am-tts-generate > .lucide,
#soft-phone-am-tts-generate > i[data-lucide],
#soft-phone-am-tts-generate > span:not(.settings-btn-progress):not(.settings-btn-progress-label) {
  position: relative;
  z-index: 1;
}

#soft-phone-am-tts-generate .settings-btn-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--am-tts-p, 0) * 1%);
  overflow: hidden;
  background: #000;
  pointer-events: none;
  z-index: 3;
}

#soft-phone-am-tts-generate .settings-btn-progress-label {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  pointer-events: none;
}

#soft-phone-am-tts-generate .settings-btn-progress-label--dark {
  width: 100%;
  color: var(--color-text-heading);
  z-index: 2;
}

#soft-phone-am-tts-generate .settings-btn-progress-label--light {
  width: calc(100% * 100 / max(var(--am-tts-p), 0.001));
  color: #fff;
}

#soft-phone-am-tts-generate.is-busy:disabled {
  opacity: 1;
}

#soft-phone-am-tts-generate.is-busy .settings-btn-progress-label {
  display: flex;
}

#soft-phone-am-tts-generate.is-busy > .lucide,
#soft-phone-am-tts-generate.is-busy > i[data-lucide],
#soft-phone-am-tts-generate.is-busy > span:not(.settings-btn-progress):not(.settings-btn-progress-label) {
  visibility: hidden;
}

.soft-phone-am-enabled-hint {
  margin: 0;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  color: #9a948c;
  opacity: 0.85;
}

.notif-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.notif-field-label {
  display: block;
  float: left;
  width: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--mono-font);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a948c;
}

.notif-style-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  clear: both;
}

.notif-style-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 3.35rem;
  padding: 0.85rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-heading);
  cursor: pointer;
}

.notif-style-card input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.notif-style-name {
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--mono-font);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
  text-align: center;
  color: inherit;
}

.notif-style-name svg,
.notif-style-name i {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
  stroke-width: 1.7;
}

.notif-style-card:has(input:checked) {
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 22%, var(--color-surface));
}

.notif-style-card:has(input:focus-visible) {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--palette-yellow, #f2cf3f) 35%, transparent);
}

.notif-style-grid--joined {
  display: flex;
  gap: 0;
}

.notif-style-grid--joined .notif-style-card {
  flex: 1 1 0;
  min-height: 2.1rem;
  padding: 0.4rem 0.85rem;
  border-radius: 0;
}

.notif-style-grid--joined .notif-style-card:first-child {
  border-radius: var(--radius-button) 0 0 var(--radius-button);
}

.notif-style-grid--joined .notif-style-card:last-child {
  margin-left: -1px;
  border-radius: 0 var(--radius-button) var(--radius-button) 0;
}

.notif-style-grid--joined .notif-style-card:has(input:checked) {
  z-index: 1;
  background: var(--btn-soft-fill);
  color: var(--palette-ink);
}

.notif-style-grid--joined .notif-style-name {
  font-family: var(--button-font-family);
  font-size: 12px;
  font-weight: var(--button-font-weight);
  letter-spacing: 1.2px;
}

html[data-theme="dark"] .notif-style-card {
  background: var(--palette-muted-surface);
  color: var(--color-text-heading);
}

html[data-theme="dark"] .notif-style-card:has(input:checked) {
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 22%, var(--color-surface));
  color: var(--color-text-heading);
}

html[data-theme="dark"] .notif-style-grid--joined .notif-style-card:has(input:checked),
html[data-theme="dark"] .soft-phone-voice-tabs .notif-style-card[aria-selected="true"] {
  background: var(--btn-soft-fill);
  color: var(--palette-ink);
}

.soft-phone-am-audio-preview {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  height: 2.25rem;
}

.soft-phone-am-audio-preview[hidden] {
  display: none;
}

.soft-phone-voice-combo .soft-phone-country-toggle-label {
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}

.soft-phone-voice-panel {
  padding: 0.45rem;
  max-height: none;
  overflow: visible;
}

.soft-phone-voice-tabs {
  margin: 0 0 0.35rem;
}

.soft-phone-voice-tabs .notif-style-card {
  min-height: 1.85rem;
  padding: 0.3rem 0.5rem;
}

.soft-phone-voice-tabs .notif-style-card[aria-selected="true"] {
  z-index: 1;
  background: var(--btn-soft-fill);
  color: var(--palette-ink);
}

.soft-phone-voice-panel #soft-phone-am-tts-voice-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 12rem;
  overflow: auto;
}

.soft-phone-voice-option {
  justify-content: space-between;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}

.soft-phone-voice-option-label {
  flex: 1;
  min-width: 0;
}

.soft-phone-voice-option [data-am-voice-sample][aria-busy="true"] {
  opacity: 0.45;
}

/* --- Live captions ------------------------------------------------------- */

.soft-phone-live-captions-modal {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  z-index: 70;
  width: min(28rem, calc(100vw - 2rem));
  transform: translateX(-50%);
}
.soft-phone-live-captions-panel {
  padding: 14px 16px;
  border-radius: var(--radius-button);
  border: 1px solid var(--sp-dock-chip-strong);
  background: var(--color-sidebar-bg);
  color: var(--sp-dock-fg, #f3efe6);
  box-shadow: var(--shadow-lg);
}
.soft-phone-live-captions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.soft-phone-live-captions-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sp-dock-muted);
}
.soft-phone-live-captions-close {
  border-radius: var(--radius-button);
  padding: 0.15rem 0.4rem;
  color: color-mix(in srgb, var(--sp-dock-fg) 70%, transparent);
  cursor: pointer;
}
.soft-phone-live-captions-close:hover {
  background: var(--sp-dock-line);
  color: var(--sp-dock-fg, #f3efe6);
}
.soft-phone-live-captions-hint {
  margin-bottom: 0.35rem;
  font-size: 13px;
  color: var(--sp-dock-muted);
}
.soft-phone-live-captions-text {
  font-size: 15px;
  line-height: 1.45;
  max-height: 8rem;
  overflow-y: auto;
}

.soft-phone-action-icon {
  width: 1rem;
  height: 1rem;
}

/* --- Row actions injected by JS ------------------------------------------ */

.soft-phone-history-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.soft-phone-list-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-button);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-family: var(--mono-font);
  font-size: 12px;
  font-weight: var(--font-weight-regular);
  line-height: 1.25;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.soft-phone-list-btn:hover:not(:disabled) {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.soft-phone-list-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.soft-phone-list-btn--danger:hover:not(:disabled) {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.soft-phone-icon-btn {
  width: 32px;
  padding: 0;
}

.soft-phone-list-btn.is-loading {
  color: var(--color-text-disabled);
}

.soft-phone-list-btn.is-failed {
  border-color: color-mix(in srgb, var(--color-danger) 45%, transparent);
  color: var(--color-danger);
}

/* --- Transcript lines ----------------------------------------------------- */

.soft-phone-transcript-line {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 0;
  border-bottom: 0;
  max-width: min(28rem, 92%);
}

.soft-phone-transcript-line.is-remote {
  align-self: flex-start;
  align-items: flex-start;
}

.soft-phone-transcript-line.is-local {
  align-self: flex-end;
  align-items: flex-end;
}

.soft-phone-transcript-meta {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.soft-phone-transcript-line.is-local .soft-phone-transcript-meta {
  flex-direction: row-reverse;
}

.soft-phone-transcript-time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1px 7px;
  border: 0;
  border-radius: 999px;
  background: var(--btn-soft-fill);
  color: color-mix(in srgb, var(--palette-ink, #171612) 68%, transparent);
  font-family: var(--mono-font, var(--body-font));
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  width: fit-content;
}

.soft-phone-transcript-speaker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-width: 0;
  font-weight: 500;
  color: var(--color-text-muted);
}

.soft-phone-transcript-line.is-local .soft-phone-transcript-speaker {
  flex-direction: row-reverse;
  text-align: right;
}

.soft-phone-transcript-speaker-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.soft-phone-transcript-line.is-local .soft-phone-transcript-speaker-body {
  align-items: flex-end;
}

.soft-phone-transcript-speaker-name {
  font-family: var(--mono-font, var(--body-font));
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  color: color-mix(in srgb, var(--color-text-muted) 88%, transparent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.soft-phone-transcript-speaker-avatar.sp-avatar {
  width: 28px;
  height: 28px;
  margin: 0;
  font-size: 10px;
  line-height: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.soft-phone-transcript-speaker-avatar.sp-avatar--unknown {
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  overflow: hidden;
}

.soft-phone-transcript-speaker-avatar.sp-avatar--unknown i,
.soft-phone-transcript-speaker-avatar.sp-avatar--unknown svg {
  width: 14px;
  height: 14px;
}

.soft-phone-transcript-speaker-avatar.sp-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.soft-phone-transcript-line-text {
  margin: 0;
  padding-left: 0;
  font-family: var(--mono-font, var(--body-font));
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.soft-phone-transcript-line.is-remote .soft-phone-transcript-line-text {
  padding-left: 36px;
}

.soft-phone-transcript-line.is-local .soft-phone-transcript-line-text {
  padding-right: 36px;
  text-align: right;
}

.soft-phone-transcript-line-copy {
  font: inherit;
  color: inherit;
}

.soft-phone-transcript-lines {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: stretch;
}

/* --- Pager ---------------------------------------------------------------- */

.table-pager-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 0;
}

.table-pager-btn {
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  background: var(--btn-soft-fill);
  color: var(--color-on-accent);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.table-pager-btn:hover:not(:disabled) {
  border-color: var(--color-border);
  background: var(--btn-soft-fill-hover);
  color: var(--color-on-accent);
}

.table-pager-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.table-pager-page {
  font-size: 13px;
  color: var(--color-text-muted);
}

.table-empty-label {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

/* --- Tabs ---------------------------------------------------------------- */

.soft-phone-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-hairline);
}

.soft-phone-tab {
  padding: 10px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.soft-phone-tab:hover {
  color: var(--color-text-heading);
}

.soft-phone-tab.is-active {
  border-bottom-color: var(--color-accent-strong);
  color: var(--color-primary);
}

/* Softphone dialer: inbox | thread | details */

/* Flash + shell share the viewport so the sidebar footer (credits) stays visible. */
body.soft-phone-dialer-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.soft-phone-dialer-page .dashboard-shell {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow: hidden;
}

.soft-phone-dialer-page .dashboard-main {
  min-height: 0;
  height: auto;
  align-self: stretch;
  overflow: hidden;
}

.soft-phone-dialer-page .dashboard-content {
  padding: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.soft-phone-dialer-page .dashboard-content-inner {
  max-width: none;
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.soft-phone-workspace {
  --sp-col-header-height: 48px;
  --sp-thread-bg-surface: color-mix(in srgb, var(--palette-cream) 70%, var(--color-surface));
  --sp-thread-bg-pattern: color-mix(in srgb, var(--palette-border) 55%, var(--palette-muted-surface));
  --sp-chip-bg: color-mix(in srgb, var(--palette-black) 8%, var(--color-surface));
  --sp-chip-bg-hover: color-mix(in srgb, var(--palette-black) 12%, var(--color-surface));
  --sp-card-bg: var(--color-surface);
  --sp-soft-fill: color-mix(in srgb, var(--palette-black) 5%, var(--color-surface));
  --sp-composer-bg: #f8f8f8;
  --sp-on-accent-ink: var(--color-on-accent);
  --color-text-muted: #5c574c;
  --color-muted: #5c574c;
  position: relative;
  display: flex;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--color-surface);
}

html[data-theme="dark"] .soft-phone-workspace {
  --color-text-muted: var(--palette-dark-gray);
  --color-muted: var(--palette-dark-gray);
  --sp-composer-bg: color-mix(in srgb, #000 16%, var(--color-surface));
}

.soft-phone-workspace.is-booting > :not(.sp-boot-skeleton) {
  visibility: hidden;
  pointer-events: none;
}

.sp-boot-skeleton {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 40;
  width: 100%;
  height: 100%;
  background: var(--color-surface);
  pointer-events: none;
}

.soft-phone-workspace.is-booting > .sp-boot-skeleton {
  display: flex;
  visibility: visible;
}

.sp-boot-skeleton-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.sp-boot-skeleton-col--inbox {
  flex: 0 0 300px;
  width: 300px;
  border-right: 1px solid var(--color-hairline);
}

.sp-boot-skeleton-col--details {
  flex: 0 0 320px;
  width: 320px;
  border-left: 1px solid var(--color-hairline);
}

.sp-boot-skeleton-col--main {
  flex: 1 1 auto;
  background-color: var(--sp-thread-bg-surface);
}

.sp-boot-skeleton-header {
  display: flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
  height: var(--sp-col-header-height);
  min-height: var(--sp-col-header-height);
  padding: 0 12px;
  border-bottom: 1px solid var(--color-hairline);
  background: var(--color-surface);
}

.sp-boot-skeleton-col--main .sp-boot-skeleton-header {
  padding: 0 16px;
  gap: 10px;
}

.sp-boot-skeleton-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.sp-boot-skeleton-list,
.sp-boot-skeleton-thread,
.sp-boot-skeleton-fields {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.sp-boot-skeleton-list {
  padding: 8px;
}

.sp-boot-skeleton-contact {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
}

.sp-boot-skeleton-contact-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.sp-boot-skeleton-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--palette-black) 8%, var(--color-surface));
}

.sp-boot-skeleton-avatar--sm {
  width: 32px;
  height: 32px;
}

.sp-boot-skeleton-avatar--lg {
  width: 64px;
  height: 64px;
}

.sp-boot-skeleton-pill,
.sp-boot-skeleton-dot,
.sp-boot-skeleton-line,
.sp-boot-skeleton-day,
.sp-boot-skeleton-bubble {
  display: block;
  border-radius: 999px;
  background: color-mix(in srgb, var(--palette-black) 8%, var(--color-surface));
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--palette-black) 6%, transparent) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: sp-boot-shimmer 1.2s ease-in-out infinite;
}

.sp-boot-skeleton-pill {
  height: 30px;
  width: 6.5rem;
}

.sp-boot-skeleton-pill--search {
  margin-right: auto;
}

.sp-boot-skeleton-dot {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.sp-boot-skeleton-dot--trailing {
  margin-left: auto;
}

.sp-boot-skeleton-line {
  height: 10px;
  width: 100%;
}

.sp-boot-skeleton-line--name {
  width: 42%;
  height: 12px;
}

.sp-boot-skeleton-line--snippet {
  width: 68%;
}

.sp-boot-skeleton-line--title {
  width: 8rem;
  height: 12px;
}

.sp-boot-skeleton-line--sub {
  width: 5.5rem;
  height: 9px;
}

.sp-boot-skeleton-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 24px;
}

.sp-boot-skeleton-day {
  align-self: center;
  width: 5rem;
  height: 18px;
  border-radius: 999px;
}

.sp-boot-skeleton-bubble {
  width: min(18rem, 70%);
  height: 64px;
  border-radius: 14px;
}

.sp-boot-skeleton-bubble--short {
  width: min(11rem, 45%);
  height: 48px;
}

.sp-boot-skeleton-bubble--mid {
  width: min(14rem, 55%);
  height: 56px;
  align-self: flex-end;
}

.sp-boot-skeleton-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 20px 20px;
}

.sp-boot-skeleton-profile-actions {
  display: inline-flex;
  gap: 8px;
  margin-top: 6px;
}

.sp-boot-skeleton-line--profile-name {
  width: 7rem;
  height: 14px;
}

.sp-boot-skeleton-line--profile-sub {
  width: 4.5rem;
  height: 10px;
}

.sp-boot-skeleton-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 20px 24px;
}

.sp-boot-skeleton-line--field {
  width: 100%;
  height: 12px;
}

.sp-boot-skeleton-fields .sp-boot-skeleton-line--field:nth-child(2) {
  width: 82%;
}

.sp-boot-skeleton-fields .sp-boot-skeleton-line--field:nth-child(3) {
  width: 64%;
}

.sp-boot-skeleton-fields .sp-boot-skeleton-line--field:nth-child(4) {
  width: 74%;
}

.sp-boot-skeleton-fields .sp-boot-skeleton-line--field:nth-child(5) {
  width: 58%;
}

@keyframes sp-boot-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@media (max-width: 1100px) {
  .sp-boot-skeleton-col--details {
    display: none;
  }
}

@media (max-width: 1024px) {
  .sp-boot-skeleton {
    flex-direction: column;
  }

  .sp-boot-skeleton-col--inbox,
  .sp-boot-skeleton-col--details {
    flex: 0 0 auto;
    width: 100%;
  }

  .sp-boot-skeleton-col--main {
    min-height: 16rem;
  }
}

.soft-phone-workspace-fallback,
.soft-phone-workspace-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 30;
  width: min(32rem, calc(100% - 2rem));
  transform: translateX(-50%);
}

.sp-inbox,
.sp-details {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 0;
  align-self: stretch;
  background: var(--color-surface);
}

.sp-inbox {
  order: -1;
  width: 300px;
  border-right: 1px solid var(--color-hairline);
}

.sp-details {
  width: 320px;
  border-left: 1px solid var(--color-hairline);
}

.sp-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-surface);
}

.sp-main-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  --sp-thread-bg-wash: linear-gradient(
    180deg,
    color-mix(in srgb, var(--sp-thread-bg-surface) 20%, transparent),
    color-mix(in srgb, var(--sp-thread-bg-surface) 85%, transparent)
  );
  background-color: var(--sp-thread-bg-surface);
  background-image:
    var(--sp-thread-bg-wash),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 11px,
      color-mix(in srgb, var(--sp-thread-bg-pattern) 18%, transparent) 11px,
      color-mix(in srgb, var(--sp-thread-bg-pattern) 18%, transparent) 12px
    );
  background-repeat: no-repeat, repeat;
}

.sp-inbox-header {
  --sp-inbox-toolbar-gap: 2px;
  position: relative;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  height: var(--sp-col-header-height);
  min-height: var(--sp-col-header-height);
  max-height: var(--sp-col-header-height);
  padding: 0 12px;
  border-bottom: 1px solid var(--color-hairline);
}

.sp-inbox-header-main {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  transition:
    gap 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.18s ease;
}

.sp-inbox-header.is-search-open .sp-inbox-header-main {
  gap: 0;
}

.sp-inbox-channel-actions,
.sp-inbox-tools {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-inbox-toolbar-gap);
}

.sp-inbox-tools {
  flex: 1 1 auto;
  min-width: 0;
  transition: gap 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-inbox-header.is-search-open .sp-inbox-tools {
  gap: 0;
}

.sp-inbox-channel-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-inbox-toolbar-gap);
  flex: 0 0 auto;
  max-width: 7.5rem;
  overflow: visible;
  transition:
    opacity 0.18s ease,
    max-width 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    gap 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-inbox-more {
  position: relative;
  flex: 0 0 auto;
  max-width: 2rem;
}

.sp-inbox-header.is-search-open .sp-inbox-channel-actions {
  max-width: 0;
  gap: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.sp-channel-btn,
.sp-details-action,
.sp-inbox-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--sp-chip-bg, color-mix(in srgb, var(--palette-black) 8%, var(--color-surface)));
  color: var(--color-text-heading);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}

.sp-channel-btn:hover,
.sp-details-action:hover,
.sp-inbox-filter-btn:hover {
  background: var(--sp-chip-bg-hover, color-mix(in srgb, var(--palette-black) 12%, var(--color-surface)));
}

.sp-channel-btn:disabled,
.sp-channel-btn.is-disabled,
.sp-details-action:disabled,
.sp-main-header-actions [data-action="dial"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.sp-channel-btn:disabled:hover,
.sp-channel-btn.is-disabled:hover,
.sp-details-action:disabled:hover,
.sp-main-header-actions [data-action="dial"]:disabled:hover {
  background: var(--sp-chip-bg, color-mix(in srgb, var(--palette-black) 8%, var(--color-surface)));
}

.sp-channel-btn.is-active {
  color: var(--color-text-heading);
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 28%, var(--color-surface));
}

.sp-channel-btn.is-active:hover {
  color: var(--color-text-heading);
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 38%, var(--color-surface));
}

#soft-phone-open-dialer {
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 22%, var(--color-surface));
  color: var(--color-text-heading);
}

#soft-phone-open-dialer:hover {
  border-color: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 55%, var(--color-surface));
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 22%, var(--color-surface));
}

#soft-phone-open-dialer.is-active {
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 28%, var(--color-surface));
}

#soft-phone-open-dialer.is-active:hover {
  border-color: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 65%, var(--color-surface));
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 38%, var(--color-surface));
}

#soft-phone-focus-composer {
  background: transparent;
}

#soft-phone-focus-composer:hover {
  background: transparent;
}

.sp-inbox-channel-actions .sp-channel-btn.sp-coming-soon {
  background: transparent;
  color: var(--color-text-muted);
}

.sp-inbox-channel-actions .sp-channel-btn.sp-coming-soon:hover {
  background: transparent;
  color: var(--color-text-heading);
}

.sp-inbox-filter-btn {
  color: var(--color-text-muted);
}

.sp-inbox-filter-btn:hover {
  color: var(--color-text-heading);
}

#soft-phone-inbox-more-btn {
  background: transparent;
  color: var(--color-text-muted);
}

#soft-phone-inbox-more-btn:hover {
  background: transparent;
  color: var(--color-text-heading);
}

.sp-inbox-filter-btn.is-active {
  color: var(--color-text-heading);
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 28%, var(--color-surface));
}

.sp-inbox-filter-btn.is-active i {
  color: var(--color-text-heading);
}

.sp-inbox-filter-btn.is-active:hover {
  color: var(--color-text-heading);
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 38%, var(--color-surface));
}

.sp-details-action.sp-coming-soon {
  color: var(--color-text-muted);
  opacity: 1;
}

.sp-channel-btn.sp-coming-soon,
.sp-coming-soon {
  opacity: 0.55;
}

.sp-inbox-search-panel {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 30px;
  overflow: hidden;
}

.sp-inbox-header.is-search-open .sp-inbox-search-panel {
  z-index: 3;
}

.sp-inbox-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--sp-chip-bg, color-mix(in srgb, var(--palette-black) 8%, var(--color-surface)));
  cursor: text;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.sp-inbox-header.is-search-open .sp-inbox-search {
  border-color: var(--color-hairline);
  background: var(--color-surface);
}

.sp-inbox-search > .lucide-search {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 14px;
  pointer-events: none;
}

.sp-inbox-search input {
  width: 100%;
  height: 100%;
  padding: 0 10px 0 30px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
  color: var(--color-text-muted);
  outline: none;
}

.sp-inbox-search input::placeholder {
  color: #b8b8b8;
  opacity: 1;
}

.sp-inbox-header.is-search-open .sp-inbox-search input {
  padding-right: 40px;
  color: var(--color-text-primary);
}

.sp-inbox-header.is-search-open .sp-inbox-search input::placeholder {
  color: #b8b8b8;
}

.sp-inbox-header.is-search-open .sp-inbox-search > .lucide-search {
  color: var(--color-text-muted);
}

.sp-inbox-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.sp-inbox-search-close {
  position: absolute;
  right: 1px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease 0.12s, color 0.12s ease, background-color 0.12s ease;
}

.sp-inbox-header.is-search-open .sp-inbox-search-close {
  opacity: 1;
  pointer-events: auto;
}

.sp-inbox-search-close:hover {
  color: var(--color-text-heading);
  background: color-mix(in srgb, var(--palette-black) 6%, transparent);
}

.sp-inbox-search-close .lucide {
  width: 15px;
  height: 15px;
}

.sp-inbox-empty-filter {
  margin: 0;
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .sp-inbox-header-main,
  .sp-inbox-tools,
  .sp-inbox-channel-actions,
  .sp-inbox-more,
  .sp-inbox-search,
  .sp-inbox-search-close {
    transition: none;
  }
}

.sp-inbox-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.sp-inbox-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sp-inbox-item {
  display: flex;
  align-items: stretch;
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
  border-radius: var(--radius-button);
}

.sp-inbox-item.is-menu-open {
  position: relative;
  z-index: 5;
}

.sp-inbox-item.is-selected,
.sp-inbox-item:hover {
  background: var(--color-surface-secondary);
}

.sp-inbox-item-btn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 8px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.sp-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-accent) 55%, var(--color-surface));
  color: var(--color-text-heading);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  overflow: hidden;
}

.sp-avatar[data-avatar-tone="0"] {
  background: color-mix(in srgb, #c4a35a 28%, var(--color-surface));
  color: var(--color-text-heading);
}
.sp-avatar[data-avatar-tone="1"] {
  background: color-mix(in srgb, #c47a5a 28%, var(--color-surface));
  color: var(--color-text-heading);
}
.sp-avatar[data-avatar-tone="2"] {
  background: color-mix(in srgb, #c45a5a 28%, var(--color-surface));
  color: var(--color-text-heading);
}
.sp-avatar[data-avatar-tone="3"] {
  background: color-mix(in srgb, #5a9a8a 28%, var(--color-surface));
  color: var(--color-text-heading);
}
.sp-avatar[data-avatar-tone="4"] {
  background: color-mix(in srgb, #5a7aaa 28%, var(--color-surface));
  color: var(--color-text-heading);
}
.sp-avatar[data-avatar-tone="5"] {
  background: color-mix(in srgb, #6a6aaa 28%, var(--color-surface));
  color: var(--color-text-heading);
}

.sp-group-avatar {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  overflow: visible;
}

.sp-group-avatar .sp-avatar {
  position: absolute;
  width: 22px;
  height: 22px;
  font-size: 8px;
  border: 1.5px solid var(--color-surface);
  box-sizing: border-box;
}

/* Two-member stacks: larger faces pulled closer for iMessage-style overlap. */
.sp-group-avatar--pair .sp-avatar {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.sp-group-avatar--pair .sp-avatar:nth-child(1) {
  left: 0;
  top: 0;
  z-index: 1;
}

.sp-group-avatar--pair .sp-avatar:nth-child(2) {
  left: 12px;
  top: 12px;
  right: auto;
  bottom: auto;
  z-index: 2;
}

.sp-group-avatar--trio .sp-avatar:nth-child(1) {
  left: 0;
  top: 0;
  z-index: 1;
}

.sp-group-avatar--trio .sp-avatar:nth-child(2) {
  right: 0;
  top: 0;
  z-index: 2;
}

.sp-group-avatar--trio .sp-avatar:nth-child(3) {
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 3;
}

.sp-group-avatar--grid .sp-avatar {
  width: 17px;
  height: 17px;
  font-size: 7px;
  border-width: 1px;
}

.sp-group-avatar--grid .sp-avatar:nth-child(1) {
  left: 0;
  top: 0;
}

.sp-group-avatar--grid .sp-avatar:nth-child(2) {
  right: 0;
  top: 0;
}

.sp-group-avatar--grid .sp-avatar:nth-child(3) {
  left: 0;
  bottom: 0;
}

.sp-group-avatar--grid .sp-avatar:nth-child(4) {
  right: 0;
  bottom: 0;
}

.sp-group-avatar-more {
  background: #6b4eff !important;
  color: #fff !important;
  font-family: var(--mono-font);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sp-main-header-identity .sp-group-avatar,
.sp-main-header-identity .sp-group-avatar.sp-avatar--header {
  width: 40px;
  height: 40px;
}

.sp-main-header-identity .sp-group-avatar .sp-avatar {
  width: 24px;
  height: 24px;
  font-size: 9px;
}

.sp-main-header-identity .sp-group-avatar--pair .sp-avatar {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.sp-main-header-identity .sp-group-avatar--pair .sp-avatar:nth-child(2) {
  left: 12px;
  top: 12px;
}

.sp-main-header-identity .sp-group-avatar--grid .sp-avatar {
  width: 19px;
  height: 19px;
  font-size: 8px;
}

html[data-theme="dark"] .sp-group-avatar .sp-avatar {
  border-color: var(--color-surface-secondary);
}
.sp-avatar[data-avatar-tone="6"] {
  background: color-mix(in srgb, #5a8aaa 28%, var(--color-surface));
  color: var(--color-text-heading);
}
.sp-avatar[data-avatar-tone="7"] {
  background: color-mix(in srgb, #9a5a8a 28%, var(--color-surface));
  color: var(--color-text-heading);
}
.sp-avatar[data-avatar-tone="8"] {
  background: color-mix(in srgb, #7a9a5a 28%, var(--color-surface));
  color: var(--color-text-heading);
}
.sp-avatar[data-avatar-tone="9"] {
  background: color-mix(in srgb, #aa6a6a 28%, var(--color-surface));
  color: var(--color-text-heading);
}
.sp-avatar[data-avatar-tone="10"] {
  background: color-mix(in srgb, #5a9a8a 28%, var(--color-surface));
  color: var(--color-text-heading);
}
.sp-avatar[data-avatar-tone="11"] {
  background: color-mix(in srgb, #aaa06a 28%, var(--color-surface));
  color: var(--color-text-heading);
}

.sp-avatar--unknown {
  background: var(--sp-chip-bg, color-mix(in srgb, var(--palette-black) 8%, var(--color-surface)));
  color: var(--color-text-muted);
  font-size: 16px;
}

.sp-avatar--bot {
  background: color-mix(in srgb, var(--palette-black) 6%, var(--color-surface));
  color: var(--color-text-muted);
  font-size: 16px;
}

.sp-avatar--unknown i,
.sp-avatar--bot i {
  line-height: 1;
}

.sp-avatar--lg.sp-avatar--unknown {
  font-size: 28px;
}

.sp-avatar--lg {
  width: 72px;
  height: 72px;
  font-size: 22px;
}

.sp-avatar--image {
  padding: 0;
  background: var(--color-surface-secondary);
}

.sp-avatar--emoji {
  background: var(--sp-dock-chip, var(--color-surface-secondary));
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0;
  overflow: visible;
  line-height: 1;
}

.sp-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sp-details-tags {
  display: contents;
}

.sp-details-tags:empty {
  display: none;
}

.sp-details-tags-value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  min-width: 0;
  min-height: 22px;
}

.sp-tag-form {
  width: 100%;
  margin-top: 0;
  margin-bottom: 0;
}

.sp-tag-composer {
  margin: 0;
}

.sp-tag-composer-input {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
  min-height: 1.45rem;
  box-shadow: none;
}

.sp-tag-composer-input::placeholder {
  color: #b8b8b8;
}

.sp-tag-form .sp-tag-palette--form {
  margin-top: 0;
}

.sp-tag-form .sp-tag-palette-swatches {
  gap: 5px;
  flex-wrap: nowrap;
}

.sp-tag-form .sp-tag-swatch {
  width: 14px;
  height: 14px;
  border-color: color-mix(in srgb, var(--palette-black) 12%, transparent);
}

.sp-tag-form .sp-tag-swatch.is-selected {
  outline: 1.5px solid var(--color-text-heading);
  outline-offset: 1px;
}

#soft-phone-details-tags-empty[hidden],
#soft-phone-tag-form[hidden],
#soft-phone-tag-add[hidden] {
  display: none;
}

.sp-tag {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 3px 8px;
  border: 1px solid var(--color-hairline);
  border-radius: 999px;
  background: var(--color-background);
  color: var(--color-text-muted);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  cursor: default;
  transition: gap 0.16s ease, padding 0.16s ease;
}

.sp-tag:has(.sp-tag-remove):hover,
.sp-tag:has(.sp-tag-remove):focus-within {
  gap: 4px;
  padding-right: 5px;
}

.sp-tag.is-active {
  outline: 2px solid var(--color-text-heading);
  outline-offset: 1px;
}

.sp-tag-label {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: lowercase;
}

.sp-tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0;
  height: 14px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  overflow: hidden;
  transform: scale(0.7);
  pointer-events: none;
  transition:
    width 0.16s ease,
    opacity 0.16s ease,
    transform 0.16s ease;
}

.sp-tag:hover .sp-tag-remove,
.sp-tag:focus-within .sp-tag-remove {
  width: 14px;
  opacity: 0.8;
  transform: scale(1);
  pointer-events: auto;
}

.sp-tag .sp-tag-remove:hover,
.sp-tag .sp-tag-remove:focus-visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .sp-tag,
  .sp-tag-remove {
    transition: none;
  }
}

.sp-tag--gray {
  background: var(--gray-200);
  border-color: var(--color-hairline);
  color: var(--color-text-muted);
}

.sp-tag--red {
  background: color-mix(in srgb, #e11d48 12%, var(--color-surface));
  border-color: color-mix(in srgb, #e11d48 28%, var(--color-hairline));
  color: color-mix(in srgb, #e11d48 70%, var(--color-text-heading));
}

.sp-tag--orange {
  background: color-mix(in srgb, #ea580c 12%, var(--color-surface));
  border-color: color-mix(in srgb, #ea580c 28%, var(--color-hairline));
  color: color-mix(in srgb, #ea580c 70%, var(--color-text-heading));
}

.sp-tag--amber {
  background: color-mix(in srgb, #d97706 14%, var(--color-surface));
  border-color: color-mix(in srgb, #d97706 30%, var(--color-hairline));
  color: color-mix(in srgb, #d97706 70%, var(--color-text-heading));
}

.sp-tag--green {
  background: color-mix(in srgb, #16a34a 12%, var(--color-surface));
  border-color: color-mix(in srgb, #16a34a 28%, var(--color-hairline));
  color: color-mix(in srgb, #16a34a 70%, var(--color-text-heading));
}

.sp-tag--teal {
  background: color-mix(in srgb, #0d9488 12%, var(--color-surface));
  border-color: color-mix(in srgb, #0d9488 28%, var(--color-hairline));
  color: color-mix(in srgb, #0d9488 70%, var(--color-text-heading));
}

.sp-tag--blue {
  background: color-mix(in srgb, #2563eb 12%, var(--color-surface));
  border-color: color-mix(in srgb, #2563eb 28%, var(--color-hairline));
  color: color-mix(in srgb, #2563eb 70%, var(--color-text-heading));
}

.sp-tag--violet {
  background: color-mix(in srgb, #7c3aed 12%, var(--color-surface));
  border-color: color-mix(in srgb, #7c3aed 28%, var(--color-hairline));
  color: color-mix(in srgb, #7c3aed 70%, var(--color-text-heading));
}

.sp-tag--pink {
  background: color-mix(in srgb, #db2777 12%, var(--color-surface));
  border-color: color-mix(in srgb, #db2777 28%, var(--color-hairline));
  color: color-mix(in srgb, #db2777 70%, var(--color-text-heading));
}

.sp-tag-palette {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
}

.sp-tag-palette[hidden] {
  display: none;
}

.sp-tag-palette-label {
  margin: 0;
  font-size: 11px;
  color: var(--color-text-muted);
}

.sp-tag-palette-swatches {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}

.sp-tag-swatch {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--palette-black) 18%, transparent);
  border-radius: 999px;
  cursor: pointer;
}

.sp-tag-swatch.is-selected {
  outline: 2px solid var(--color-text-heading);
  outline-offset: 1px;
}

.sp-tag-swatch--gray { background: #d6d3cd; }
.sp-tag-swatch--red { background: #e11d48; }
.sp-tag-swatch--orange { background: #ea580c; }
.sp-tag-swatch--amber { background: #d97706; }
.sp-tag-swatch--green { background: #16a34a; }
.sp-tag-swatch--teal { background: #0d9488; }
.sp-tag-swatch--blue { background: #2563eb; }
.sp-tag-swatch--violet { background: #7c3aed; }
.sp-tag-swatch--pink { background: #db2777; }

.sp-tag-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sp-tag-editor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sp-tag-editor-chips:empty {
  display: none;
}

.sp-tag-editor-input {
  width: 100%;
}

.sp-tag-palette--form {
  align-items: flex-start;
  margin-top: 8px;
}

.sp-contact-avatar-field {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sp-contact-avatar-controls {
  flex: 1;
  min-width: 0;
}

.sp-contact-avatar-preview {
  flex-shrink: 0;
}

.sp-inbox-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.sp-inbox-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.sp-inbox-item-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.sp-inbox-item-name {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-heading);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-inbox-item.is-unknown .sp-inbox-item-name {
  font-family: var(--mono-font);
  font-weight: 400;
}

.sp-inbox-item-when {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
  height: 16px;
  font-size: 10px;
  font-weight: 400;
  color: var(--color-text-muted);
  line-height: 16px;
  white-space: nowrap;
}

.sp-inbox-item-when[hidden] {
  display: none;
}

.sp-inbox-missed-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--color-danger);
  color: #fff;
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.sp-inbox-item-snippet {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  height: 16px;
  overflow: hidden;
  line-height: 16px;
}

.sp-inbox-item-snippet-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  font-size: 13px;
  line-height: 1;
  color: var(--color-text-muted);
}

.sp-inbox-item-snippet.is-missed .sp-inbox-item-snippet-icon {
  color: #c45a4a;
}

.sp-inbox-item-snippet.is-missed .sp-inbox-item-snippet-text {
  color: var(--color-text-muted);
}

.sp-inbox-item-snippet-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 16px;
}

.sp-inbox-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 16px;
  font-size: 12px;
  line-height: 16px;
  color: var(--color-text-muted);
}

.sp-inbox-item-actions {
  display: none;
  align-items: center;
  gap: 1px;
  padding-right: 6px;
  opacity: 0.72;
  position: relative;
}

.sp-inbox-fav.is-on,
.sp-inbox-action.sp-inbox-fav.is-on:hover {
  color: var(--palette-black);
}

.sp-inbox-fav.is-on svg.lucide,
.sp-inbox-fav.is-on i svg {
  fill: currentColor;
}

.sp-inbox-item.is-favorite .sp-inbox-item-actions {
  display: inline-flex;
  opacity: 1;
}

.sp-inbox-item.is-favorite:not(:hover):not(.is-selected):not(.is-menu-open)
  .sp-inbox-item-actions
  > :not(.sp-inbox-fav) {
  display: none;
}

.sp-inbox-item:hover .sp-inbox-item-actions,
.sp-inbox-item.is-selected .sp-inbox-item-actions,
.sp-inbox-item.is-menu-open .sp-inbox-item-actions {
  display: inline-flex;
  opacity: 1;
}

.sp-inbox-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.12s ease, background-color 0.12s ease;
}

.sp-inbox-action:hover {
  color: var(--color-text-heading);
  background: color-mix(in srgb, var(--color-hairline) 65%, transparent);
}

.sp-inbox-action--danger:hover {
  color: var(--color-danger, #b42318);
  background: color-mix(in srgb, var(--color-danger, #b42318) 10%, transparent);
}

.sp-inbox-action.is-confirming-icon,
.sp-inbox-action.is-confirming-icon:hover:not(:disabled) {
  background: color-mix(in srgb, var(--color-danger) 20%, var(--color-surface));
  color: var(--color-danger);
}

.sp-inbox-action.is-confirming-icon > svg.lucide,
.sp-inbox-action.is-confirming-icon > i[data-lucide] {
  animation: team-confirm-icon-pop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-details-note-card:has(.sp-inbox-action.is-confirming) .sp-details-note-actions {
  opacity: 1;
}

.sp-inbox-menu,
.sp-inbox-more {
  position: relative;
}

.sp-inbox-menu.is-open .sp-inbox-action[data-action="menu"],
.sp-inbox-more.is-open > #soft-phone-inbox-more-btn {
  color: var(--color-text-heading);
  background: transparent;
}

.sp-inbox-more.has-active-filter > #soft-phone-inbox-more-btn {
  color: var(--color-text-heading);
  background: transparent;
}

.sp-inbox-menu-panel {
  position: absolute;
  top: calc(100% + 4px);
  bottom: auto;
  right: 0;
  z-index: 40;
  min-width: 11.5rem;
  padding: 4px;
  border: 1px solid var(--color-hairline);
  border-radius: 10px;
  background: var(--color-surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.sp-inbox-more .sp-inbox-menu-panel {
  left: auto;
  right: 0;
}

.sp-inbox-menu-panel[hidden] {
  display: none;
}

.sp-inbox-menu-panel button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--color-text-primary);
  font-family: var(--body-font);
  font-size: 13px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.sp-inbox-menu-panel button .lucide {
  font-size: 15px;
  color: var(--color-text-muted);
}

.sp-inbox-menu-panel button:hover {
  background: color-mix(in srgb, var(--color-hairline) 55%, transparent);
}

.sp-inbox-menu-panel button.is-active {
  color: var(--color-text-heading);
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 28%, var(--color-surface));
}

.sp-inbox-menu-panel button.is-active .lucide {
  color: var(--color-text-heading);
}

.sp-inbox-menu-panel button.is-active:hover {
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 38%, var(--color-surface));
}

.sp-inbox-menu-panel button:disabled {
  opacity: 0.45;
  cursor: default;
}

.sp-inbox-menu-item--danger,
.sp-inbox-menu-item--danger .lucide {
  color: var(--color-danger, #b42318);
}

.sp-inbox-menu-item--danger:hover {
  background: color-mix(in srgb, var(--color-danger, #b42318) 10%, transparent);
}

.soft-phone-contacts-empty {
  margin: 0;
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
}

.sp-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
  height: var(--sp-col-header-height);
  min-height: var(--sp-col-header-height);
  max-height: var(--sp-col-header-height);
  padding: 0 16px;
  border-bottom: 1px solid var(--color-hairline);
  background: var(--color-surface);
}

.sp-main-header-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.sp-main-header-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.sp-avatar--header {
  width: 32px;
  height: 32px;
  font-size: 11px;
}

.sp-avatar--header.sp-avatar--unknown {
  font-size: 15px;
}

.sp-main-title {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--color-text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-main-subtitle {
  margin: 0;
  font-family: var(--mono-font);
  font-size: 11px;
  line-height: 1.2;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-main-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.sp-main-more {
  position: relative;
  flex: 0 0 auto;
}

.sp-main-more.is-open > .sp-header-icon-btn {
  color: var(--color-text-heading);
  background: color-mix(in srgb, var(--palette-black) 5%, transparent);
}

.sp-main-more-panel {
  right: 0;
  left: auto;
  min-width: 12.5rem;
}

.sp-main-more-panel .sp-main-more-item[hidden] {
  display: none;
}

.sp-main-more-panel .sp-main-more-item.is-confirming {
  color: var(--color-danger, #b42318);
  background: color-mix(in srgb, var(--color-danger, #b42318) 10%, transparent);
}

.sp-main-more-panel .sp-main-more-item.is-confirming .lucide {
  color: var(--color-danger, #b42318);
}

.sp-main-header-actions .soft-phone-status {
  margin-right: 4px;
}

.sp-header-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.sp-header-icon-btn:hover:not(:disabled) {
  color: var(--color-text-heading);
  background: color-mix(in srgb, var(--palette-black) 5%, transparent);
}

.sp-header-icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sp-header-icon-btn .lucide {
  line-height: 1;
}

.sp-header-icon-btn.sp-inbox-fav.is-on,
.sp-header-icon-btn.sp-inbox-fav.is-on:hover:not(:disabled) {
  color: var(--palette-black);
}

.sp-header-icon-btn--danger {
  color: var(--color-danger);
}

.sp-header-icon-btn--danger:hover:not(:disabled) {
  color: var(--color-danger);
  background: color-mix(in srgb, var(--color-danger) 8%, transparent);
}

.sp-header-icon-btn.is-confirming-icon,
.sp-header-icon-btn.is-confirming-icon:hover:not(:disabled) {
  background: color-mix(in srgb, var(--color-danger) 20%, var(--color-surface));
  color: var(--color-danger);
}

.sp-header-icon-btn.is-confirming-icon > svg.lucide,
.sp-header-icon-btn.is-confirming-icon > i[data-lucide] {
  animation: team-confirm-icon-pop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-thread-wrap {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sp-thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  background: transparent;
}

.sp-thread-empty {
  margin: auto;
  padding: 24px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
}

.sp-thread-day {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 12px;
  width: 100%;
  margin: 4px 0 8px;
  padding: 0;
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  line-height: 1.2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.sp-thread-day::before,
.sp-thread-day::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--color-hairline);
  min-width: 16px;
}

.sp-thread-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.sp-thread-item-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  width: 100%;
  max-width: 100%;
}

.sp-thread-item.is-inbound .sp-thread-item-row {
  flex-direction: row;
  justify-content: flex-start;
}

.sp-thread-item.is-outbound .sp-thread-item-row {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.sp-thread-item-main {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  max-width: min(26rem, calc(100% - 42px));
  overflow: visible;
}

.sp-thread-item.soft-phone-history-row .sp-thread-item-main {
  width: min(40rem, 100%);
  max-width: min(40rem, 100%);
}

.sp-thread-item.is-outbound .sp-thread-item-main {
  align-items: flex-end;
}

.sp-thread-item.is-inbound .sp-thread-item-main {
  align-items: flex-start;
}

.sp-thread-item.has-internal-thread .sp-thread-item-main,
.sp-thread-item:has(.sp-internal-thread) .sp-thread-item-main,
.sp-thread-item:has(.sp-thread-call-branch) .sp-thread-item-main,
.sp-thread-item.is-inbound.has-internal-thread .sp-thread-item-main,
.sp-thread-item.is-outbound.has-internal-thread .sp-thread-item-main,
.sp-thread-item.is-inbound:has(.sp-internal-thread) .sp-thread-item-main,
.sp-thread-item.is-outbound:has(.sp-internal-thread) .sp-thread-item-main,
.sp-thread-item.is-inbound:has(.sp-thread-call-branch) .sp-thread-item-main,
.sp-thread-item.is-outbound:has(.sp-thread-call-branch) .sp-thread-item-main {
  width: min(30rem, calc(100% - 42px));
  max-width: min(30rem, calc(100% - 42px));
  align-items: stretch;
}

.sp-thread-item.soft-phone-history-row.has-internal-thread .sp-thread-item-main,
.sp-thread-item.soft-phone-history-row:has(.sp-internal-thread) .sp-thread-item-main,
.sp-thread-item.soft-phone-history-row:has(.sp-thread-call-branch) .sp-thread-item-main,
.sp-thread-item.soft-phone-history-row.is-inbound.has-internal-thread .sp-thread-item-main,
.sp-thread-item.soft-phone-history-row.is-outbound.has-internal-thread .sp-thread-item-main,
.sp-thread-item.soft-phone-history-row.is-inbound:has(.sp-internal-thread) .sp-thread-item-main,
.sp-thread-item.soft-phone-history-row.is-outbound:has(.sp-internal-thread) .sp-thread-item-main,
.sp-thread-item.soft-phone-history-row.is-inbound:has(.sp-thread-call-branch) .sp-thread-item-main,
.sp-thread-item.soft-phone-history-row.is-outbound:has(.sp-thread-call-branch) .sp-thread-item-main {
  width: min(30rem, calc(100% - 42px));
  max-width: min(30rem, calc(100% - 42px));
}

.sp-thread-bubble-grid {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, max-content);
  column-gap: 10px;
  row-gap: 4px;
  align-items: end;
  width: max-content;
  max-width: 100%;
  overflow: visible;
}

.sp-thread-item.is-outbound .sp-thread-bubble-grid {
  grid-template-columns: minmax(0, max-content) auto;
}

.sp-thread-item.has-internal-thread .sp-thread-bubble-grid,
.sp-thread-item:has(.sp-internal-thread) .sp-thread-bubble-grid,
.sp-thread-item:has(.sp-thread-call-branch) .sp-thread-bubble-grid {
  width: 100%;
  max-width: 100%;
}

.sp-thread-item.is-inbound.has-internal-thread .sp-thread-bubble-grid,
.sp-thread-item.is-inbound:has(.sp-internal-thread) .sp-thread-bubble-grid,
.sp-thread-item.is-inbound:has(.sp-thread-call-branch) .sp-thread-bubble-grid {
  grid-template-columns: auto minmax(0, 1fr);
}

.sp-thread-item.is-outbound.has-internal-thread .sp-thread-bubble-grid,
.sp-thread-item.is-outbound:has(.sp-internal-thread) .sp-thread-bubble-grid,
.sp-thread-item.is-outbound:has(.sp-thread-call-branch) .sp-thread-bubble-grid {
  grid-template-columns: minmax(0, 1fr) auto;
}

.sp-thread-bubble-grid > .sp-avatar--thread {
  grid-row: 1;
  align-self: end;
}

.sp-thread-item.is-inbound .sp-thread-bubble-grid > .sp-avatar--thread {
  grid-column: 1;
}

.sp-thread-item.is-outbound .sp-thread-bubble-grid > .sp-avatar--thread {
  grid-column: 2;
}

.sp-thread-item.is-inbound .sp-thread-bubble-grid > .sp-thread-bubble-wrap,
.sp-thread-item.is-inbound .sp-thread-bubble-grid > .sp-thread-call-bubble,
.sp-thread-item.is-inbound .sp-thread-bubble-grid > .sp-sms-card-meta,
.sp-thread-item.is-inbound .sp-thread-bubble-grid > .sp-thread-card-meta,
.sp-thread-item.is-inbound .sp-thread-bubble-grid > .sp-thread-call-branch,
.sp-thread-item.is-inbound .sp-thread-bubble-grid > .sp-internal-thread-slot,
.sp-thread-item.is-inbound .sp-thread-bubble-grid > .sp-thread-actor {
  grid-column: 2;
}

.sp-thread-item.is-outbound .sp-thread-bubble-grid > .sp-thread-bubble-wrap,
.sp-thread-item.is-outbound .sp-thread-bubble-grid > .sp-thread-call-bubble,
.sp-thread-item.is-outbound .sp-thread-bubble-grid > .sp-sms-card-meta,
.sp-thread-item.is-outbound .sp-thread-bubble-grid > .sp-thread-card-meta,
.sp-thread-item.is-outbound .sp-thread-bubble-grid > .sp-thread-call-branch,
.sp-thread-item.is-outbound .sp-thread-bubble-grid > .sp-internal-thread-slot,
.sp-thread-item.is-outbound .sp-thread-bubble-grid > .sp-thread-actor {
  grid-column: 1;
}

.sp-thread-bubble-grid > .sp-thread-actor {
  grid-row: 1;
  align-self: end;
}

.sp-thread-item.is-outbound .sp-thread-bubble-grid > .sp-thread-actor {
  justify-self: end;
}

.sp-thread-item.is-inbound .sp-thread-bubble-grid > .sp-thread-actor {
  justify-self: start;
}

.sp-thread-bubble-grid > .sp-thread-bubble-wrap,
.sp-thread-bubble-grid > .sp-thread-call-bubble {
  grid-row: 1;
}

.sp-thread-bubble-grid:has(> .sp-thread-actor) > .sp-avatar--thread,
.sp-thread-bubble-grid:has(> .sp-thread-actor) > .sp-thread-bubble-wrap,
.sp-thread-bubble-grid:has(> .sp-thread-actor) > .sp-thread-call-bubble {
  grid-row: 2;
}

.sp-thread-item.is-outbound .sp-thread-bubble-grid > .sp-thread-bubble-wrap,
.sp-thread-item.is-outbound .sp-thread-bubble-grid > .sp-thread-call-bubble {
  justify-self: end;
  width: fit-content;
  max-width: 100%;
}

.sp-thread-item.is-inbound .sp-thread-bubble-grid > .sp-thread-bubble-wrap,
.sp-thread-item.is-inbound .sp-thread-bubble-grid > .sp-thread-call-bubble {
  justify-self: start;
  width: fit-content;
  max-width: 100%;
}

.sp-thread-item.is-outbound .sp-thread-bubble-grid > .sp-sms-card-meta,
.sp-thread-item.is-outbound .sp-thread-bubble-grid > .sp-thread-card-meta {
  justify-self: end;
}

.sp-thread-item.is-inbound .sp-thread-bubble-grid > .sp-sms-card-meta,
.sp-thread-item.is-inbound .sp-thread-bubble-grid > .sp-thread-card-meta {
  justify-self: start;
}

.sp-thread-actor {
  margin: 0 6px 2px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--color-text-muted);
  opacity: 0.72;
}

.sp-avatar--thread {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  font-size: 11px;
}

.sp-avatar--thread.sp-avatar--unknown {
  background: color-mix(in srgb, var(--color-accent) 28%, var(--color-surface));
  color: var(--color-text-heading);
  font-size: 16px;
}

.sp-avatar--thread.sp-avatar--bot {
  background: color-mix(in srgb, var(--palette-black) 6%, var(--color-surface));
  color: var(--color-text-muted);
  font-size: 16px;
}

.sp-sms-card {
  width: fit-content;
  max-width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 16px;
  background: var(--sp-soft-fill, color-mix(in srgb, var(--palette-black) 5%, var(--color-surface)));
}

.sp-sms-card.is-inbound {
  background: var(--sp-soft-fill, color-mix(in srgb, var(--palette-black) 8%, var(--color-surface)));
  color: var(--color-text-heading);
}

.sp-sms-card.is-outbound {
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 28%, var(--color-surface));
  color: var(--color-text-heading);
}

.sp-sms-card-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}

.sp-sms-card-media {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0 0 8px;
}

.sp-sms-card-media:last-child {
  margin-bottom: 0;
}

.sp-sms-card-media a {
  display: block;
  max-width: 220px;
  border-radius: 12px;
  overflow: hidden;
}

.sp-sms-card-media img {
  display: block;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.sp-sms-card-audio,
.sp-sms-card-video {
  display: block;
  max-width: 240px;
  width: 100%;
  border-radius: 10px;
}

.sp-sms-card-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--palette-black) 6%, var(--color-surface));
  color: inherit;
  text-decoration: none;
  font-family: var(--body-font);
  font-size: 13px;
  line-height: 1.3;
}

.sp-sms-card-file .lucide {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.sp-sms-card-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-sms-card-meta,
.sp-thread-card-meta {
  margin: 0 4px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--color-text-muted);
  opacity: 0.72;
}

.sp-thread-bubble-wrap {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
}

.sp-internal-thread-start {
  position: absolute;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--palette-black) 6%, var(--color-surface));
  color: var(--color-text-muted);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
  z-index: 2;
}

.sp-thread-item.is-outbound .sp-internal-thread-start {
  right: calc(100% + 6px);
}

.sp-thread-item.is-inbound .sp-internal-thread-start {
  left: calc(100% + 6px);
}

.sp-thread-item:hover .sp-internal-thread-start,
.sp-internal-thread-start.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sp-internal-thread-start:hover,
.sp-internal-thread-start[aria-expanded="true"] {
  background: color-mix(in srgb, var(--palette-black) 12%, var(--color-surface));
  color: var(--color-text-heading);
}

.sp-internal-thread-start .lucide,
.sp-internal-thread-start svg {
  width: 14px;
  height: 14px;
  display: block;
  flex-shrink: 0;
}

.sp-internal-thread-slot:empty {
  display: none;
}

.sp-internal-thread-slot:not(:empty) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  align-self: stretch;
  justify-self: start;
  width: min(calc(30rem - 42px), 100%);
  min-width: 0;
  max-width: min(calc(30rem - 42px), 100%);
  margin-top: 0;
  padding-top: 0;
  box-sizing: border-box;
  position: relative;
  overflow: visible;
}

.sp-thread-item.is-outbound .sp-internal-thread-slot:not(:empty) {
  justify-self: end;
}

.sp-internal-thread {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
  overflow: visible;
}

.sp-internal-thread:not(.is-expanded) {
  overflow: hidden;
}

.sp-internal-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-sizing: border-box;
  min-width: 0;
  min-height: 36px;
  padding: 6px 10px;
  border-bottom: 1px solid #ececec;
  background: #fff;
  border-radius: 12px 12px 0 0;
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease, border-radius 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    border-bottom-color 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-internal-thread-head:hover {
  background: color-mix(in srgb, var(--palette-black) 4%, #fff);
}

.sp-internal-thread:not(.is-expanded) .sp-internal-thread-head {
  border-bottom-color: transparent;
  border-radius: 12px;
}

.sp-internal-thread-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.sp-internal-thread-head-avatars {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  flex-shrink: 0;
}

.sp-internal-thread-head-avatars .sp-avatar {
  width: 22px;
  height: 22px;
  font-size: 9px;
  border: 2px solid #fff;
  margin-left: -6px;
}

.sp-internal-thread-head-avatars .sp-avatar:last-child {
  margin-left: 0;
}

.sp-internal-thread-avatar-more {
  background: color-mix(in srgb, var(--palette-black) 10%, var(--color-surface));
  color: var(--color-text-muted);
  font-family: var(--mono-font);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.sp-internal-thread.is-draft .sp-internal-thread-head {
  min-height: 36px;
  height: 36px;
  padding: 0 12px;
  cursor: default;
}

.sp-internal-thread.is-draft .sp-internal-thread-head-actions {
  margin-left: auto;
}

.sp-internal-thread.is-draft .sp-internal-thread-head:hover {
  background: #fff;
}

.sp-internal-thread-count-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  margin: 0;
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  color: var(--color-text-muted);
  opacity: 0.72;
  pointer-events: none;
  white-space: nowrap;
}

.sp-internal-thread-count {
  margin: 0;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.sp-internal-thread-count::before {
  content: "(";
}

.sp-internal-thread-count::after {
  content: ")";
}

.sp-internal-thread-when {
  margin: 0;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--color-text-muted);
  opacity: 0.72;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-internal-thread-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  position: relative;
}

.sp-internal-thread-head-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #8a8a8a;
  cursor: pointer;
}

.sp-internal-thread-head-btn:hover,
.sp-internal-thread-head-btn[aria-expanded="true"] {
  background: #f0f0f0;
  color: #5f5f5f;
}

.sp-internal-thread-head-btn.is-resolved {
  color: var(--color-success, #2f9d5c);
}

.sp-internal-thread-head-btn.is-confirming-icon,
.sp-internal-thread-head-btn.is-confirming-icon:hover:not(:disabled) {
  background: color-mix(in srgb, var(--color-danger) 20%, var(--color-surface));
  color: var(--color-danger);
}

.sp-internal-thread-head-btn.is-confirming-icon > svg.lucide,
.sp-internal-thread-head-btn.is-confirming-icon > i[data-lucide] {
  animation: team-confirm-icon-pop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-internal-thread-head-btn .lucide {
  width: 14px;
  height: 14px;
}

.sp-internal-thread-body {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-internal-thread.is-expanded .sp-internal-thread-body {
  grid-template-rows: 1fr;
}

.sp-internal-thread-body-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  max-height: calc(5 * 5.6rem + 4 * 12px + 7.5rem);
  transition: padding 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    min-height 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-internal-thread.is-expanded .sp-internal-thread-body-inner {
  padding: 12px 0;
  min-height: calc(3 * 5.6rem + 2 * 12px + 12px + 3rem);
}

.sp-internal-comments {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: calc(3 * 5.6rem + 2 * 12px);
  max-height: none;
  padding: 0 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.sp-internal-comment-head {
  overflow: visible;
}

@media (prefers-reduced-motion: reduce) {
  .sp-internal-thread-body,
  .sp-internal-thread-body-inner {
    transition: none;
  }

  .sp-internal-comment-reactions-extra,
  .sp-internal-comment-reactions-extra-inner,
  .sp-internal-comment-foot .sp-internal-comment-react-popover,
  .sp-internal-comment-react-popover-inner {
    transition: none;
  }
}

.sp-internal-comment {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.sp-internal-comment.is-own {
  flex-direction: row-reverse;
  align-self: stretch;
  padding-left: 38px;
}

.sp-internal-comment.is-other {
  flex-direction: row;
  align-self: stretch;
  padding-right: 38px;
}

.sp-internal-comment .sp-avatar,
.sp-avatar--internal-comment {
  width: 28px;
  height: 28px;
  font-size: 11px;
  flex-shrink: 0;
}

.sp-internal-comment:has(.sp-internal-comment-head) .sp-avatar--internal-comment {
  margin-top: 18px;
}

.sp-internal-comment-main {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
  max-width: 100%;
}

.sp-internal-comment.is-own .sp-internal-comment-main {
  align-items: flex-end;
}

.sp-internal-comment-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
  max-width: 100%;
}

.sp-internal-comment.is-own .sp-internal-comment-stack {
  align-items: flex-end;
}

.sp-internal-comment-head {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  min-width: 0;
  margin: 0 6px 2px;
}

.sp-internal-comment.is-own .sp-internal-comment-head {
  align-items: flex-end;
}

.sp-internal-comment.is-own .sp-internal-comment-reactions {
  flex: 0 1 auto;
  justify-content: flex-end;
}

.sp-internal-comment-actor {
  margin: 0;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--color-text-muted);
  opacity: 0.58;
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-internal-comment-reactions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 4px;
  row-gap: 0;
  margin: 0;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
}

.sp-internal-comment-reactions-more-wrap {
  display: contents;
}

.sp-internal-comment-reactions-extra {
  display: grid;
  flex: 1 1 100%;
  grid-template-rows: 0fr;
  width: 100%;
  max-width: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transition:
    grid-template-rows 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.18s ease;
}

.sp-internal-comment-reactions.is-open .sp-internal-comment-reactions-extra {
  grid-template-rows: 1fr;
  opacity: 1;
  pointer-events: auto;
}

.sp-internal-comment-reactions-extra-inner {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-height: 0;
  overflow: hidden;
  padding-top: 0;
  transform: translateY(-6px);
  transition:
    padding-top 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-internal-comment.is-own .sp-internal-comment-reactions-extra-inner {
  justify-content: flex-end;
}

.sp-internal-comment-reactions.is-open .sp-internal-comment-reactions-extra-inner {
  padding-top: 4px;
  transform: none;
}

.sp-internal-comment-reactions-more {
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.sp-internal-comment-bubble {
  flex: 0 1 auto;
  width: fit-content;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--sp-soft-fill, color-mix(in srgb, var(--palette-black) 5%, var(--color-surface)));
  color: var(--color-text-heading);
}

.sp-internal-comment.is-own .sp-internal-comment-bubble {
  background: var(--color-surface-secondary);
  color: var(--color-text-heading);
}

.sp-internal-comment.is-other .sp-internal-comment-bubble {
  background: var(--sp-soft-fill, color-mix(in srgb, var(--palette-black) 5%, var(--color-surface)));
  color: var(--color-text-heading);
}

.sp-internal-comment-main:has(.sp-internal-comment-actions) .sp-internal-comment-stack {
  max-width: 100%;
}

.sp-internal-comment-foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0 4px;
  position: relative;
  z-index: 2;
}

.sp-internal-comment.is-other .sp-internal-comment-foot {
  align-self: flex-start;
}

.sp-internal-comment.is-own .sp-internal-comment-foot {
  align-items: flex-end;
  align-self: flex-end;
}

.sp-internal-comment-foot-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
}

.sp-internal-comment.is-own .sp-internal-comment-foot-row {
  flex-direction: row-reverse;
}

.sp-internal-comment-meta {
  margin: 0;
  font-size: 11px;
  font-weight: 400;
  line-height: 28px;
  letter-spacing: 0.01em;
  color: var(--color-text-muted);
  opacity: 0.58;
  flex: 0 0 auto;
}

.sp-internal-comment-edited {
  margin-left: 0.4em;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.sp-internal-comment-edited::before {
  content: "·";
  margin-right: 0.35em;
}

.sp-internal-comment-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sp-internal-comment-body .sp-note-mention {
  display: inline;
  padding: 0;
  border-radius: 0;
  background: none;
  color: #2f7de1;
  font-weight: 600;
}

.sp-internal-comment-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex: 0 0 auto;
  gap: 2px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.sp-internal-comment-react-wrap {
  position: relative;
  display: inline-flex;
}

.sp-internal-comment-foot .sp-internal-comment-react-popover,
.sp-internal-comment-foot .sp-internal-comment-react-popover[hidden] {
  display: grid;
  position: static;
  top: auto;
  bottom: auto;
  left: auto;
  right: auto;
  transform: none;
  z-index: auto;
  grid-template-rows: 0fr;
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  transition:
    grid-template-rows 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.18s ease;
}

.sp-internal-comment-foot .sp-internal-comment-react-popover.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  pointer-events: auto;
}

.sp-internal-comment-react-popover-inner {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px;
  min-height: 0;
  overflow: hidden;
  padding: 2px 0 0;
  transform: translateY(-6px);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-internal-comment-foot .sp-internal-comment-react-popover.is-open .sp-internal-comment-react-popover-inner {
  transform: none;
}

.sp-internal-comment:hover .sp-internal-comment-actions,
.sp-internal-comment:focus-within .sp-internal-comment-actions,
.sp-internal-comment:has(.sp-internal-comment-react-popover.is-open) .sp-internal-comment-actions,
.sp-internal-comment:has(.sp-internal-comment-action.is-confirming) .sp-internal-comment-actions {
  opacity: 1;
  pointer-events: auto;
}

.sp-internal-comment-action {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #8a8a8a;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.sp-internal-comment-action:hover,
.sp-internal-comment-action[aria-expanded="true"] {
  background: #f0f0f0;
  color: #5f5f5f;
}

.sp-internal-comment-action--danger:hover {
  background: #f0f0f0;
  color: var(--color-danger, #b42318);
}

.sp-internal-comment-action--danger.is-confirming-icon,
.sp-internal-comment-action--danger.is-confirming-icon:hover:not(:disabled) {
  background: color-mix(in srgb, var(--color-danger) 20%, var(--color-surface));
  color: var(--color-danger);
}

.sp-internal-comment-action--danger.is-confirming-icon > svg.lucide,
.sp-internal-comment-action--danger.is-confirming-icon > i[data-lucide] {
  animation: team-confirm-icon-pop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-internal-comment-action .lucide {
  width: 13px;
  height: 13px;
}

.sp-internal-composer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 0 0 auto;
  position: relative;
  z-index: 3;
  margin: 0 12px;
  background: #fff;
}

.sp-internal-thread.is-resolved .sp-internal-composer,
.sp-internal-composer.is-locked {
  pointer-events: none;
  opacity: 0.55;
}

.sp-internal-thread.is-resolved .sp-internal-composer .sp-note-textarea,
.sp-internal-composer.is-locked .sp-note-textarea {
  cursor: not-allowed;
}

.sp-internal-reply-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  padding: 6px 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 14%, var(--color-surface));
  color: var(--color-text-heading);
}

.sp-internal-reply-banner[data-banner-mode="edit"] {
  background: color-mix(in srgb, var(--palette-black) 5%, var(--color-surface));
}

.sp-internal-composer.is-editing .sp-note-composer {
  outline: 1px solid color-mix(in srgb, var(--palette-black) 14%, transparent);
  outline-offset: 0;
}

.sp-internal-reply-banner[hidden] {
  display: none !important;
}

.sp-internal-reply-banner-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.sp-internal-reply-banner-label {
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-text-muted);
}

.sp-internal-reply-banner-label strong {
  font-weight: 500;
  color: var(--color-text-heading);
}

.sp-internal-reply-banner-preview {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.35;
  color: var(--color-text-heading);
}

.sp-internal-comment-reply {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  box-sizing: border-box;
  min-width: 0;
  width: max-content;
  max-width: 100%;
  margin: 0 0 4px;
  padding: 4px 8px;
  overflow: hidden;
  border: 0;
  border-left: 2px solid color-mix(in srgb, var(--palette-black) 18%, transparent);
  border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, var(--palette-black) 4%, transparent);
  text-align: left;
  cursor: pointer;
}

.sp-internal-comment.is-own .sp-internal-comment-reply {
  align-self: flex-end;
  border-left: 0;
  border-right: 2px solid color-mix(in srgb, var(--palette-black) 18%, transparent);
  border-radius: 8px 0 0 8px;
  text-align: right;
  align-items: flex-end;
}

.sp-internal-comment-reply-name,
.sp-internal-comment-reply-preview {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-internal-comment-reply-name {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--color-text-muted);
}

.sp-internal-comment-reply-preview {
  font-size: 12px;
  line-height: 1.3;
  color: var(--color-text-heading);
  opacity: 0.78;
}

.sp-internal-comment.is-reply-target .sp-internal-comment-bubble {
  outline: 1px solid color-mix(in srgb, var(--palette-yellow-strong, #e0b81c) 45%, transparent);
}

.sp-internal-composer .sp-note-composer {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  padding: 4px 6px 4px 10px;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  position: relative;
  overflow: visible;
}

.sp-internal-composer .sp-note-composer:focus-within {
  border-color: #d8d8d8;
  background: #fff;
}

.sp-internal-composer .sp-note-composer:focus-within .sp-note-tool-btn {
  color: #555;
}

.sp-internal-composer .sp-note-composer-input-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.sp-internal-composer .sp-note-textarea {
  font-size: 13px;
  min-height: 20px;
  max-height: 6rem;
  line-height: 1.3;
}

.sp-internal-composer .sp-note-textarea::placeholder {
  color: #c0c0c0;
}

.sp-internal-composer .sp-note-composer-bar {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  min-height: 22px;
  flex: 0 0 auto;
}

.sp-internal-composer .sp-note-composer-tools,
.sp-internal-composer .sp-note-composer-actions {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.sp-internal-composer .sp-internal-snippets-wrap,
.sp-internal-composer .sp-note-emoji-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.sp-internal-composer .sp-note-emoji-wrap {
  position: relative;
}

.sp-internal-composer .sp-internal-snippets-wrap {
  position: static;
}

.sp-internal-composer .sp-snippets-popover {
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  width: auto;
  max-width: none;
}

.sp-internal-composer .sp-composer-slash {
  width: 14px;
  height: 14px;
  font-size: 10px;
  border-width: 1.5px;
  border-radius: 3px;
}

.sp-internal-composer .sp-note-emoji-popover {
  left: auto;
  right: 0;
  width: min(320px, calc(100vw - 48px));
  max-width: 320px;
}

.sp-internal-composer .sp-note-mention-menu {
  z-index: 50;
}

.sp-internal-composer .sp-note-tool-btn {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  box-sizing: border-box;
  border-radius: 999px;
  background: transparent;
  color: #8a8a8a;
}

.sp-internal-composer .sp-note-tool-btn:hover,
.sp-internal-composer .sp-note-tool-btn[aria-expanded="true"] {
  background: transparent;
  color: #5f5f5f;
}

.sp-internal-composer .sp-note-tool-btn .lucide,
.sp-internal-composer .sp-note-tool-btn svg {
  width: 14px;
  height: 14px;
}

.sp-internal-composer .sp-note-composer-send {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  box-sizing: border-box;
  font-size: 11px;
  background: #d8d8d8;
  color: #fff;
}

.sp-internal-composer .sp-note-composer-send .lucide,
.sp-internal-composer .sp-note-composer-send svg {
  width: 11px;
  height: 11px;
}

.sp-internal-composer .sp-note-composer-send:hover:not(:disabled),
.sp-internal-composer .sp-note-composer.has-content .sp-note-composer-send:not(:disabled),
.sp-internal-composer .sp-note-composer-send.is-ready:not(:disabled) {
  background: #cfcfcf;
  color: #fff;
}

.sp-internal-composer .sp-note-composer:focus-within .sp-note-composer-send:not(:disabled),
.sp-internal-composer .sp-note-composer:focus-within .sp-note-composer-send:hover:not(:disabled),
.sp-internal-composer .sp-note-composer:focus-within.has-content .sp-note-composer-send:not(:disabled),
.sp-internal-composer .sp-note-composer:focus-within .sp-note-composer-send.is-ready:not(:disabled) {
  background: color-mix(in srgb, var(--palette-yellow) 28%, var(--color-surface));
  color: var(--color-text-heading);
}

.sp-internal-composer .sp-note-composer-send:disabled {
  background: #d8d8d8;
  color: #fff;
  cursor: default;
  opacity: 0.55;
}

.sp-internal-composer-error {
  margin: 0;
  font-size: 12px;
}

.sp-internal-thread.is-resolved .sp-internal-thread-count-label,
.sp-internal-thread.is-resolved .sp-internal-thread-count-label span,
.sp-internal-thread.is-resolved .sp-internal-thread-count {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

html[data-theme="dark"] .sp-internal-thread {
  background: var(--color-surface);
  border-color: var(--color-hairline);
}

html[data-theme="dark"] .sp-internal-thread-head {
  background: var(--color-surface);
  border-bottom-color: var(--color-hairline);
}

html[data-theme="dark"] .sp-internal-thread-head:hover {
  background: color-mix(in srgb, #fff 6%, var(--color-surface));
}

html[data-theme="dark"] .sp-internal-thread.is-resolved .sp-internal-thread-head:hover {
  background: color-mix(in srgb, #fff 5%, var(--color-surface));
}

html[data-theme="dark"] .sp-internal-thread-head-btn:hover,
html[data-theme="dark"] .sp-internal-thread-head-btn[aria-expanded="true"] {
  background: color-mix(in srgb, #fff 10%, var(--color-surface));
  color: var(--color-text-heading);
}

html[data-theme="dark"] .sp-internal-thread-head-btn.is-resolved {
  color: var(--color-success, #3dba72);
  background: transparent;
}

html[data-theme="dark"] .sp-internal-thread-head-btn.is-resolved:hover {
  background: color-mix(in srgb, var(--color-success, #3dba72) 18%, var(--color-surface));
  color: var(--color-success, #3dba72);
}

html[data-theme="dark"] .sp-internal-thread.is-draft .sp-internal-thread-head:hover {
  background: var(--color-surface);
}

html[data-theme="dark"] .sp-internal-thread-head-avatars .sp-avatar {
  border-color: var(--color-surface);
}

html[data-theme="dark"] .sp-internal-thread-avatar-more {
  background: color-mix(in srgb, #fff 12%, var(--color-surface));
  color: var(--color-text-muted);
}

html[data-theme="dark"] .sp-internal-comment.is-other .sp-internal-comment-bubble {
  background: color-mix(in srgb, #fff 16%, var(--color-surface));
  color: var(--color-text-heading);
}

html[data-theme="dark"] .sp-internal-comment.is-own .sp-internal-comment-bubble {
  background: var(--color-surface-secondary);
  color: var(--color-text-heading);
}

html[data-theme="dark"] .sp-internal-comment-reply {
  background: color-mix(in srgb, #fff 8%, transparent);
  border-color: color-mix(in srgb, #fff 22%, transparent);
}

html[data-theme="dark"] .sp-internal-reply-banner {
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 10%, var(--color-surface));
}

html[data-theme="dark"] .sp-internal-comment-body .sp-note-mention {
  background: none;
  color: #9ecbff;
}

html[data-theme="dark"] .sp-internal-composer {
  background: var(--color-surface);
}

html[data-theme="dark"] .sp-internal-composer .sp-note-composer {
  background: var(--color-surface);
  border-color: var(--color-hairline);
}

html[data-theme="dark"] .sp-internal-composer .sp-note-textarea::placeholder {
  color: var(--color-text-muted);
}

.sp-thread-call-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.sp-thread-item.has-internal-thread .sp-thread-call-stack,
.sp-thread-item:has(.sp-internal-thread) .sp-thread-call-stack,
.sp-thread-item:has(.sp-thread-call-branch) .sp-thread-call-stack,
.sp-thread-item.has-internal-thread .sp-thread-call-primary,
.sp-thread-item:has(.sp-internal-thread) .sp-thread-call-primary,
.sp-thread-item:has(.sp-thread-call-branch) .sp-thread-call-primary {
  width: 100%;
  max-width: 100%;
}

.sp-thread-call-stack:has(.sp-thread-card-recording) {
  min-width: min(100%, 21rem);
}

.sp-thread-call-stack:has(.sp-thread-call-branch) {
  min-width: min(100%, 30rem);
}

.sp-thread-call-primary {
  width: max-content;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.sp-thread-call-primary:has(> .sp-thread-call-branch) {
  width: 100%;
  max-width: 100%;
}

.sp-thread-call-bubble {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  flex: 0 1 auto;
  width: max-content;
  max-width: min(21rem, 100%);
  min-width: 0;
  overflow: visible;
}

.sp-thread-item.is-outbound .sp-thread-call-bubble {
  align-items: flex-end;
}

.sp-thread-item.is-inbound .sp-thread-call-bubble {
  align-items: flex-start;
}

.sp-thread-call-bubble > .sp-thread-bubble-wrap {
  width: max-content;
  max-width: 100%;
}

.sp-thread-call-bubble > .sp-thread-card {
  flex: 0 1 auto;
  width: max-content;
  max-width: 100%;
  min-width: 0;
}

.sp-thread-bubble-grid > .sp-thread-card-meta {
  margin: 0 4px;
  width: max-content;
  max-width: 100%;
}

.sp-thread-bubble-grid > .sp-thread-call-branch {
  width: min(calc(30rem - 42px), 100%);
  max-width: min(calc(30rem - 42px), 100%);
  justify-self: stretch;
}

.sp-thread-item.is-outbound .sp-thread-bubble-grid > .sp-thread-call-branch {
  justify-self: end;
}

.sp-thread-item.is-inbound .sp-thread-bubble-grid > .sp-thread-call-branch {
  justify-self: start;
}

.sp-thread-call-branch {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.sp-thread-call-branch > .sp-call-notes {
  margin: 0;
  width: 100%;
}

/* Match bubble→summary spacing (row-gap + timestamp + row-gap). */
.sp-thread-card-meta + .sp-thread-call-branch + .sp-internal-thread-slot:not(:empty) {
  margin-top: calc(11px * 1.2 + 4px);
}

.sp-thread-card {
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 0;
  border-radius: 16px;
  background: var(--sp-soft-fill, color-mix(in srgb, var(--palette-black) 5%, var(--color-surface)));
  box-shadow: none;
}

.sp-thread-item.is-inbound .sp-thread-card {
  background: var(--sp-soft-fill, color-mix(in srgb, var(--palette-black) 8%, var(--color-surface)));
}

.sp-thread-item.is-outbound .sp-thread-card {
  background: var(--color-surface-secondary);
}

.sp-thread-item.is-inbound .sp-rec-player {
  background: #fff;
}

.sp-thread-item.is-outbound .sp-rec-player {
  background: color-mix(in srgb, var(--palette-yellow) 14%, #fff);
}

html[data-theme="dark"] .sp-thread-item.is-inbound .sp-thread-card,
html[data-theme="dark"] .sp-sms-card.is-inbound {
  background: color-mix(in srgb, #fff 16%, var(--color-surface));
  color: var(--color-text-heading);
}

html[data-theme="dark"] .sp-thread-item.is-outbound .sp-thread-card {
  background: color-mix(in srgb, var(--palette-yellow) 12%, #2b281e);
  color: var(--color-text-heading);
}

html[data-theme="dark"] .sp-thread-item.is-outbound .sp-thread-card-title,
html[data-theme="dark"] .sp-thread-item.is-outbound .sp-thread-card-title.soft-phone-history-status,
html[data-theme="dark"] .sp-thread-item.is-outbound .sp-thread-card-title.soft-phone-history-status[data-status] {
  color: var(--color-text-heading);
}

html[data-theme="dark"] .sp-thread-item.is-outbound .sp-thread-card-sub {
  color: color-mix(in srgb, var(--color-text-heading) 62%, transparent);
}

html[data-theme="dark"] .sp-rec-player,
html[data-theme="dark"] .sp-thread-item.is-inbound .sp-rec-player {
  background: color-mix(in srgb, #fff 10%, #1c1b17);
}

html[data-theme="dark"] .sp-thread-item.is-outbound .sp-rec-player {
  background: color-mix(in srgb, var(--palette-yellow) 8%, #1c1b17);
}

html[data-theme="dark"] .sp-rec-play,
html[data-theme="dark"] .sp-rec-time,
html[data-theme="dark"] .sp-rec-vol-btn,
html[data-theme="dark"] .sp-rec-rate-btn,
html[data-theme="dark"] .sp-rec-download,
html[data-theme="dark"] .sp-rec-player .sp-thread-card-transcript-btn {
  color: color-mix(in srgb, #fff 72%, transparent);
}

html[data-theme="dark"] .sp-rec-vol-btn:hover,
html[data-theme="dark"] .sp-rec-vol.is-open .sp-rec-vol-btn,
html[data-theme="dark"] .sp-rec-rate-btn:hover,
html[data-theme="dark"] .sp-rec-rate.is-open .sp-rec-rate-btn,
html[data-theme="dark"] .sp-rec-download:hover,
html[data-theme="dark"] .sp-rec-play:hover,
html[data-theme="dark"] .sp-rec-player .sp-thread-card-transcript-btn:hover:not(:disabled) {
  color: #fff;
  opacity: 1;
}

html[data-theme="dark"] .sp-rec-seek::-webkit-slider-runnable-track {
  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--palette-yellow) 70%, #fff) 0%,
    color-mix(in srgb, var(--palette-yellow) 70%, #fff) var(--sp-rec-progress, 0%),
    color-mix(in srgb, #fff 16%, transparent) var(--sp-rec-progress, 0%),
    color-mix(in srgb, #fff 16%, transparent) 100%
  );
}

html[data-theme="dark"] .sp-rec-seek::-webkit-slider-thumb,
html[data-theme="dark"] .sp-rec-seek::-moz-range-thumb {
  background: #f3efe6;
  box-shadow: 0 1px 3px color-mix(in srgb, #000 55%, transparent);
}

html[data-theme="dark"] .sp-rec-seek::-moz-range-progress {
  background: color-mix(in srgb, var(--palette-yellow) 70%, #fff);
}

html[data-theme="dark"] .sp-rec-seek::-moz-range-track {
  background: color-mix(in srgb, #fff 16%, transparent);
}

html[data-theme="dark"] .sp-sms-card.is-outbound {
  background: color-mix(in srgb, var(--palette-yellow) 12%, #2b281e);
  color: var(--color-text-heading);
}

html[data-theme="dark"] .sp-thread-card-meta {
  color: var(--color-text-muted);
}

.sp-thread-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.sp-thread-card-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--palette-black) 45%, var(--color-surface));
  color: #fff;
  font-size: 15px;
  line-height: 1;
}

.sp-thread-card-icon > .lucide {
  display: block;
  line-height: 1;
}

.sp-thread-card-icon[data-status="missed"],
.sp-thread-card-icon[data-status="rejected"],
.sp-thread-card-icon[data-status="failed"],
.sp-thread-card-icon[data-status="canceled"] {
  background: color-mix(in srgb, var(--color-danger) 88%, var(--palette-black));
}

.sp-thread-card-icon-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--sp-card-bg, var(--color-surface));
  color: var(--color-text-muted);
  font-size: 9px;
  line-height: 1;
}

.sp-thread-card-icon-badge .lucide {
  display: block;
  line-height: 1;
}

.sp-thread-card-icon[data-status="missed"] .sp-thread-card-icon-badge,
.sp-thread-card-icon[data-status="rejected"] .sp-thread-card-icon-badge,
.sp-thread-card-icon[data-status="failed"] .sp-thread-card-icon-badge,
.sp-thread-card-icon[data-status="canceled"] .sp-thread-card-icon-badge {
  color: var(--color-danger);
}

.sp-thread-card-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding-top: 0;
}

.sp-thread-card-title {
  margin: 0;
  font-family: var(--body-font);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text-heading);
}

.sp-thread-card-title.soft-phone-history-status {
  display: block;
  align-items: unset;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-heading);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
}

.sp-thread-card-title.soft-phone-history-status[data-status="missed"],
.sp-thread-card-title.soft-phone-history-status[data-status="failed"],
.sp-thread-card-title.soft-phone-history-status[data-status="rejected"],
.sp-thread-card-title.soft-phone-history-status[data-status="canceled"] {
  background: transparent;
  color: var(--color-text-heading);
}

.sp-thread-card-title.soft-phone-history-status[data-status="completed"] {
  background: transparent;
  color: var(--color-text-heading);
}

.sp-thread-card-sub {
  margin: 0;
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.sp-thread-card-recording {
  margin-top: 10px;
}

.sp-thread-card-recording-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
}

.sp-thread-card-recording-label {
  margin: 0;
  font-family: var(--body-font);
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-muted);
}

.sp-thread-card-transcript-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--color-text-muted);
  line-height: 0;
  cursor: pointer;
}

.sp-thread-card-transcript-btn:hover:not(:disabled) {
  color: var(--color-text-heading);
  opacity: 0.85;
}

.sp-thread-card-transcript-btn:disabled {
  color: var(--color-text-muted);
  cursor: default;
  opacity: 0.75;
}

.sp-thread-card-transcript-btn.is-failed {
  color: var(--color-danger);
}

.sp-thread-card-transcript-btn.is-ready {
  color: var(--color-primary);
}

.sp-thread-card-transcript-btn.is-ready:hover:not(:disabled) {
  color: var(--color-primary);
  opacity: 0.85;
}

.sp-thread-card-transcript-btn .lucide,
.sp-thread-card-transcript-btn .sp-thread-card-transcript-icon {
  width: 14px;
  height: 14px;
  display: block;
  flex-shrink: 0;
}

.sp-thread-card-transcript-btn .soft-phone-transcript-spinner {
  width: 0.75rem;
  height: 0.75rem;
}

.sp-thread-card-transcript {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 14px 14px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--sp-card-bg, var(--color-surface));
}

.sp-thread-item.is-outbound .sp-thread-card-transcript,
.sp-thread-item.is-inbound .sp-thread-card-transcript {
  background: var(--sp-card-bg, var(--color-surface));
}

.sp-thread-card-transcript-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
}

.sp-thread-card-transcript-title {
  margin: 0;
  font-family: var(--button-font-family);
  font-size: var(--button-font-size);
  font-weight: var(--button-font-weight);
  line-height: 1.25;
  color: var(--color-text-heading);
}

.sp-thread-card-transcript-label {
  margin: 0 0 8px;
  font-family: var(--body-font);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text-heading);
}

.sp-thread-card-transcript-body {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  font-family: var(--body-font);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: #3a3a3a;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.sp-thread-card-transcript.is-pending .sp-thread-card-transcript-body,
.sp-thread-card-transcript.is-failed .sp-thread-card-transcript-body {
  color: var(--color-text-muted);
}

.sp-thread-card-transcript-body.is-loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.sp-thread-card-transcript-body.is-loading .soft-phone-transcript-spinner {
  flex: 0 0 auto;
}

.sp-call-notes {
  --sp-call-notes-ai: color-mix(in srgb, var(--palette-yellow-strong, #e0b81c) 70%, var(--color-text-muted));
  --sp-call-notes-text: var(--color-text-muted);
  --sp-call-notes-title: color-mix(in srgb, var(--color-text-heading) 72%, var(--color-text-muted));
  display: block;
  width: 100%;
  margin: 10px 0 0;
  padding: 14px 14px 12px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
  text-align: left;
  cursor: pointer;
  color: var(--sp-call-notes-text);
}

.sp-call-notes-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 10px;
  margin: 0 0 8px;
}

.sp-call-notes-title {
  margin: 0;
  font-family: var(--body-font);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: var(--sp-call-notes-title);
}

.sp-call-notes-open {
  font-family: var(--body-font);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.sp-call-notes-label {
  margin: 0 0 6px;
  font-family: var(--body-font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  line-height: 1.3;
  color: var(--sp-call-notes-title);
}

.sp-call-notes-section {
  margin-top: 12px;
}

.sp-call-notes-section + .sp-call-notes-section {
  margin-top: 12px;
}

.sp-call-notes-list {
  margin: 0;
  padding: 0 0 0 1.05rem;
  list-style: disc;
}

.sp-call-notes-list li {
  margin: 0 0 5px;
  padding-left: 2px;
  font-family: var(--body-font);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--sp-call-notes-text);
}

.sp-call-notes-list li::marker {
  color: var(--sp-call-notes-ai);
}

.sp-call-notes-list li:last-child {
  margin-bottom: 0;
}

.sp-call-notes-empty,
.sp-call-notes-pending {
  margin: 0;
  font-family: var(--body-font);
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.sp-call-notes-pending {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.sp-call-notes-pending-copy {
  background: linear-gradient(
    100deg,
    var(--color-text-muted) 0%,
    var(--color-text-muted) 35%,
    color-mix(in srgb, var(--palette-yellow-strong) 70%, var(--color-text-heading)) 50%,
    var(--color-text-muted) 65%,
    var(--color-text-muted) 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sp-ai-shimmer 2.4s ease-in-out infinite;
}

.sp-ai-think {
  position: relative;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
}

.sp-ai-think-core {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 30%,
    #fff8d6 0%,
    var(--palette-yellow) 45%,
    var(--palette-yellow-strong) 100%
  );
  box-shadow:
    0 0 0 0 color-mix(in srgb, var(--palette-yellow) 45%, transparent),
    0 0 10px color-mix(in srgb, var(--palette-yellow) 55%, transparent);
  animation: sp-ai-core-pulse 1.6s ease-in-out infinite;
}

.sp-ai-think-spark {
  position: absolute;
  width: 0.34rem;
  height: 0.34rem;
  border-radius: 50%;
  background: var(--palette-yellow-strong);
  box-shadow: 0 0 6px color-mix(in srgb, var(--palette-yellow) 70%, transparent);
  animation: sp-ai-spark 1.8s ease-in-out infinite;
}

.sp-ai-think-spark--a {
  top: 0;
  left: 38%;
  animation-delay: 0s;
}

.sp-ai-think-spark--b {
  right: 0;
  bottom: 18%;
  width: 0.26rem;
  height: 0.26rem;
  animation-delay: 0.35s;
}

.sp-ai-think-spark--c {
  left: 4%;
  bottom: 6%;
  width: 0.22rem;
  height: 0.22rem;
  animation-delay: 0.7s;
}

@keyframes sp-ai-core-pulse {
  0%,
  100% {
    transform: scale(0.88);
    box-shadow:
      0 0 0 0 color-mix(in srgb, var(--palette-yellow) 20%, transparent),
      0 0 6px color-mix(in srgb, var(--palette-yellow) 35%, transparent);
  }
  50% {
    transform: scale(1.08);
    box-shadow:
      0 0 0 5px color-mix(in srgb, var(--palette-yellow) 0%, transparent),
      0 0 14px color-mix(in srgb, var(--palette-yellow) 65%, transparent);
  }
}

@keyframes sp-ai-spark {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.55);
  }
  40% {
    opacity: 1;
    transform: scale(1.15);
  }
  70% {
    opacity: 0.55;
    transform: scale(0.8);
  }
}

@keyframes sp-ai-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: -100% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sp-ai-think-core,
  .sp-ai-think-spark,
  .sp-call-notes-pending-copy {
    animation: none;
  }

  .sp-call-notes-pending-copy {
    color: var(--color-text-muted);
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
  }

  .sp-ai-think-core {
    transform: none;
    box-shadow: 0 0 8px color-mix(in srgb, var(--palette-yellow) 45%, transparent);
  }

  .sp-ai-think-spark {
    opacity: 0.7;
  }
}

html[data-theme="dark"] .sp-call-notes {
  --sp-call-notes-ai: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 65%, var(--color-text-muted));
  --sp-call-notes-text: var(--color-text-muted);
  --sp-call-notes-title: color-mix(in srgb, var(--color-text-heading) 78%, var(--color-text-muted));
  background: var(--color-surface);
  border-color: var(--color-hairline);
  color: var(--sp-call-notes-text);
}

.sp-thread-card-transcript-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sp-thread-card-transcript-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
  font-family: var(--body-font);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.sp-thread-card-transcript-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sp-thread-card-transcript-speaker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0.45em 0 0;
  font-weight: 500;
  color: var(--color-text-muted);
}

.sp-thread-card-transcript-speaker .soft-phone-transcript-speaker-name {
  font-family: var(--mono-font, var(--body-font));
  font-size: 11px;
  font-weight: 500;
  color: color-mix(in srgb, var(--color-text-muted) 88%, transparent);
}

.sp-thread-card-transcript-time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 1px 0 0;
  padding: 1px 7px;
  min-width: 0;
  border: 0;
  border-radius: 999px;
  background: var(--btn-soft-fill);
  color: color-mix(in srgb, var(--palette-ink, #171612) 68%, transparent);
  font-family: var(--mono-font, var(--button-font-family));
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sp-thread-card-transcript-text {
  font: inherit;
  color: inherit;
  overflow-wrap: anywhere;
}

.sp-thread-card-transcript.is-playing .sp-transcript-word {
  transition: color 120ms ease, background-color 120ms ease;
}

.sp-thread-card-transcript.is-playing .sp-transcript-word.is-upcoming {
  color: var(--color-text-muted);
}

.sp-thread-card-transcript.is-playing .sp-transcript-word.is-past {
  color: #2a2a2a;
}

.soft-phone-transcript-lines.is-playing .sp-transcript-word {
  transition: color 120ms ease, background-color 120ms ease;
}

.soft-phone-transcript-lines.is-playing .sp-transcript-word.is-upcoming {
  color: color-mix(in srgb, var(--color-text-muted) 72%, transparent);
}

.soft-phone-transcript-lines.is-playing .sp-transcript-word.is-past {
  color: var(--color-text-heading);
}

.soft-phone-transcript-line.is-active .soft-phone-transcript-time {
  background: color-mix(in srgb, var(--palette-yellow) 58%, var(--color-surface));
  color: color-mix(in srgb, var(--palette-ink, #171612) 78%, transparent);
  font-weight: 600;
}

.sp-transcript-word {
  display: inline;
  border-radius: 3px;
  padding: 0 1px;
  cursor: pointer;
}

.sp-transcript-word.is-active {
  color: var(--color-text-heading);
  background: var(--btn-soft-fill-hover);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.sp-thread-card-transcript-line.is-active .sp-thread-card-transcript-time {
  background: color-mix(in srgb, var(--palette-yellow) 58%, var(--color-surface));
  color: color-mix(in srgb, var(--palette-ink, #171612) 78%, transparent);
  font-weight: 600;
  border: 0;
}

.sp-rec-player {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  min-height: 36px;
  padding: 5px 8px 5px 8px;
  border-radius: 999px;
  background: #f1f1f1;
  overflow: visible;
}

.sp-rec-player > .sp-rec-seek {
  margin-inline: 6px;
}

.sp-rec-player audio {
  display: none;
}

.sp-rec-play,
.sp-rec-vol-btn,
.sp-rec-rate-btn,
.sp-rec-download,
.sp-rec-player .sp-thread-card-transcript-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  min-width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-muted);
  line-height: 0;
  cursor: pointer;
}

.sp-rec-play {
  color: var(--color-text-heading);
}

.sp-rec-play:hover {
  color: var(--color-text-heading);
  opacity: 0.85;
}

.sp-rec-play .lucide,
.sp-rec-vol-btn .lucide,
.sp-rec-vol-btn i[data-lucide],
.sp-rec-download .lucide,
.sp-rec-player .sp-thread-card-transcript-btn .lucide,
.sp-rec-player .sp-thread-card-transcript-btn .sp-thread-card-transcript-icon {
  display: block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transform-origin: center;
}

.sp-rec-vol,
.sp-rec-rate {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  align-self: center;
}

.sp-rec-seek {
  flex: 1 1 auto;
  min-width: 4rem;
  height: 4px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
  align-self: center;
}

.sp-rec-seek::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--color-primary) 0%,
    var(--color-primary) var(--sp-rec-progress, 0%),
    var(--sp-chip-bg-hover, color-mix(in srgb, var(--palette-black) 14%, var(--color-surface))) var(--sp-rec-progress, 0%),
    var(--sp-chip-bg-hover, color-mix(in srgb, var(--palette-black) 14%, var(--color-surface))) 100%
  );
}

.sp-rec-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5.5px;
  border: 0;
  border-radius: 999px;
  background: var(--sp-card-bg, var(--color-surface));
  box-shadow: 0 1px 3px color-mix(in srgb, var(--palette-black) 28%, transparent);
  cursor: pointer;
}

.sp-rec-seek::-moz-range-track {
  height: 3px;
  border-radius: 999px;
  background: var(--sp-chip-bg-hover, color-mix(in srgb, var(--palette-black) 14%, var(--color-surface)));
}

.sp-rec-seek::-moz-range-progress {
  height: 3px;
  border-radius: 999px;
  background: var(--color-primary);
}

.sp-rec-seek::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 999px;
  background: var(--sp-card-bg, var(--color-surface));
  box-shadow: 0 1px 3px color-mix(in srgb, var(--palette-black) 28%, transparent);
  cursor: pointer;
}

.sp-rec-time {
  flex-shrink: 0;
  min-width: 2rem;
  margin: 0;
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 500;
  line-height: 24px;
  color: var(--color-text-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
  align-self: center;
}

.sp-rec-vol-btn {
  color: var(--color-text-muted);
  font-size: 14px;
}

.sp-rec-vol-btn.is-icon-swap .lucide,
.sp-rec-vol-btn.is-icon-swap i[data-lucide] {
  animation: sp-rec-vol-icon-swap 200ms ease;
}

@keyframes sp-rec-vol-icon-swap {
  0% {
    opacity: 0;
    transform: scale(0.55);
  }
  60% {
    opacity: 1;
    transform: scale(1.12);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.sp-rec-vol-btn:hover,
.sp-rec-vol.is-open .sp-rec-vol-btn {
  color: var(--color-text-heading);
}

.sp-rec-volume {
  display: none;
  position: absolute;
  left: 50%;
  right: auto;
  top: calc(100% + 8px);
  bottom: auto;
  width: 72px;
  height: 4px;
  margin: 0;
  padding: 10px 8px;
  box-sizing: content-box;
  transform: translateX(-50%);
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  background: var(--sp-chip-bg, color-mix(in srgb, var(--palette-black) 8%, var(--color-surface)));
  box-shadow: 0 1px 4px color-mix(in srgb, var(--palette-black) 16%, transparent);
  cursor: pointer;
  z-index: 5;
}

.sp-rec-vol.is-open .sp-rec-volume {
  display: block;
}

.sp-rec-volume::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--color-primary) 0%,
    var(--color-primary) var(--sp-rec-volume, 100%),
    var(--sp-chip-bg-hover, color-mix(in srgb, var(--palette-black) 14%, var(--color-surface))) var(--sp-rec-volume, 100%),
    var(--sp-chip-bg-hover, color-mix(in srgb, var(--palette-black) 14%, var(--color-surface))) 100%
  );
}

.sp-rec-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  border: 0;
  border-radius: 999px;
  background: var(--sp-card-bg, var(--color-surface));
  box-shadow: 0 1px 2px color-mix(in srgb, var(--palette-black) 24%, transparent);
  cursor: pointer;
}

.sp-rec-volume::-moz-range-track {
  height: 3px;
  border-radius: 999px;
  background: var(--sp-chip-bg-hover, color-mix(in srgb, var(--palette-black) 14%, var(--color-surface)));
}

.sp-rec-volume::-moz-range-progress {
  height: 3px;
  border-radius: 999px;
  background: var(--color-primary);
}

.sp-rec-volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: var(--sp-card-bg, var(--color-surface));
  box-shadow: 0 1px 2px color-mix(in srgb, var(--palette-black) 24%, transparent);
  cursor: pointer;
}

.sp-rec-rate-btn {
  color: var(--color-text-muted);
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.sp-rec-rate-btn:hover,
.sp-rec-rate.is-open .sp-rec-rate-btn {
  color: var(--color-text-heading);
  background: transparent;
}

.sp-rec-rate-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-width: 4.5rem;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--palette-black) 10%, transparent);
  border-radius: 8px;
  background: var(--sp-card-bg, var(--color-surface));
  box-shadow: 0 8px 20px color-mix(in srgb, var(--palette-black) 14%, transparent);
}

.sp-rec-rate-menu[hidden] {
  display: none;
}

.sp-rec-rate-menu button {
  display: block;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-heading);
  font-family: var(--mono-font);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.sp-rec-rate-menu button:hover {
  background: var(--gray-200);
}

.sp-rec-rate-menu button.is-selected {
  background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface));
  color: var(--color-primary);
}

.sp-rec-download:hover {
  color: var(--color-text-heading);
}

@media (max-width: 640px) {
  .sp-rec-volume {
    width: 64px;
  }
}

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

.sp-thread-card-actions:empty,
.sp-thread-card-actions:not(:has(*)) {
  display: none;
  margin: 0;
  padding: 0;
}

.sp-thread-card-actions .soft-phone-history-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sp-thread-card-actions .btn,
.sp-thread-card-actions .soft-phone-list-btn {
  min-height: 30px;
  border-color: color-mix(in srgb, var(--palette-black) 14%, transparent);
  background: var(--sp-card-bg, var(--color-surface));
}

.sp-dialer-dock {
  padding: 0;
  background: transparent;
}

.soft-phone-dialer-panel {
  max-width: 22rem;
}

.soft-phone-dialer-status-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.sp-dialer-dock .soft-phone-dial-display {
  margin-bottom: 12px;
}

.sp-dialer-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.sp-dialer-media .soft-phone-media-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 8px;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-button);
  background: var(--color-surface);
  font-size: 18px;
  color: var(--color-text-primary);
  cursor: pointer;
}

.sp-dialer-media .soft-phone-media-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.sp-dialer-media #soft-phone-captions-btn {
  grid-column: 1 / -1;
  width: 100%;
}

.sp-dialer-call-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}


/* --- Active call dock ---------------------------------------------------- */

.sp-active-call {
  position: fixed;
  right: 8px;
  bottom: 8px;
  z-index: 72;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: min(22rem, calc(100vw - 1.5rem));
  padding: 14px 14px 12px;
  border: 1px solid var(--sp-dock-line);
  border-radius: 18px;
  background: var(--sp-dock-bg);
  color: var(--sp-dock-fg);
  backface-visibility: hidden;
}

/* Spacing via margins so collapsed clips don't leave flex-gap holes. */
.sp-active-call > * + * {
  margin-top: 12px;
}

.sp-active-call > audio,
.sp-active-call > .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px !important;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sp-active-call.is-centered,
.sp-active-call.is-placed {
  right: auto;
  bottom: auto;
}

.sp-active-call.is-centered {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.sp-active-call.is-animating {
  will-change: transform;
  transition: transform 0.62s cubic-bezier(0.16, 1, 0.3, 1);
}

.sp-active-call.is-entering {
  animation: sp-active-call-enter 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes sp-active-call-enter {
  from {
    opacity: 0;
    filter: blur(2px);
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    filter: none;
    transform: none;
  }
}

.sp-active-call.is-placed.is-entering {
  animation-name: sp-active-call-enter-placed;
}

@keyframes sp-active-call-enter-placed {
  from {
    opacity: 0;
    filter: blur(2px);
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    filter: none;
    transform: none;
  }
}

.sp-active-call.is-dragging {
  user-select: none;
  cursor: grabbing;
  transition: none !important;
  will-change: left, top;
}

.sp-active-call[hidden] {
  display: none !important;
}

.sp-active-call-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--sp-dock-line);
  cursor: grab;
  touch-action: none;
}

.sp-active-call.is-dragging .sp-active-call-header {
  cursor: grabbing;
}

.sp-active-call-header button {
  cursor: pointer;
  touch-action: manipulation;
}

.sp-active-call-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.sp-active-call-emoji {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
}

.sp-active-call-emoji:empty {
  display: none;
}

.sp-active-call-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--body-font);
  font-size: 14px;
  font-weight: 600;
  color: color-mix(in srgb, var(--sp-dock-fg) 92%, transparent);
}

.sp-active-call-timer {
  flex-shrink: 0;
  font-family: var(--mono-font);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--sp-dock-fg) 62%, transparent);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.sp-active-call-timer.is-phase {
  padding: 3px 10px;
  border: 1px solid #2f9e44;
  border-radius: 999px;
  font-family: var(--body-font);
  font-size: 10px;
  font-weight: 400;
  font-variant-numeric: normal;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
  color: #2f9e44;
  background: transparent;
}

.sp-active-call-timer[hidden],
.sp-active-call-close[hidden],
.sp-active-call-header-actions[hidden] {
  display: none !important;
}

.sp-active-call-header-actions {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sp-active-call-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: var(--sp-dock-chip);
  color: var(--sp-dock-soft);
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.22s ease, transform 0.22s ease, background 0.15s ease;
}

.sp-active-call-close:hover {
  background: var(--sp-dock-chip-hover);
  color: var(--sp-dock-fg, #f3efe6);
}

.sp-active-call-number-option-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.sp-active-call-number-option-row .sp-active-call-number-option {
  flex: 1 1 auto;
  min-width: 0;
}

.sp-ios-switch {
  position: relative;
  width: 2.55rem;
  height: 1.45rem;
  flex-shrink: 0;
}

.sp-active-call-number-menu .sp-ios-switch input {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.sp-ios-switch-ui {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: color-mix(in srgb, var(--sp-dock-fg, #f3efe6) 22%, transparent);
  pointer-events: none;
  transition: background-color 0.15s ease;
}

.sp-ios-switch-ui::after {
  content: "";
  position: absolute;
  top: 0.16rem;
  left: 0.16rem;
  width: 1.13rem;
  height: 1.13rem;
  border-radius: 50%;
  background: var(--sp-dock-fg, #f3efe6);
  box-shadow: 0 1px 2px color-mix(in srgb, #000 28%, transparent);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.sp-ios-switch input:checked + .sp-ios-switch-ui {
  background: #34c759;
}

.sp-ios-switch input:checked + .sp-ios-switch-ui::after {
  background: #fff;
  transform: translateX(1.1rem);
}

.sp-ios-switch input:focus-visible + .sp-ios-switch-ui {
  box-shadow: 0 0 0 2px color-mix(in srgb, #34c759 55%, transparent);
}

.sp-ios-switch input:indeterminate + .sp-ios-switch-ui {
  background: color-mix(in srgb, #34c759 55%, var(--sp-dock-fg, #f3efe6) 22%);
}

.sp-ios-switch input:indeterminate + .sp-ios-switch-ui::after {
  transform: translateX(0.55rem);
}

.sp-active-call-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sp-active-call-picker-row .sp-active-call-people {
  flex: 1 1 auto;
  min-width: 0;
}

.sp-active-call-dial-wrap {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.sp-active-call-dial-field {
  position: relative;
  min-width: 0;
}

.sp-active-call-dial-field .sp-active-call-dial {
  padding-right: 52px;
}

.sp-active-call-dial-field #soft-phone-group-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  z-index: 1;
  transform: translateY(-50%);
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 36px;
  height: 36px;
  min-height: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  font-size: 18px;
  color: var(--palette-yellow, #f2cf3f);
  background: transparent;
  box-shadow: none;
}

.sp-active-call-dial-field #soft-phone-group-toggle::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 20px;
  background: var(--sp-dock-line-strong, color-mix(in srgb, #f3efe6 14%, transparent));
  pointer-events: none;
}

.sp-active-call-dial-field #soft-phone-group-toggle:hover:not(:disabled) {
  background: transparent;
}

.sp-active-call-dial-field #soft-phone-group-toggle:disabled {
  opacity: 0.35;
  cursor: default;
}

.sp-active-call-group-user {
  display: block;
  width: 26px;
  height: 26px;
}

.sp-active-call-dial-field #soft-phone-group-toggle.is-live,
.sp-active-call-dial-field #soft-phone-group-toggle.sp-active-call-btn--group.is-live {
  color: var(--palette-yellow, #f2cf3f);
  background: transparent;
}

.sp-active-call-dial-field #soft-phone-group-toggle.is-live:hover:not(:disabled) {
  background: transparent;
}

.sp-active-call.is-live-call .sp-active-call-dial-field #soft-phone-group-toggle,
.sp-active-call.is-connecting .sp-active-call-dial-field #soft-phone-group-toggle {
  display: none !important;
}

.sp-active-call.is-live-call .sp-active-call-dial-field .sp-active-call-dial,
.sp-active-call.is-connecting .sp-active-call-dial-field .sp-active-call-dial {
  padding-right: 12px;
}

.sp-active-call-dial-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 14rem;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--sp-dock-line);
  border-radius: 12px;
  background: #000;
  box-shadow: 0 12px 28px color-mix(in srgb, #000 38%, transparent);
}

.sp-active-call-dial-suggest[hidden] {
  display: none !important;
}

.sp-active-call-dial-suggest-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.sp-active-call-dial-suggest-option:hover,
.sp-active-call-dial-suggest-option.is-active {
  background: var(--sp-dock-chip);
}

.sp-active-call-dial-suggest-option .sp-avatar {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  font-size: 11px;
}

.sp-active-call-dial-suggest-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sp-active-call-dial-suggest-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  color: var(--sp-dock-fg, #f3efe6);
}

.sp-active-call-dial-suggest-phone {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--sp-dock-muted, #9a958a);
}

.sp-active-call-people {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-inline: 0;
  margin-bottom: 0;
  padding: 0;
  list-style: none;
  position: relative;
  z-index: 5;
}

.sp-active-call-people.is-solo {
  align-items: stretch;
  text-align: left;
}

.sp-active-call-people.is-solo .sp-active-call-person {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.sp-active-call-people.is-solo .sp-active-call-person-meta {
  justify-content: flex-start;
  min-width: 0;
}

.sp-active-call-people.is-solo .sp-active-call-person-avatar {
  width: 48px;
  height: 48px;
  font-size: 16px;
}

.sp-active-call-people.is-solo .sp-active-call-person-avatar.sp-avatar--emoji {
  font-size: 26px;
}

.sp-active-call-person--picker {
  position: relative;
  display: block;
}

.sp-active-call-people.is-solo .sp-active-call-person--picker {
  display: block;
}

.sp-active-call-number-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--sp-dock-line) 55%, transparent);
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.sp-active-call-number-btn:hover,
.sp-active-call-number-btn[aria-expanded="true"] {
  background: var(--sp-dock-chip);
  border-color: var(--sp-dock-chip-hover);
}

.sp-active-call-number-btn .sp-active-call-person-meta {
  flex: 1;
  min-width: 0;
}

.sp-active-call-number-caret {
  width: 16px;
  height: 16px;
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.55;
}

.sp-active-call-number-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 12.5rem;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--sp-dock-line);
  border-radius: 12px;
  background: #000;
  box-shadow: 0 12px 28px color-mix(in srgb, #000 55%, transparent);
}

.sp-active-call-number-menu[hidden] {
  display: none;
}

.sp-active-call-number-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: #141414;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.sp-active-call-number-option:hover,
.sp-active-call-number-option.is-selected {
  background: #1f1f1f;
}

.sp-active-call-number-option-emoji,
.sp-active-call-number-option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
  opacity: 0.9;
}

.sp-active-call-clip {
  display: grid;
  grid-template-rows: 1fr;
  min-height: 0;
  transition: grid-template-rows 0.62s cubic-bezier(0.16, 1, 0.3, 1);
}

.sp-active-call-clip.is-collapsed {
  grid-template-rows: 0fr;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Collapsed clips shouldn't invent a gap before the next visible block. */
.sp-active-call-clip.is-collapsed + .sp-active-call-controls {
  margin-top: 12px;
}

.sp-active-call-clip-inner {
  min-height: 0;
  overflow: hidden;
}

.sp-active-call-dial {
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--sp-dock-chip-hover);
  border-radius: 12px;
  background: transparent;
  color: var(--sp-dock-fg, #f3efe6);
  font-family: var(--mono-font);
  font-size: 18px;
  letter-spacing: 0.02em;
  text-align: center;
  opacity: 1;
  transition:
    opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.2s ease;
}

.sp-active-call-clip.is-collapsed .sp-active-call-dial {
  opacity: 0;
}

.sp-active-call-dial::placeholder {
  color: var(--sp-dock-dim);
}

.sp-active-call-dial:focus {
  outline: none;
  border-color: var(--sp-dock-line-focus);
  background: transparent;
}

.sp-active-call-dial:disabled {
  opacity: 0.7;
}

.sp-active-call-person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sp-active-call-person-avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  font-size: 12px;
  transition:
    width 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    font-size 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-active-call-person-avatar.sp-avatar--unknown {
  background: color-mix(in srgb, var(--color-accent) 55%, var(--color-surface));
  color: var(--color-text-heading);
  font-size: 16px;
}

.sp-active-call-person-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sp-active-call-person-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sp-active-call-person-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
  color: var(--sp-dock-fg, #f3efe6);
}

.sp-active-call-person-phone {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--sp-dock-faint, color-mix(in srgb, var(--sp-dock-fg, #f3efe6) 55%, transparent));
}

.sp-active-call-pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  justify-items: stretch;
  opacity: 1;
  transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-active-call-clip.is-collapsed .sp-active-call-pad {
  opacity: 0;
}

.sp-active-call-pad-key {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 8px 0;
  border: 0;
  border-radius: 10px;
  background: var(--sp-dock-chip);
  color: var(--sp-dock-fg, #f3efe6);
  font-family: var(--mono-font);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.1;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.sp-active-call-pad-key:hover {
  background: var(--sp-dock-chip-hover);
}

.sp-active-call-pad-sub {
  margin-top: 2px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: color-mix(in srgb, var(--sp-dock-fg) 45%, transparent);
}

.sp-active-call-transfer-panel {
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--sp-dock-fg) 6%, #1a1a1a);
  border: 1px solid color-mix(in srgb, var(--sp-dock-fg) 10%, transparent);
}

.sp-active-call-transfer-panel[hidden] {
  display: none !important;
}

.sp-active-call-transfer-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sp-dock-fg);
}

.sp-active-call-transfer-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
}

.sp-active-call-transfer-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: color-mix(in srgb, var(--sp-dock-fg) 82%, transparent);
  cursor: pointer;
}

.sp-active-call-transfer-mode input {
  accent-color: var(--palette-yellow, #f2cf3f);
}

.sp-active-call-transfer-hint {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.4;
  color: color-mix(in srgb, var(--sp-dock-fg) 58%, transparent);
}

.sp-active-call-transfer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.sp-active-call-transfer-btn {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.sp-active-call-transfer-btn--ghost {
  background: #2a2a2a;
  color: var(--sp-dock-fg);
}

.sp-active-call-transfer-btn--ghost:hover:not(:disabled) {
  background: #343434;
}

.sp-active-call-transfer-btn--primary {
  background: #1971c2;
  color: #fff;
}

.sp-active-call-transfer-btn--primary:hover:not(:disabled) {
  background: #1864ab;
}

.sp-active-call-transfer-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

#soft-phone-active-call.is-transfer-open #soft-phone-dial::placeholder {
  color: color-mix(in srgb, var(--sp-dock-fg) 52%, transparent);
}

.sp-active-call-controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.sp-active-call.is-pre-call .sp-active-call-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  gap: 10px;
  min-height: 64px;
}

.sp-active-call.is-pre-call #soft-phone-call-btn {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  width: 64px;
  height: 64px;
  min-height: 64px;
  min-width: 64px;
  padding: 0;
  border-radius: 50%;
  font-size: 28px;
}

.sp-active-call-call-icon {
  display: block;
  width: 28px;
  height: 28px;
}

.sp-active-call.is-pre-call #soft-phone-dial-backspace {
  grid-column: 3;
  grid-row: 1;
  justify-self: stretch;
  align-self: stretch;
  width: 100%;
  height: auto;
  min-height: 52px;
  min-width: 0;
  padding: 8px 0;
  border-radius: 10px;
  margin-left: 0;
  font-size: 20px;
  background: transparent;
}

.sp-active-call.is-pre-call #soft-phone-dial-backspace:hover:not(:disabled) {
  background: transparent;
}

.sp-active-call-backspace-icon {
  display: block;
  width: 22px;
  height: 22px;
}

.sp-active-call.is-pre-call #soft-phone-dial-backspace[hidden],
.sp-active-call:not(.is-pre-call) #soft-phone-dial-backspace {
  display: none !important;
}

.sp-active-call.is-connecting .sp-active-call-controls,
.sp-active-call.is-live-call .sp-active-call-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
  justify-items: stretch;
}

.sp-active-call.is-connecting #soft-phone-active-mic,
.sp-active-call.is-live-call #soft-phone-active-mic,
.sp-active-call.is-connecting #soft-phone-active-speaker,
.sp-active-call.is-live-call #soft-phone-active-speaker,
.sp-active-call.is-connecting #soft-phone-active-keypad,
.sp-active-call.is-live-call #soft-phone-active-keypad,
.sp-active-call.is-connecting #soft-phone-active-hold,
.sp-active-call.is-live-call #soft-phone-active-hold,
.sp-active-call.is-connecting #soft-phone-active-cc,
.sp-active-call.is-live-call #soft-phone-active-cc,
.sp-active-call.is-connecting #soft-phone-active-hangup,
.sp-active-call.is-live-call #soft-phone-active-hangup {
  width: 100%;
  height: 52px;
  min-height: 52px;
  max-height: 52px;
  min-width: 0;
  padding: 0;
  border-radius: 10px;
  justify-self: stretch;
  align-self: stretch;
  gap: 0;
  overflow: hidden;
}

.sp-active-call-btn-glyph {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: transparent;
  color: inherit;
}

.sp-active-call-btn-glyph > i,
.sp-active-call-btn-glyph > svg {
  width: 22px !important;
  height: 22px !important;
  flex: 0 0 auto;
}

/* Stack idle/active icons; lucide.css forces display so opacity is reliable. */
.sp-active-call-btn-glyph > .sp-active-call-btn-icon--idle,
.sp-active-call-btn-glyph > .sp-active-call-btn-icon--active {
  position: absolute;
  inset: 0;
  margin: auto;
}

.sp-active-call-btn-glyph > .sp-active-call-btn-icon--active {
  opacity: 0;
  pointer-events: none;
}

.sp-active-call-btn[aria-pressed="true"] .sp-active-call-btn-glyph > .sp-active-call-btn-icon--idle {
  opacity: 0;
  pointer-events: none;
}

.sp-active-call-btn[aria-pressed="true"] .sp-active-call-btn-glyph > .sp-active-call-btn-icon--active {
  opacity: 1;
  pointer-events: auto;
}

.sp-active-call-btn-label {
  display: none !important;
}

.sp-active-call-end-icon {
  display: block;
  width: 22px;
  height: 22px;
  transform: rotate(135deg);
}

.sp-active-call.is-connecting #soft-phone-active-mic,
.sp-active-call.is-live-call #soft-phone-active-mic {
  grid-column: 1;
  grid-row: 1;
}

.sp-active-call.is-connecting #soft-phone-active-hangup,
.sp-active-call.is-live-call #soft-phone-active-hangup {
  grid-column: 2;
  grid-row: 1;
}

.sp-active-call.is-connecting #soft-phone-active-speaker,
.sp-active-call.is-live-call #soft-phone-active-speaker {
  grid-column: 3;
  grid-row: 1;
}

.sp-active-call.is-connecting #soft-phone-active-keypad,
.sp-active-call.is-live-call #soft-phone-active-keypad {
  grid-column: 1;
  grid-row: 2;
}

.sp-active-call.is-connecting #soft-phone-active-hold,
.sp-active-call.is-live-call #soft-phone-active-hold {
  grid-column: 2;
  grid-row: 2;
}

.sp-active-call.is-connecting #soft-phone-active-cc,
.sp-active-call.is-live-call #soft-phone-active-cc {
  grid-column: 3;
  grid-row: 2;
}

.sp-active-call.is-pre-call .sp-active-call-btn--hangup[hidden],
.sp-active-call.is-connecting .sp-active-call-btn--call[hidden],
.sp-active-call.is-live-call .sp-active-call-btn--call[hidden] {
  display: none !important;
}

.sp-active-call.is-pre-call #soft-phone-active-mic,
.sp-active-call.is-pre-call #soft-phone-active-speaker,
.sp-active-call.is-pre-call #soft-phone-active-cc,
.sp-active-call.is-pre-call #soft-phone-active-keypad,
.sp-active-call.is-pre-call #soft-phone-active-hold,
.sp-active-call.is-pre-call #soft-phone-active-transfer,
.sp-active-call.is-pre-call #soft-phone-active-add-person,
.sp-active-call.is-connecting #soft-phone-active-transfer,
.sp-active-call.is-live-call #soft-phone-active-transfer,
.sp-active-call.is-connecting #soft-phone-active-add-person,
.sp-active-call.is-live-call #soft-phone-active-add-person {
  display: none !important;
}

.sp-active-call.is-connecting #soft-phone-active-keypad,
.sp-active-call.is-live-call #soft-phone-active-keypad {
  display: inline-flex !important;
}

.sp-active-call.is-connecting #soft-phone-active-keypad:disabled,
.sp-active-call.is-live-call #soft-phone-active-keypad:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sp-active-call-btn[hidden] {
  display: none !important;
}

.sp-active-call-group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.sp-active-call-group-chips--dial {
  margin: 8px 0 0;
}

.sp-active-call-group-chips--dial[hidden] {
  display: none !important;
}

@keyframes sp-group-chip-in {
  from {
    opacity: 0;
    transform: scale(0.72);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes sp-group-chip-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.72);
  }
}

.sp-active-call-group-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--sp-dock-fg) 10%, #1a1a1a);
  font-size: 11px;
  color: var(--sp-dock-fg);
  transform-origin: center;
  will-change: transform, opacity;
}

.sp-active-call-group-chip.is-entering {
  animation: sp-group-chip-in 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sp-active-call-group-chip.is-leaving {
  animation: sp-group-chip-out 0.18s ease-in both;
  pointer-events: none;
}

.sp-active-call-group-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.sp-active-call-group-team {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 120px;
  margin: 0 0 10px;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.sp-active-call-group-team-empty {
  margin: 0;
  font-size: 11px;
  color: color-mix(in srgb, var(--sp-dock-fg) 55%, transparent);
}

.sp-active-call-group-team-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sp-dock-fg);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.sp-active-call-group-team-btn:hover,
.sp-active-call-group-team-btn.is-picked {
  background: color-mix(in srgb, var(--sp-dock-fg) 8%, #1a1a1a);
}

.sp-active-call-group-team-dot {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 999px;
  background: #3ecf8e;
}

.sp-active-call-person.is-ringing .sp-active-call-person-avatar {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--palette-yellow, #f2cf3f) 70%, transparent);
}

.sp-active-call-person.is-connected .sp-active-call-person-avatar {
  box-shadow: 0 0 0 2px color-mix(in srgb, #3ecf8e 70%, transparent);
}

.sp-active-call-person.is-failed .sp-active-call-person-avatar {
  opacity: 0.45;
}

#soft-phone-active-call.is-group-open #soft-phone-dial::placeholder,
#soft-phone-active-call.is-conference-open #soft-phone-dial::placeholder {
  color: color-mix(in srgb, var(--sp-dock-fg) 52%, transparent);
}

.sp-active-call-btn--group.is-live {
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 38%, #fff);
  color: #171612;
}

.sp-active-call-btn {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  padding: 8px 4px;
  border: 0;
  border-radius: 12px;
  background: #2a2a2a;
  color: var(--sp-dock-fg);
  font-size: 18px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.35s;
}

.sp-active-call-btn:hover:not(:disabled) {
  background: #343434;
}

.sp-active-call-btn:disabled {
  cursor: default;
  opacity: 0.35;
  color: color-mix(in srgb, var(--sp-dock-fg) 40%, transparent);
}

.sp-active-call-btn.is-off:disabled {
  background: #1c1c1c;
  color: color-mix(in srgb, var(--sp-dock-fg) 32%, transparent);
}

.sp-active-call-btn .sp-active-call-btn-icon--active {
  /* Kept for older markup; in-call uses opacity on the glyph stack. */
  display: none;
}

.sp-active-call-btn[aria-pressed="true"] .sp-active-call-btn-icon--idle {
  display: none;
}

.sp-active-call-btn[aria-pressed="true"] .sp-active-call-btn-icon--active {
  display: block;
}

.sp-active-call-btn .sp-active-call-btn-glyph > .sp-active-call-btn-icon--idle,
.sp-active-call-btn .sp-active-call-btn-glyph > .sp-active-call-btn-icon--active,
.sp-active-call-btn[aria-pressed="true"] .sp-active-call-btn-glyph > .sp-active-call-btn-icon--idle,
.sp-active-call-btn[aria-pressed="true"] .sp-active-call-btn-glyph > .sp-active-call-btn-icon--active {
  display: block !important;
}

.sp-active-call-btn.is-live {
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 38%, #fff);
  /* Cream fill needs dark ink even when theme --color-on-accent is white. */
  color: #171612;
}

.sp-active-call-btn.is-live:hover:not(:disabled) {
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 48%, #fff);
  color: #171612;
}

.sp-active-call-btn.is-live svg.lucide,
.sp-active-call-btn.is-live i svg {
  stroke: currentColor;
  color: inherit;
}

.sp-active-call-btn.is-off {
  background: #232323;
  color: color-mix(in srgb, var(--sp-dock-fg) 62%, transparent);
}

.sp-active-call-btn.is-off:hover:not(:disabled) {
  background: #2a2a2a;
}

#soft-phone-active-mic.is-off,
#soft-phone-active-speaker.is-off {
  background: var(--color-danger, #d1453b);
  color: #fff;
}

#soft-phone-active-mic.is-off:hover:not(:disabled),
#soft-phone-active-speaker.is-off:hover:not(:disabled) {
  background: color-mix(in srgb, var(--color-danger, #d1453b) 82%, var(--palette-black, #000));
  color: #fff;
}

.sp-active-call-btn--hold:not(:disabled) {
  background: color-mix(in srgb, #e03131 28%, #2a2a2a);
  color: #ffc9c9;
}

.sp-active-call-btn--hold:not(:disabled):hover {
  background: color-mix(in srgb, #e03131 38%, #2a2a2a);
  color: #ffe3e3;
}

.sp-active-call-btn--hold.is-off:not(:disabled),
.sp-active-call-btn--hold[aria-pressed="true"]:not(:disabled) {
  background: color-mix(in srgb, #e03131 42%, #2a2a2a);
  color: #fff;
}

.sp-active-call-btn--hold:disabled {
  background: #2a2a2a;
  color: color-mix(in srgb, var(--sp-dock-fg) 42%, transparent);
  opacity: 0.55;
}

.sp-active-call-btn--transfer:not(:disabled) {
  background: color-mix(in srgb, #1971c2 28%, #2a2a2a);
  color: #a5d8ff;
}

.sp-active-call-btn--transfer:not(:disabled):hover {
  background: color-mix(in srgb, #1971c2 38%, #2a2a2a);
  color: #d0ebff;
}

.sp-active-call-btn--transfer[aria-pressed="true"]:not(:disabled) {
  background: color-mix(in srgb, #1971c2 48%, #2a2a2a);
  color: #fff;
}

.sp-active-call-btn--add-person:not(:disabled) {
  background: color-mix(in srgb, #2f9e44 28%, #2a2a2a);
  color: #b2f2bb;
}

.sp-active-call-btn--add-person:not(:disabled):hover {
  background: color-mix(in srgb, #2f9e44 38%, #2a2a2a);
  color: #d3f9d8;
}

.sp-active-call-btn--add-person[aria-pressed="true"]:not(:disabled) {
  background: color-mix(in srgb, #2f9e44 48%, #2a2a2a);
  color: #fff;
}

.sp-active-call-btn--hangup {
  min-width: 0;
  background: #e8590c;
  color: #fff;
}

.sp-active-call-btn--hangup:hover:not(:disabled) {
  background: #f76707;
}

.sp-active-call-btn--hangup[hidden] {
  display: inline-flex !important;
  opacity: 0;
  transform: scale(0.88);
  pointer-events: none;
  visibility: hidden;
}

.sp-active-call-btn--call {
  background: #2f9e44;
  color: #fff;
}

.sp-active-call-btn--call:hover:not(:disabled) {
  background: #37b24d;
}

.sp-active-call-btn--call:disabled {
  opacity: 0.35;
  background: color-mix(in srgb, #2f9e44 28%, #2a2a2a);
  color: color-mix(in srgb, #fff 50%, transparent);
}

.sp-active-call-btn--call:disabled[hidden] {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .sp-active-call,
.sp-active-call.is-animating,
.sp-active-call.is-entering,
.sp-active-call-clip,
.sp-active-call-pad,
.sp-active-call-dial,
.sp-active-call-btn,
.sp-active-call-person-avatar,
.sp-active-call-timer,
.sp-active-call-close,
.sp-active-call-group-chip,
.sp-active-call-group-chip.is-entering,
.sp-active-call-group-chip.is-leaving {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 640px) {
  .sp-active-call {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
  }

  .sp-active-call.is-centered {
    right: auto;
    bottom: auto;
  }

  .soft-phone-live-captions-modal {
    bottom: calc(1rem + 11.5rem);
  }
}

.sp-composer {
  --sp-composer-ink: #171612;
  --sp-composer-muted: #7b776b;
  --sp-composer-edge: #dcd8ca;
  --sp-composer-card-bg: color-mix(in srgb, #171612 3%, white);
  --sp-composer-hover-bg: color-mix(in srgb, #171612 8%, transparent);
  position: relative;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 12px;
  border: 0;
  border-top: 1px solid var(--sp-composer-edge);
  border-radius: 0;
  background: var(--color-surface, #fff);
  cursor: not-allowed;
  opacity: 0.72;
  user-select: none;
}

.sp-main > .sp-composer {
  width: 100%;
  max-width: none;
  margin: 0;
}

.sp-main > .sp-composer::before {
  content: none;
}

.sp-composer.is-enabled {
  cursor: auto;
  opacity: 1;
  user-select: auto;
}

.sp-composer-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  border: 1px solid var(--sp-composer-ink);
  border-radius: 6px;
  background: var(--sp-composer-card-bg);
  transition: box-shadow 0.15s ease, background 0.15s ease;
}

.sp-composer.is-enabled:has(.sp-composer-input:focus) .sp-composer-shell {
  box-shadow: 0 1px 2px color-mix(in srgb, var(--sp-composer-ink) 6%, transparent);
}

html[data-theme="dark"] .sp-composer {
  --sp-composer-ink: color-mix(in srgb, #fff 88%, transparent);
  --sp-composer-muted: var(--color-text-muted);
  --sp-composer-edge: var(--color-hairline);
  --sp-composer-card-bg: color-mix(in srgb, #000 16%, var(--color-surface));
  --sp-composer-hover-bg: color-mix(in srgb, #fff 8%, transparent);
}

html[data-theme="dark"] .sp-composer.is-enabled:has(.sp-composer-input:focus) .sp-composer-shell {
  box-shadow: none;
}

html[data-theme="dark"] .sp-composer-input::placeholder,
html[data-theme="dark"] .sp-composer-placeholder {
  color: var(--color-text-muted);
}

.sp-composer:focus {
  outline: none;
}

.sp-composer-field {
  flex: 0 0 auto;
  min-height: 0;
}

.sp-composer-input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 3.25rem;
  min-height: 3.25rem;
  max-height: 7.5rem;
  margin: 0;
  padding: 0.625rem 0.75rem 0.25rem;
  border: 0;
  resize: none;
  background: transparent;
  color: #000;
  font-family: var(--body-font);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
}

html[data-theme="dark"] .sp-composer-input {
  color: var(--color-text-heading);
}

.sp-composer-input:focus {
  outline: none;
}

.sp-composer-input::placeholder {
  color: var(--sp-composer-muted);
}

.sp-composer-count {
  margin: 0 2px 0 0;
  color: var(--sp-composer-muted);
  font-family: var(--body-font);
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0.85;
}

.sp-composer-count.is-near-limit {
  opacity: 1;
}

.sp-composer-count.is-at-limit {
  color: var(--color-danger, #c2410c);
  opacity: 1;
}

.sp-composer-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px 0;
}

.sp-composer-attachment {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--sp-soft-fill, color-mix(in srgb, var(--palette-black) 8%, var(--color-surface)));
}

.sp-composer-attachment img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sp-composer-attachment-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--palette-black) 70%, transparent);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.sp-composer-placeholder {
  display: block;
  box-sizing: border-box;
  min-height: 3.25rem;
  padding: 0.625rem 0.75rem 0.25rem;
  font-family: var(--body-font);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--sp-composer-muted);
  pointer-events: none;
}

.sp-composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0 6px 6px;
}

.sp-composer-tools {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.sp-composer-emoji-wrap {
  position: relative;
}

.sp-composer-snippets-wrap {
  position: static;
}

.sp-composer-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--sp-composer-muted);
  font-size: 12px;
  line-height: 1;
  cursor: not-allowed;
  pointer-events: none;
}

.sp-composer-tool > i,
.sp-composer-tool > svg.lucide {
  width: 14px;
  height: 14px;
  stroke-width: 1.75;
}

.sp-composer.is-enabled .sp-composer-tool {
  cursor: pointer;
  pointer-events: auto;
  transition: color 0.12s ease, background 0.12s ease;
}

.sp-composer.is-enabled .sp-composer-tool:hover {
  background: var(--sp-composer-hover-bg);
  color: var(--sp-composer-ink);
}

.sp-composer.is-enabled .sp-composer-tool:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  pointer-events: none;
}

.sp-composer.is-enabled #soft-phone-composer-send {
  transition: color 0.15s ease, background 0.15s ease, filter 0.15s ease, transform 0.15s ease;
}

.sp-composer.is-enabled #soft-phone-composer-send.is-loading > i,
.sp-composer.is-enabled #soft-phone-composer-send.is-loading > svg.lucide {
  display: none;
}

.sp-composer.is-enabled #soft-phone-composer-send .soft-phone-transcript-spinner {
  width: 14px;
  height: 14px;
  border-width: 1.75px;
}

.sp-composer-slash {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  font-family: var(--mono-font, ui-monospace, monospace);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
}

.sp-snippets-popover {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 4px);
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: auto;
  max-width: none;
  max-height: min(22rem, 52vh);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--palette-black);
  border-radius: var(--radius-button);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  color: var(--color-text-heading);
  box-sizing: border-box;
}

.sp-composer .sp-snippets-popover {
  border-color: var(--sp-composer-ink, var(--palette-black));
  border-radius: 6px;
  background: var(--sp-composer-card-bg, var(--color-surface));
  box-shadow: none;
}

.sp-snippets-popover[hidden] {
  display: none !important;
}

.sp-snippets-empty {
  margin: 0;
  padding: 8px 12px 12px;
  color: var(--color-text-muted);
  font-family: var(--mono-font);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.sp-snippets-empty[hidden] {
  display: none !important;
}

.sp-snippets-empty-row {
  margin: 0;
  padding: 8px 12px;
  color: var(--color-text-muted);
  font-family: var(--mono-font);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.35;
  pointer-events: none;
}

.sp-snippets-list {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  max-height: 14rem;
  overflow-y: auto;
}

.sp-snippets-list[hidden] {
  display: none !important;
}

.sp-snippets-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 8px 8px 8px 12px;
  border: 0;
  background: transparent;
  color: var(--color-text-heading);
  text-align: left;
  cursor: pointer;
}

.sp-snippets-item:hover {
  background: var(--color-surface-secondary);
}

.sp-snippets-item.is-selected {
  background: color-mix(in srgb, var(--color-accent) 28%, var(--color-surface));
}

.sp-snippets-item-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.sp-snippets-item-title {
  overflow: hidden;
  color: var(--color-text-heading);
  font-family: var(--mono-font);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.sp-snippets-item-body {
  overflow: hidden;
  color: var(--color-text-muted);
  font-family: var(--body-font);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.3;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.sp-snippets-item-actions {
  display: flex;
  flex-shrink: 0;
  gap: 0;
}

.sp-snippets-item-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-button);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}

.sp-snippets-item-action:hover {
  color: var(--color-text-heading);
}

.sp-snippets-item-action i,
.sp-snippets-item-action svg {
  width: 13px;
  height: 13px;
}

.sp-snippets-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 8px;
}

.sp-snippets-name[hidden] {
  display: none !important;
}

.sp-snippets-name input {
  box-sizing: border-box;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 2.1rem;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-button);
  background: var(--color-surface-secondary);
  color: var(--color-text-heading);
  font-family: inherit;
  font-size: 14px;
}

.sp-snippets-name input:focus,
.sp-snippets-name input:focus-visible {
  outline: none;
}

.sp-snippets-name .settings-btn {
  flex: 0 0 auto;
}

.sp-snippets-name .settings-btn--primary {
  border-color: var(--color-border);
}

.sp-snippets-footer {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 0;
  margin: 0;
  padding: 0;
  border-top: 0;
}

.sp-snippets-footer[hidden] {
  display: none !important;
}

.sp-snippets-footer button {
  display: block;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-heading);
  font-family: var(--mono-font);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.sp-snippets-footer button:hover:not(:disabled) {
  background: var(--color-surface-secondary);
}

.sp-snippets-footer button.is-selected:not(:disabled) {
  background: color-mix(in srgb, var(--color-accent) 28%, var(--color-surface));
}

.sp-snippets-footer button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.sp-composer-emoji-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 40;
  width: min(20rem, calc(100vw - 2rem));
  overflow: hidden;
  border: 1px solid var(--color-hairline);
  border-radius: 10px;
  background: var(--color-surface);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--palette-black) 14%, transparent);
}

.sp-composer-emoji-popover[hidden] {
  display: none;
}

.sp-composer-emoji-picker {
  --background: var(--color-surface);
  --border-color: transparent;
  --border-radius: 0;
  --button-active-background: var(--color-surface-secondary);
  --button-hover-background: var(--color-surface-secondary);
  --category-font-color: var(--color-text-muted);
  --category-font-size: 11px;
  --emoji-padding: 0.35rem;
  --emoji-size: 1.15rem;
  --input-border-color: var(--color-hairline);
  --input-border-radius: 8px;
  --input-font-color: var(--color-text-heading);
  --input-font-size: 12px;
  --input-placeholder-color: var(--color-text-muted);
  --indicator-color: var(--color-text-heading);
  --num-columns: 8;
  --outline-color: var(--color-accent);
  display: block;
  width: 100%;
  height: 16rem;
  max-height: min(16rem, 42vh);
  border: 0;
}

.sp-details {
  position: relative;
  padding: 24px 20px 28px;
  overflow-y: auto;
}

.sp-details.is-transcript-open {
  overflow: hidden;
  padding: 0;
}

.sp-details-transcript {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--color-surface);
  opacity: 0;
  transform: translateX(18px);
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 0.24s ease,
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.32s;
  will-change: opacity, transform;
}

.sp-details-transcript.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  visibility: visible;
  transition:
    opacity 0.24s ease,
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s;
}

.sp-details-transcript[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .sp-details-transcript {
    transition: none;
    transform: none;
  }
}

.sp-details-transcript-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
  flex-shrink: 0;
  height: var(--sp-col-header-height);
  min-height: var(--sp-col-header-height);
  max-height: var(--sp-col-header-height);
  padding: 0 16px;
  border-bottom: 1px solid var(--color-hairline);
}

.sp-details-transcript-heading {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.sp-details-transcript-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-heading);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-details-transcript-sub {
  margin: 0;
  font-family: var(--mono-font);
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-details-transcript-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}

.sp-details-transcript-close:hover {
  background: var(--color-surface-secondary);
  color: var(--color-text-heading);
}

.sp-details-transcript-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px 20px;
}

.sp-details-transcript-empty {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.sp-details-transcript-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: var(--color-text-heading);
}

.sp-details-transcript-loading[hidden] {
  display: none !important;
}

.sp-details-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 12rem;
  color: var(--color-text-muted);
  font-size: 13px;
  text-align: center;
}

.sp-details-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  margin-bottom: 14px;
}

.sp-details-name {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-heading);
  line-height: 1.25;
}

.sp-details-company {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  line-height: 1.3;
}

.sp-details-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.sp-details-fields {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sp-details-field {
  display: grid;
  grid-template-columns: 5.75rem minmax(0, 1fr);
  align-items: start;
  column-gap: 14px;
  padding: 4px 0;
}

.sp-details-field dt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  min-width: 0;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text-muted);
  line-height: 1.3;
}

.sp-details-field-icon {
  flex-shrink: 0;
  width: 13px;
  font-size: 12px;
  line-height: 1;
  color: var(--color-text-muted);
}

.sp-details-field-label {
  min-width: 0;
}

.sp-details-field dd {
  margin: 0;
  min-width: 0;
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-primary);
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#soft-phone-details-phone {
  font-family: var(--mono-font);
}

.sp-details-field dd a {
  color: inherit;
  text-decoration: none;
}

.sp-details-field dd a:hover {
  text-decoration: underline;
}

.sp-details-field dd.is-empty,
.sp-details-field dd.sp-details-placeholder,
.sp-details-placeholder {
  font-weight: 400;
  color: var(--color-text-muted);
}

.sp-details-fields dd.sp-details-placeholder.is-empty {
  cursor: pointer;
}

.sp-details-fields dd.sp-details-placeholder.is-empty:hover {
  color: var(--color-text-heading);
}

.sp-details-tags-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 18px;
  padding: 0;
}

.sp-details-notes-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
  padding: 0;
}

.sp-details-notes-section:has(.sp-details-notes-list:not(:empty)) {
  gap: 12px;
}

.sp-details-tags-row {
  display: grid;
  grid-template-columns: 5.75rem minmax(0, 1fr);
  align-items: start;
  column-gap: 14px;
  width: 100%;
  min-width: 0;
  padding: 4px 0;
  min-height: 22px;
}

.sp-details-tags-heading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  min-width: 0;
  min-height: 22px;
  line-height: 1;
}

.sp-details-tags-section:has(.sp-details-tags:not(:empty)) .sp-details-tag-add {
  gap: 0;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--palette-yellow-strong, #e0b81c);
  border-radius: 999px;
  background: var(--color-background, var(--color-surface));
  transition: border-color 0.12s ease, background-color 0.12s ease, color 0.12s ease;
}

.sp-details-tags-section:has(.sp-details-tags:not(:empty)) .sp-details-tag-add:hover {
  border-color: var(--palette-yellow, #f2cf3f);
  color: var(--palette-yellow, #f2cf3f);
  background: color-mix(in srgb, var(--palette-yellow, #f2cf3f) 14%, var(--color-surface));
}

.sp-details-tags-section:has(.sp-details-tags:not(:empty))
  .sp-details-tag-add
  .sp-details-note-add-label {
  display: none;
}

.sp-details-tags-section:has(.sp-details-tags:not(:empty))
  .sp-details-tag-add
  .sp-details-note-add-icon {
  width: 14px;
  height: 14px;
}

.sp-details-tags-section:has(.sp-details-tags:not(:empty))
  .sp-details-tag-add
  .sp-details-note-add-icon
  i,
.sp-details-tags-section:has(.sp-details-tags:not(:empty))
  .sp-details-tag-add
  .sp-details-note-add-icon
  .lucide {
  font-size: 13px;
  width: 13px;
  height: 13px;
}

.sp-details-tags-section:has(.sp-details-tags-body.is-open):not(:has(.sp-details-tags:not(:empty)))
  .sp-details-tags-row {
  grid-template-columns: auto minmax(0, 1fr);
}

.sp-details-tags-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  pointer-events: none;
  transition:
    grid-template-rows 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.22s ease;
}

.sp-details-tags-body.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 8px;
  pointer-events: auto;
}

.sp-details-tags-body-inner {
  overflow: hidden;
  min-height: 0;
  width: 100%;
}

.sp-details-tags-body .sp-tag-form {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}

.sp-details-tags-body .sp-tag-composer {
  width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .sp-details-tags-body {
    transition: none;
  }
}

.sp-details-notes-heading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text-muted);
  line-height: 1.3;
}

.sp-details-notes-heading-label {
  color: inherit;
}

.sp-details-notes-count {
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.sp-details-notes-count[hidden] {
  display: none;
}

.sp-details-notes-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sp-details-notes-list:empty {
  display: none;
}

.sp-details-note-add {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 16px auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--palette-yellow-strong, #e0b81c);
  cursor: pointer;
  text-align: left;
}

.sp-details-note-add:hover {
  color: var(--palette-yellow, #f2cf3f);
}

.sp-details-note-add-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: inherit;
}

.sp-details-note-add-icon i {
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
}

.sp-details-note-add-label {
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: inherit;
}

.sp-details-tag-add {
  display: inline-flex;
  align-items: center;
  margin: 0;
  line-height: 1;
}

.sp-details-notes-empty {
  margin: 0;
  padding: 2px 0 6px;
  border: 0;
  border-radius: 0;
  color: #b0b0b0;
  font-size: 12px;
  text-align: left;
}

.sp-details-note-card {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 12px;
  color: var(--color-text-primary);
}

.sp-details-note-lead {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  column-gap: 10px;
  align-items: start;
}

.sp-details-note-card-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
  padding-right: 56px;
  min-width: 0;
  min-height: 0;
}

.sp-details-note-main {
  position: relative;
  min-width: 0;
}

.sp-details-note-author-copy {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.sp-details-note-author-name {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-primary);
  line-height: 1.3;
}

.sp-details-note-lead > .sp-avatar {
  align-self: start;
  /* Center on name row (~15.6px) + gap (2px) + first body line (~17.4px) */
  margin-top: calc((15.6px + 2px + 17.4px - 26px) / 2);
}

.sp-details-note-card:not(:has(.sp-details-note-body)) .sp-details-note-lead > .sp-avatar {
  align-self: center;
  margin-top: 0;
}

.sp-avatar--note {
  width: 26px;
  height: 26px;
  font-size: 9px;
  flex-shrink: 0;
}

.sp-details-note-meta {
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 400;
  color: #b0b0b0;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.sp-details-note-actions {
  position: absolute;
  top: 50%;
  right: 0;
  display: inline-flex;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.12s ease;
}

.sp-details-note-card:hover .sp-details-note-actions,
.sp-details-note-card:focus-within .sp-details-note-actions {
  opacity: 1;
}

.sp-details-note-actions .sp-inbox-action {
  color: #a3a3a3;
  border-radius: 999px;
}

.sp-details-note-actions .sp-inbox-action:hover,
.sp-details-note-actions .sp-inbox-action--danger:hover {
  color: var(--palette-black, #000);
  background: transparent;
}

.sp-details-note-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
}

.sp-details-note-reply-label {
  margin: 0 0 2px;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 500;
}

.sp-note-reply-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  color: var(--color-text-heading);
  font-size: 12px;
}

.sp-note-reply-banner[hidden] {
  display: none !important;
}

.sp-note-reply-banner-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-note-reply-banner-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}

.sp-note-reply-banner-clear:hover {
  background: color-mix(in srgb, var(--palette-black) 6%, transparent);
  color: var(--color-text-heading);
}

.sp-note-reply-banner-clear i,
.sp-note-reply-banner-clear svg {
  width: 14px;
  height: 14px;
}

.sp-details-note-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.sp-details-note-reactions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.sp-note-reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--color-hairline);
  border-radius: 999px;
  background: color-mix(in srgb, var(--palette-black) 3%, var(--color-surface));
  color: var(--color-text-primary);
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
}

.sp-note-reaction-chip:hover {
  background: color-mix(in srgb, var(--palette-black) 6%, var(--color-surface));
}

.sp-note-reaction-chip.is-reacted {
  border-color: color-mix(in srgb, var(--palette-yellow-strong) 55%, var(--color-hairline));
  background: color-mix(in srgb, var(--palette-yellow) 22%, var(--color-surface));
}

.sp-note-reaction-chip.sp-internal-comment-reactions-more {
  border-color: color-mix(in srgb, var(--palette-yellow-strong) 55%, var(--color-hairline));
  background: color-mix(in srgb, var(--palette-yellow) 22%, var(--color-surface));
  color: var(--color-text-muted);
  font-weight: 400;
}

.sp-note-reaction-chip.sp-internal-comment-reactions-more:hover {
  background: color-mix(in srgb, var(--palette-yellow) 32%, var(--color-surface));
}

.sp-note-reaction-emoji {
  font-size: 13px;
  line-height: 1;
}

.sp-note-reaction-count {
  font-family: var(--mono-font);
  font-size: 11px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.sp-note-reaction-chip.is-reacted .sp-note-reaction-count {
  color: var(--color-text-primary);
}

.sp-note-react-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--color-hairline);
  border-radius: 999px;
  background: color-mix(in srgb, var(--palette-black) 3%, var(--color-surface));
  color: var(--color-text-muted);
  cursor: pointer;
}

.sp-note-react-add:hover,
.sp-note-react-add[aria-expanded="true"] {
  color: var(--color-text-primary);
  background: color-mix(in srgb, var(--palette-black) 6%, var(--color-surface));
}

.sp-note-react-add .lucide {
  width: 13px;
  height: 13px;
}

.sp-note-react-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  max-width: 220px;
  padding: 6px;
  border: 1px solid var(--color-hairline);
  border-radius: 10px;
  background: var(--color-surface);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--palette-black) 12%, transparent);
}

.sp-note-react-popover[hidden] {
  display: none;
}

.sp-note-react-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.sp-note-react-choice:hover {
  background: color-mix(in srgb, var(--palette-black) 6%, var(--color-surface));
}

.sp-details-note-attach {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--color-hairline);
  border-radius: 8px;
  background: color-mix(in srgb, var(--palette-black) 3%, var(--color-surface));
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.3;
}

.sp-details-note-attach .lucide {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.sp-details-note-attach span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-details-note-attach.is-image {
  padding: 0;
  overflow: hidden;
}

.sp-details-note-attach.is-image img {
  display: block;
  width: 88px;
  height: 88px;
  object-fit: cover;
}

.sp-note-attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 2px 2px;
}

.sp-note-attach-list[hidden] {
  display: none;
}

.sp-note-attach-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid var(--color-hairline);
  border-radius: 8px;
  background: var(--color-surface);
}

.sp-note-attach-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  padding: 6px 28px 6px 8px;
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: 12px;
}

.sp-note-attach-file .lucide {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.sp-note-attach-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-note-attach-chip.is-image .sp-note-attach-thumb {
  display: block;
  width: 72px;
  height: 72px;
}

.sp-note-attach-chip.is-image img {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 7px;
}

.sp-note-attach-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--palette-black) 55%, transparent);
  color: #fff;
  cursor: pointer;
}

.sp-note-attach-remove .lucide {
  width: 12px;
  height: 12px;
}

.sp-note-form {
  display: grid;
  gap: 6px;
  margin-top: 0;
  margin-bottom: 0;
}

.sp-note-composer {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--sp-composer-bg, color-mix(in srgb, var(--palette-black) 3%, var(--color-surface)));
  transition: border-color 0.12s ease, background 0.12s ease;
}

.sp-note-composer:focus-within {
  border-color: var(--color-hairline);
  background: var(--sp-card-bg, var(--color-surface));
  box-shadow: none;
}

.sp-note-textarea {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  resize: none;
  min-height: 1.45rem;
  max-height: 8rem;
  overflow-y: hidden;
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: none;
}

.sp-note-textarea::placeholder {
  color: #b8b8b8;
}

.sp-note-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
}

.sp-note-composer-tools {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.sp-note-snippets-wrap {
  position: static;
  display: inline-flex;
  align-items: center;
}

.sp-note-snippets-wrap .sp-composer-slash {
  width: 14px;
  height: 14px;
  font-size: 10px;
  border-width: 1.5px;
  border-radius: 3px;
}

.sp-note-composer-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.sp-note-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.sp-note-tool-btn:hover,
.sp-note-tool-btn[aria-expanded="true"] {
  background: color-mix(in srgb, var(--palette-black) 6%, transparent);
  color: var(--color-text-heading);
}

.sp-note-tool-btn .lucide {
  width: 15px;
  height: 15px;
}

.sp-note-composer-input-wrap {
  position: relative;
}

.sp-note-emoji-wrap {
  position: static;
}

.sp-note-emoji-popover {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 40;
  width: auto;
  max-width: none;
  overflow: hidden;
  border: 1px solid var(--color-hairline);
  border-radius: 10px;
  background: var(--color-surface);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--palette-black) 14%, transparent);
}

.sp-note-emoji-popover[hidden] {
  display: none;
}

.sp-note-emoji-picker {
  --background: var(--color-surface);
  --border-color: transparent;
  --border-radius: 0;
  --button-active-background: var(--color-surface-secondary);
  --button-hover-background: var(--color-surface-secondary);
  --category-font-color: var(--color-text-muted);
  --category-font-size: 11px;
  --emoji-padding: 0.35rem;
  --emoji-size: 1.15rem;
  --input-border-color: var(--color-hairline);
  --input-border-radius: 8px;
  --input-font-color: var(--color-text-heading);
  --input-font-size: 12px;
  --input-placeholder-color: var(--color-text-muted);
  --indicator-color: var(--color-text-heading);
  --num-columns: 8;
  --outline-color: var(--color-accent);
  display: block;
  width: 100%;
  height: 16rem;
  max-height: min(16rem, 42vh);
  border: 0;
}

.sp-note-mention-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 35;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 11rem;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--color-hairline);
  border-radius: 10px;
  background: var(--color-surface);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--palette-black) 12%, transparent);
}

.sp-note-mention-menu[hidden] {
  display: none;
}

.sp-note-mention-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-heading);
  text-align: left;
  cursor: pointer;
}

.sp-note-mention-option:hover,
.sp-note-mention-option.is-active {
  background: color-mix(in srgb, var(--palette-black) 5%, var(--color-surface));
}

.sp-note-mention-option .sp-avatar {
  width: 22px;
  height: 22px;
  font-size: 9px;
}

.sp-note-mention-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.sp-note-mention-name {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-note-mention-email {
  font-size: 11px;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-note-mention-empty {
  margin: 0;
  padding: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.sp-details-note-body .sp-note-mention {
  color: var(--palette-yellow-strong, #e0b81c);
  font-weight: 600;
}

.sp-note-composer-cancel[hidden] {
  display: none;
}

.sp-note-composer-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--sp-chip-bg, color-mix(in srgb, var(--palette-black) 8%, var(--color-surface)));
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.sp-note-composer-send i {
  font-size: 12px;
  line-height: 1;
}

.sp-note-composer-send:hover:not(:disabled) {
  background: var(--sp-chip-bg-hover, color-mix(in srgb, var(--palette-black) 12%, var(--color-surface)));
  color: var(--color-text-muted);
}

.sp-note-composer-send.is-ready,
.sp-note-composer.has-content .sp-note-composer-send {
  background: color-mix(in srgb, var(--palette-black) 45%, var(--color-surface));
  color: #fff;
}

.sp-note-composer-send.is-ready:hover:not(:disabled),
.sp-note-composer.has-content .sp-note-composer-send:hover:not(:disabled) {
  background: #555;
  color: #fff;
}

.sp-note-composer-send:disabled {
  opacity: 0.55;
  cursor: default;
}

.sp-note-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.team-invite-number-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 14rem;
  overflow-y: auto;
  padding: 4px 0;
}

.team-invite-number-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--palette-ink);
  border-radius: var(--radius-button);
  background: var(--color-surface);
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text-primary);
}

.team-invite-number-option:hover {
  border-color: var(--palette-ink);
}

.team-invite-number-option:has(input:checked) {
  border-color: var(--palette-ink);
  background: color-mix(in srgb, var(--palette-yellow) 22%, var(--color-surface));
}

.team-invite-number-option:has(input:checked):hover {
  border-color: var(--palette-ink);
  background: color-mix(in srgb, var(--palette-yellow) 22%, var(--color-surface));
}

.team-invite-number-option-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.team-invite-number-emoji {
  flex-shrink: 0;
  font-size: 1.15rem;
  line-height: 1;
}

.team-invite-number-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  appearance: none;
}

.team-invite-number-label {
  display: block;
  font-weight: 500;
  color: var(--color-text-heading);
}

.team-invite-number-meta {
  display: block;
  margin-top: 0;
  font-size: 11px;
  color: var(--color-text-muted);
}

@media (max-width: 1100px) {
  .sp-details {
    display: none;
  }
}

@media (max-width: 1024px) {
  body.soft-phone-dialer-page {
    display: block;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .soft-phone-dialer-page .dashboard-shell {
    flex: none;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .soft-phone-dialer-page .dashboard-main,
.soft-phone-dialer-page .dashboard-content,
.soft-phone-dialer-page .dashboard-content-inner {
    height: auto;
    overflow: visible;
  }

  .soft-phone-workspace {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .sp-inbox,
.sp-main,
.sp-details {
    width: 100%;
    min-height: 0;
    height: auto;
    border-left: 0;
    border-right: 0;
  }

  .sp-inbox {
    order: 0;
    max-height: 40vh;
    border-bottom: 1px solid var(--color-hairline);
  }

  .sp-details {
    display: flex;
    border-top: 1px solid var(--color-hairline);
  }

  .sp-main {
    height: 70svh;
    max-height: 70svh;
    overflow: hidden;
  }
}

.team-access-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.team-member-actions {
  position: relative;
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  overflow: visible;
}

.team-member-actions .settings-contact-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  min-height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: var(--btn-soft-fill);
  color: var(--color-on-accent);
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    opacity 0.5s ease,
    background-color 0.15s ease;
}

.team-member-actions .settings-contact-action:hover:not(:disabled) {
  background: var(--btn-soft-fill-hover);
  color: var(--color-on-accent);
}

.team-member-actions .settings-contact-action--danger {
  background: color-mix(in srgb, var(--color-danger) 16%, var(--color-surface));
  color: var(--color-danger);
}

.team-member-actions .settings-contact-action--danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--color-danger) 24%, var(--color-surface));
  color: var(--color-danger);
}

.team-member-actions .settings-contact-action--text {
  width: auto;
  min-width: auto;
  gap: 0.35rem;
  padding: 0 0.75rem;
  font-family: var(--button-font-family);
  font-size: 11px;
  font-weight: var(--button-font-weight);
  letter-spacing: var(--button-letter-spacing);
  text-transform: uppercase;
  white-space: nowrap;
}

.team-member-actions .settings-contact-action--text > svg.lucide,
.team-member-actions .settings-contact-action--text > i[data-lucide] {
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
}

.team-member-actions .team-confirm-spacer {
  display: inline-block;
  flex-shrink: 0;
  width: 2rem;
  min-height: 2rem;
  visibility: hidden;
  pointer-events: none;
}

.team-member-actions > .team-action-confirm {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  transition:
    opacity 0.5s ease,
    background-color 0.15s ease;
}

/* In-flow confirm: keep layout size, just restyle — absolute expand reflowed cards. */
.team-member-actions .team-action-confirm.is-confirming:not(.is-confirming-icon) {
  position: relative;
  inset: auto;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  height: 2rem;
  min-height: 2rem;
  padding: 0 0.75rem;
  background: color-mix(in srgb, var(--color-danger) 20%, var(--color-surface));
  color: var(--color-danger);
}

.team-member-actions .team-action-confirm.is-confirming-from-left {
  left: auto;
  right: auto;
}

.team-member-actions .team-role-admin-btn.is-confirming[data-role="admin"] {
  background: var(--btn-soft-fill);
  color: var(--palette-ink);
}

.team-member-actions .team-action-confirm.is-confirming-icon {
  background: color-mix(in srgb, var(--color-danger) 20%, var(--color-surface));
  color: var(--color-danger);
}

.team-member-actions .team-action-confirm.is-confirming-icon > svg.lucide,
.team-member-actions .team-action-confirm.is-confirming-icon > i[data-lucide] {
  animation: team-confirm-icon-pop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.team-member-actions .team-action-confirm.is-confirming span {
  opacity: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  animation: team-confirm-label 0.45s ease 0.25s forwards;
}

@keyframes team-confirm-label {
  from {
    opacity: 0;
    transform: translateX(0.35rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes team-confirm-icon-pop {
  from {
    opacity: 0;
    transform: scale(0.65);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .soft-phone-incoming-pulse,
.soft-phone-transcript-spinner {
    animation: none;
  }

  .soft-phone-dialpad-key,
.soft-phone-call-button,
.team-member-actions .settings-contact-action,
.team-member-actions > .team-action-confirm {
    transition: none;
  }

  .team-member-actions .team-action-confirm.is-confirming span,
.team-member-actions .team-action-confirm.is-confirming-icon > svg.lucide,
.team-member-actions .team-action-confirm.is-confirming-icon > i[data-lucide],
.soft-phone-numbers-tools .soft-phone-release.is-confirming-icon > svg.lucide,
.soft-phone-numbers-tools .soft-phone-release.is-confirming-icon > i[data-lucide],
.sp-header-icon-btn.is-confirming-icon > svg.lucide,
.sp-header-icon-btn.is-confirming-icon > i[data-lucide],
.sp-inbox-action.is-confirming-icon > svg.lucide,
.sp-inbox-action.is-confirming-icon > i[data-lucide],
.sp-internal-thread-head-btn.is-confirming-icon > svg.lucide,
.sp-internal-thread-head-btn.is-confirming-icon > i[data-lucide],
.sp-internal-comment-action--danger.is-confirming-icon > svg.lucide,
.sp-internal-comment-action--danger.is-confirming-icon > i[data-lucide] {
    animation: none;
    opacity: 1;
  }
}

.team-page .badge {
  gap: 0.3rem;
  min-height: 1.75rem;
  padding: 0.3rem 0.7rem;
  font-family: var(--button-font-family);
  font-size: 11px;
  font-weight: var(--button-font-weight);
  line-height: var(--button-line-height);
  letter-spacing: var(--button-letter-spacing);
  text-transform: uppercase;
}

.team-page .badge > svg.lucide,
.team-page .badge > i[data-lucide] {
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
}

.team-page .badge-role-owner {
  background: #171612;
  color: #fffefa;
}

html[data-theme="dark"] .team-page .badge-role-owner {
  background: var(--palette-yellow);
  color: var(--color-on-accent);
}

.team-page .badge-role-admin {
  background: var(--palette-yellow);
  color: var(--palette-black);
}

.team-page .badge-role-member {
  background: var(--gray-400);
  color: var(--palette-ink);
}

.team-page .badge-role-pending {
  background: var(--palette-thinking);
  color: var(--palette-body);
}

.team-page .users-list {
  display: grid;
  gap: 0.85rem;
}

.team-page .team-roster-count {
  margin-left: auto;
  flex: 0 0 auto;
  color: var(--palette-dark-gray, var(--analytics-muted));
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.55;
}

.team-page .team-roster-count::before,
.team-page .team-roster-count::after {
  content: none;
}

.team-page .users-card {
  padding: 1.1rem 1.15rem 1.2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  background: var(--color-surface);
  scroll-margin-top: 1.5rem;
}

.team-page .users-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px dotted var(--palette-border, #c9c4bc);
}

.team-page .users-card-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.team-page .users-avatar {
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 9999px;
  background: var(--palette-secondary, var(--color-surface-secondary));
  display: grid;
  place-items: center;
  font-family: var(--mono-font);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-heading);
}

.team-page .users-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-page .users-card-name {
  margin: 0;
  font-family: var(--mono-font);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-heading);
}

.team-page .users-card-email {
  margin: 0.2rem 0 0;
  font-family: var(--mono-font);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--palette-dark-gray, var(--color-text-muted));
  word-break: break-word;
}

.team-page .users-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-family: var(--mono-font);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--gray-400, #d9d4cc);
  color: var(--palette-ink, var(--color-text-heading));
}

.team-page .users-status > svg.lucide,
.team-page .users-status > i[data-lucide] {
  width: 0.75rem;
  height: 0.75rem;
  flex-shrink: 0;
}

.team-page .users-status.is-owner {
  background: #171612;
  color: #fffefa;
}

html[data-theme="dark"] .team-page .users-status.is-owner {
  background: color-mix(in srgb, var(--palette-yellow) 32%, var(--palette-secondary));
  color: var(--palette-ink);
}

.team-page .users-status.is-admin {
  background: var(--palette-yellow);
  color: #171612;
}

.team-page .users-status.is-member {
  background: var(--gray-400, #d9d4cc);
  color: var(--palette-ink, var(--color-text-heading));
}

.team-page .users-status.is-pending {
  background: var(--palette-thinking);
  color: var(--palette-body);
}

.team-page .users-card-grid {
  display: grid;
  gap: 0.75rem 1rem;
  margin: 0.95rem 0 0;
  padding: 0;
}

@media (min-width: 640px) {
  .team-page .users-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .team-page .users-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.team-page .users-card-grid > div {
  min-width: 0;
}

.team-page .users-card-grid dt,
.team-page .users-card-section-label {
  margin: 0;
  font-family: var(--mono-font);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--palette-dark-gray, #9a948c);
}

.team-page .users-card-grid dd,
.team-page .users-card-section-value {
  margin: 0.25rem 0 0;
  font-family: var(--mono-font);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--color-text-heading);
  line-height: 1.4;
  word-break: break-word;
}

.team-page .users-card-section {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dotted var(--palette-border, #c9c4bc);
}

.team-page .users-card-section .team-member-actions {
  margin-top: 0.45rem;
}

.team-page .users-empty {
  padding: 2rem 1rem;
  border: 1px dotted var(--palette-border, #c9c4bc);
  text-align: center;
}

.team-page .users-empty p {
  margin: 0;
  font-family: var(--mono-font);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--palette-dark-gray, #9a948c);
  line-height: 1.5;
}

.team-page .users-empty p + p {
  margin-top: 0.35rem;
}

#team-access-modal .soft-phone-modal-panel,
#team-invite-modal .soft-phone-modal-panel {
  border: 0;
  width: min(42rem, calc(100vw - 2rem));
  max-width: 42rem;
}

#team-access-modal .team-invite-number-list,
#team-invite-modal .team-invite-number-list {
  max-height: min(28rem, 55vh);
}

/* Wide only when the number-scope panel is shown (settings add contact / blocklist). */
#soft-phone-contact-modal.is-scope-open .soft-phone-modal-panel,
#account-blocklist-modal .soft-phone-modal-panel {
  width: min(80vw, calc(100vw - 2rem));
  max-width: min(80vw, calc(100vw - 2rem));
}

.soft-phone-contact-form {
  margin-top: 1.25rem;
}

.soft-phone-contact-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

#soft-phone-contact-modal.is-scope-open .soft-phone-contact-layout,
#account-blocklist-modal .soft-phone-contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  align-items: stretch;
  gap: 1.5rem;
  min-height: min(32rem, 70vh);
}

.soft-phone-contact-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.soft-phone-contact-actions {
  margin-top: auto;
}

.soft-phone-contact-side {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  min-height: 0;
}

.soft-phone-contact-scope-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  padding-bottom: 0;
  --analytics-rule: var(--palette-border);
  --analytics-surface: var(--color-surface);
  --analytics-muted: var(--palette-dark-gray);
}

.soft-phone-contact-scope-card .analytics-card-title {
  flex: 0 0 auto;
  border-bottom: 1px dotted var(--analytics-rule);
}

.soft-phone-contact-scope-toolbar {
  --analytics-primary: var(--color-text-heading);
  --analytics-stroke: var(--color-border);
  --analytics-muted: var(--palette-dark-gray);
  --analytics-rule: var(--palette-border);
  --analytics-soft: var(--palette-secondary);
  --analytics-surface: var(--color-surface);
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 0.45rem;
  margin: 0;
  min-width: 0;
}

#soft-phone-contact-modal.is-scope-open .soft-phone-contact-side,
#account-blocklist-modal .soft-phone-contact-side {
  position: relative;
  padding-left: 1.5rem;
}

#soft-phone-contact-modal.is-scope-open .soft-phone-contact-side::before,
#account-blocklist-modal .soft-phone-contact-side::before {
  content: "";
  position: absolute;
  top: 8%;
  bottom: 8%;
  left: 0;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    color-mix(in srgb, var(--color-border) 35%, transparent) 18%,
    color-mix(in srgb, var(--color-border) 35%, transparent) 82%,
    transparent 100%
  );
  pointer-events: none;
}

.soft-phone-contact-scope-toolbar .analytics-search-wrap {
  flex: 1 1 auto;
  min-width: 6rem;
  max-width: none;
}

.soft-phone-contact-scope-toolbar .analytics-filter {
  flex: 0 1 auto;
  min-width: 0;
}

.soft-phone-contact-scope-toolbar .analytics-filter .analytics-input {
  min-width: 0;
  width: auto;
  max-width: 9.5rem;
}

.soft-phone-contact-scope-toolbar .analytics-input {
  height: 2.25rem;
  font-size: 0.75rem;
}

.soft-phone-contact-scope-table-wrap {
  flex: 1;
  min-height: 12rem;
  max-height: min(28rem, 55vh);
  margin-top: 0.85rem;
  overflow: auto;
}

#soft-phone-contact-modal.is-scope-open .soft-phone-contact-scope-table-wrap,
#account-blocklist-modal .soft-phone-contact-scope-table-wrap {
  max-height: none;
}

.soft-phone-contact-scope-table {
  margin: 0;
  min-width: 100%;
}

.soft-phone-contact-scope-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--color-surface);
}

.soft-phone-contact-scope-check {
  width: 2.75rem;
  text-align: center;
  vertical-align: middle;
}

.soft-phone-contact-scope-check .field-checkbox {
  display: inline-block;
  vertical-align: middle;
}

.soft-phone-contact-scope-name {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.soft-phone-contact-scope-emoji {
  flex-shrink: 0;
  line-height: 1;
}

.soft-phone-contact-scope-row:hover td {
  background: color-mix(in srgb, var(--palette-black) 3%, transparent);
}

@media (max-width: 720px) {
  #soft-phone-contact-modal.is-scope-open .soft-phone-contact-layout,
#account-blocklist-modal .soft-phone-contact-layout {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  #soft-phone-contact-modal.is-scope-open .soft-phone-contact-side,
#account-blocklist-modal .soft-phone-contact-side {
    border-left: 0;
    padding-left: 0;
    padding-top: 1.25rem;
  }

  #soft-phone-contact-modal.is-scope-open .soft-phone-contact-side::before,
#account-blocklist-modal .soft-phone-contact-side::before {
    top: 0;
    bottom: auto;
    left: 8%;
    right: 8%;
    width: auto;
    height: 1px;
    background: linear-gradient(
      to right,
      transparent 0%,
      color-mix(in srgb, var(--color-border) 35%, transparent) 18%,
      color-mix(in srgb, var(--color-border) 35%, transparent) 82%,
      transparent 100%
    );
  }

  #soft-phone-contact-modal.is-scope-open .soft-phone-contact-scope-table-wrap,
#account-blocklist-modal .soft-phone-contact-scope-table-wrap {
    max-height: min(18rem, 40vh);
  }

  .soft-phone-contact-scope-toolbar {
    flex-wrap: wrap;
  }

  .soft-phone-contact-scope-toolbar .analytics-filter .analytics-input {
    max-width: none;
  }
}

.soft-phone-modal .soft-phone-modal-panel {
  border: 0;
}

.soft-phone-modal .team-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: var(--gray-400);
  color: var(--color-text-heading);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.soft-phone-modal .team-modal-close:hover {
  background: var(--btn-soft-fill);
  color: var(--color-on-accent, #171612);
}

.soft-phone-modal .team-modal-close:focus-visible {
  outline: 2px solid var(--color-accent-strong);
  outline-offset: 2px;
}

.soft-phone-modal .settings-btn--primary {
  border-color: var(--color-border);
}

.soft-phone-modal .settings-btn--primary:hover:not(:disabled) {
  border-color: var(--color-border);
}

.team-access-checks {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 18rem;
}

.team-access-check {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--color-text-primary, inherit);
  cursor: pointer;
}

.team-access-check input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

/* Shared modal / settings action buttons (yellow, transparent border, black on hover) */
.settings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-sizing: border-box;
  min-height: 2.1rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  background: var(--btn-soft-fill);
  color: var(--palette-ink);
  font-family: var(--button-font-family);
  font-size: 12px;
  font-weight: var(--button-font-weight);
  line-height: 1.25;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
  white-space: nowrap;
}

.settings-btn .lucide {
  font-size: 1.05rem;
  line-height: 1;
}

.settings-btn:hover:not(:disabled) {
  border-color: var(--color-border);
  background: var(--btn-soft-fill-hover);
  color: var(--palette-ink);
}

.settings-btn:disabled,
.settings-btn[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}

.settings-btn--primary,
.settings-btn--secondary {
  border-color: transparent;
  background: var(--btn-soft-fill);
  color: var(--color-on-accent);
}

.settings-btn--primary:hover:not(:disabled),
.settings-btn--secondary:hover:not(:disabled) {
  border-color: var(--color-border);
  background: var(--btn-soft-fill-hover);
  color: var(--color-on-accent);
}

.settings-btn--danger {
  border-color: transparent;
  background: color-mix(in srgb, var(--color-danger) 12%, var(--color-surface));
  color: var(--color-danger);
}

.settings-btn--danger:hover:not(:disabled) {
  border-color: var(--color-border);
  background: color-mix(in srgb, var(--color-danger) 18%, var(--color-surface));
  color: var(--color-danger);
}

