.workspace-voice-routing-panel {
  grid-column: 1 / -1;
  margin-bottom: 12px;
  border: 1px solid #b9dce7;
  border-radius: 12px;
  overflow: hidden;
  background: #eefafd;
}

.avr-loading,
.avr-empty {
  display: grid;
  min-height: 120px;
  place-items: center;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.avr-empty strong,
.avr-empty span {
  display: block;
}

.avr-empty span {
  margin-top: 6px;
}

.avr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid #c8e5ed;
}

.avr-head h3,
.avr-section-head h4,
.avr-voice-title h4 {
  margin: 0;
}

.avr-head p,
.avr-section-head p,
.avr-voice-title p,
.avr-inline-form p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.avr-create {
  display: flex;
  align-items: end;
  gap: 8px;
  min-width: min(420px, 48%);
}

.avr-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.avr-field.is-grow {
  flex: 1;
}

.avr-field > span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.avr-field input,
.avr-field select,
.avr-inline-form input,
.avr-inline-form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
}

.avr-body {
  padding: 16px;
}

.avr-voice-tabs {
  display: flex;
  gap: 8px;
  padding-bottom: 14px;
  overflow-x: auto;
}

.avr-voice-card {
  flex: 0 0 250px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  color: var(--ink-soft);
  background: #fff;
}

.avr-voice-card.is-active {
  border-color: var(--teal);
  box-shadow: inset 3px 0 var(--teal);
}

.avr-voice-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  width: 100%;
  min-height: 58px;
  border: 0;
  padding: 10px 12px;
  color: inherit;
  background: transparent;
  text-align: left;
}

.avr-voice-select strong,
.avr-voice-select small {
  display: block;
}

.avr-voice-select small {
  margin-top: 2px;
  color: var(--muted);
}

.avr-voice-card.is-active .avr-voice-select {
  color: var(--teal-hover);
}

.avr-voice-select:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: -3px;
}

.avr-voice-card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  border-top: 1px solid #d8e9ee;
  padding: 5px 7px 5px 10px;
  background: #f5fbfd;
}

.avr-voice-card-actions button {
  border: 0;
  padding: 5px 6px;
  color: var(--teal);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.avr-voice-card-actions button.is-danger {
  margin-left: auto;
  color: var(--danger);
}

.avr-default-badge,
.avr-state-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  color: #177458;
  background: #e8f7f1;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.avr-voice-detail {
  border: 1px solid #d4e8ee;
  border-radius: 10px;
  background: #fff;
}

.avr-credential-dialog {
  width: min(920px, calc(100vw - 40px));
  max-height: min(760px, calc(100vh - 40px));
  border: 0;
  border-radius: 14px;
  padding: 0;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 24px 70px rgb(20 57 72 / 24%);
}

.avr-credential-dialog::backdrop {
  background: rgb(17 37 48 / 44%);
  backdrop-filter: blur(2px);
}

.avr-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 20px 22px 17px;
  background: #f3fbfd;
}

.avr-dialog-head h3,
.avr-dialog-head p {
  margin: 0;
}

.avr-dialog-head h3 {
  margin-top: 3px;
  font-size: 20px;
}

.avr-dialog-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.avr-dialog-kicker {
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}

.avr-dialog-close {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-size: 22px;
  line-height: 1;
}

.avr-dialog-body {
  max-height: calc(min(760px, 100vh - 40px) - 106px);
  padding: 18px 22px 22px;
  overflow-y: auto;
}

.avr-dialog-section + .avr-dialog-section {
  margin-top: 16px;
}

.avr-dialog-form-section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.avr-dialog-form-section .avr-inline-form {
  margin-bottom: 0;
}

.avr-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.avr-link-button {
  border: 0;
  padding: 5px 7px;
  color: var(--teal);
  background: transparent;
  font-weight: 700;
}

.avr-link-button.is-danger {
  color: var(--danger);
}

.avr-section {
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
}

.avr-section:last-child {
  border-bottom: 0;
}

.avr-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.avr-credential-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.avr-credential {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--surface-strong);
}

.avr-credential strong,
.avr-credential small {
  display: block;
}

.avr-credential small {
  margin-top: 2px;
  color: var(--muted);
}

.avr-inline-form {
  margin-bottom: 12px;
  border: 1px solid #a8d5e2;
  border-radius: 9px;
  padding: 13px;
  background: #f5fcfe;
}

.avr-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 11px;
}

.avr-form-grid .is-wide {
  grid-column: span 2;
}

.avr-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 11px;
}

.avr-table-wrap {
  overflow-x: auto;
}

.avr-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.avr-table th,
.avr-table td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.avr-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.avr-table td strong,
.avr-table td small {
  display: block;
}

.avr-table td small {
  color: var(--muted);
}

.avr-table code {
  color: var(--teal-hover);
  font-size: 12px;
}

.avr-mini-empty {
  padding: 18px;
  border: 1px dashed #c3dce5;
  border-radius: 8px;
  color: var(--muted);
  background: #fbfdfe;
  text-align: center;
}

.avr-error {
  margin: 9px 0 0;
  color: var(--danger);
  font-size: 12px;
}

.avr-success {
  margin: 0 0 12px;
  border: 1px solid #b9dfcf;
  border-radius: 8px;
  padding: 9px 11px;
  color: #177458;
  background: #effaf5;
  font-size: 12px;
}

.avr-check {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 1000px) {
  .avr-head {
    align-items: stretch;
    flex-direction: column;
  }

  .avr-create {
    min-width: 0;
  }

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

@media (max-width: 680px) {
  .avr-create,
  .avr-section-head,
  .avr-credential {
    align-items: stretch;
    flex-direction: column;
  }

  .avr-credential-list,
  .avr-form-grid {
    grid-template-columns: 1fr;
  }

  .avr-form-grid .is-wide {
    grid-column: auto;
  }

  .avr-credential-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .avr-dialog-head,
  .avr-dialog-body {
    padding-right: 14px;
    padding-left: 14px;
  }
}
