/* ============================================================
   Agent Detail Panel — Liquid Glass slide-in overlay
   ============================================================ */

.agent-panel {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  width: 300px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 60;
  backdrop-filter: var(--glass-blur);
  background: var(--glass-bg-heavy);
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transform: translateX(100%);
  transition: transform var(--duration-medium) steps(4);
}

.agent-panel[aria-hidden="false"] {
  transform: translateX(0);
}

/* ---- Header ---- */
.agent-panel__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.agent-panel__avatar,
#ap-sprite {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 2px solid var(--glass-border);
  overflow: hidden;
  flex-shrink: 0;
  image-rendering: pixelated;
}

.agent-panel__info {
  flex: 1;
  overflow: hidden;
}

.agent-panel__name {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-panel__id {
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-panel__close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  flex-shrink: 0;
}

.agent-panel__close:hover {
  color: var(--sys-red);
  border-color: var(--sys-red);
}

/* ---- Sections ---- */
.agent-panel__section {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.agent-panel__label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

/* HP Bar */
.agent-panel__hp-bar {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

.agent-panel__hp-fill {
  height: 100%;
  background: var(--col-hp-high);
  transition: width var(--duration-short) steps(4);
  width: 100%;
}

.agent-panel__hp-fill--mid { background: var(--col-hp-mid); }
.agent-panel__hp-fill--low { background: var(--col-hp-low); }

.agent-panel__hp-text {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Inventory */
.agent-panel__inventory {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.agent-panel__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-secondary);
}

/* Balance */
.agent-panel__balance {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--col-nanoton);
}

/* Last action */
.agent-panel__action {
  font-size: 12px;
  color: var(--text-secondary);
}

/* History */
.agent-panel__history {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  counter-reset: history-counter;
}

.agent-panel__history li {
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 2px 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  counter-increment: history-counter;
}

.agent-panel__history li::before {
  content: counter(history-counter) ".";
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 10px;
  min-width: 14px;
  flex-shrink: 0;
}

/* Inventory chip (created by JS as .inv-chip) */
.inv-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-secondary);
}
.inv-chip strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* Responsive */
@media (max-width: 1279px) {
  .agent-panel {
    width: 100%;
    max-width: 340px;
    backdrop-filter: var(--glass-blur);
    background: var(--glass-bg-heavy);
  }
}
