/* Portal — API keys panel */
.api-keys-page {
  max-width: 820px;
}

.api-keys-hero {
  margin-bottom: 20px;
}

.api-keys-hero h3 {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.api-keys-hero .lead {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0;
}

.api-auth-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
  margin-bottom: 18px;
}

.api-auth-banner .icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.api-auth-banner.authorized .icon-wrap {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.api-auth-banner.denied .icon-wrap {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.api-auth-banner .body h4 {
  margin: 0 0 4px;
  font-size: 0.9375rem;
}

.api-auth-banner .body p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
}

.api-gate {
  padding: 28px 24px;
  text-align: center;
  border-radius: 14px;
  border: 1px dashed var(--border);
  background: rgba(15, 17, 23, 0.4);
  margin-bottom: 20px;
}

.api-gate h4 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.api-gate p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.875rem;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.api-keys-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.api-keys-toolbar input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.api-keys-toolbar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.api-secret-card {
  margin-bottom: 20px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.06);
}

.api-secret-card .warn {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #86efac;
  margin: 0 0 12px;
}

.api-secret-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.api-secret-value {
  flex: 1;
  font-family: var(--vscode-editor-font-family, ui-monospace, monospace);
  font-size: 0.8125rem;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  word-break: break-all;
  line-height: 1.45;
  min-height: 44px;
}

.api-secret-value.masked {
  filter: blur(6px);
  user-select: none;
}

.api-secret-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.api-secret-actions .btn {
  width: auto;
  white-space: nowrap;
  padding: 10px 14px;
  font-size: 0.8125rem;
}

.api-usage-hint {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
}

.api-usage-hint code {
  color: var(--accent);
  font-size: 0.7rem;
}

.api-keys-table-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.api-keys-table-wrap .data-table {
  margin: 0;
}

.api-keys-table-wrap th {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--surface2);
}

.btn-copy-sm {
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
}

.btn-copy-sm:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  font-size: 0.8125rem;
  z-index: 9999;
  opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
  pointer-events: none;
}

.copy-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
