.atp-root {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.atp-root[hidden] {
  display: none !important;
}

.atp-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 14, 0.72);
  backdrop-filter: blur(6px);
}

.atp-panel {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100vw - 2rem));
  max-height: min(720px, calc(100vh - 2rem));
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.15rem;
  border-radius: 1rem;
  background: linear-gradient(180deg, #121821 0%, #0b111a 100%);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  color: #e2e8f0;
}

.atp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.atp-eyebrow {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
}

.atp-header h2 {
  margin: 0.2rem 0 0;
  font-size: 1.25rem;
  font-weight: 650;
  color: #f8fafc;
}

.atp-close {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.55rem;
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.atp-search-wrap {
  display: block;
}

.atp-search {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0.7rem;
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  padding: 0.75rem 0.9rem;
  font-size: 0.95rem;
  outline: none;
}

.atp-search:focus {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.atp-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: #94a3b8;
  font-size: 0.8rem;
}

.atp-refresh {
  border: 0;
  background: transparent;
  color: #10b981;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.atp-list {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 180px;
  max-height: 360px;
  padding-right: 0.15rem;
}

.atp-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: #94a3b8;
  border: 1px dashed rgba(148, 163, 184, 0.25);
  border-radius: 0.8rem;
}

.atp-target {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 0.8rem;
  background: rgba(15, 23, 42, 0.72);
  color: inherit;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
}

.atp-target:hover:not([disabled]) {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.08);
}

.atp-target.is-selected {
  border-color: rgba(16, 185, 129, 0.7);
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.35);
}

.atp-target[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.atp-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f766e, #10b981);
  color: #fff;
  font-weight: 700;
}

.atp-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.atp-copy strong {
  font-size: 0.95rem;
  color: #f8fafc;
}

.atp-copy small {
  color: #94a3b8;
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atp-status {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.atp-status.is-available {
  color: #34d399;
}

.atp-status.is-offline {
  color: #94a3b8;
}

.atp-message {
  margin: 0;
  min-height: 1.2rem;
  font-size: 0.82rem;
  color: #94a3b8;
}

.atp-message[data-tone='error'] {
  color: #f87171;
}

.atp-message[data-tone='success'] {
  color: #34d399;
}

.atp-footer {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 0.65rem;
}

.atp-secondary,
.atp-primary {
  border: 0;
  border-radius: 0.75rem;
  padding: 0.8rem 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.atp-secondary {
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
}

.atp-primary {
  background: #10b981;
  color: #052e1c;
}

.atp-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

html.atp-open {
  overflow: hidden;
}
