/* API keys panel (public API v1). Scoped to .api-keys-live. */

.api-keys-live[hidden],
.api-keys-live [hidden] {
  display: none !important;
}

.api-keys-live {
  display: grid;
  gap: 18px;
}

.api-keys-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 10px 28px rgba(16, 37, 35, .04);
}

body[data-theme="dark"] .api-keys-card {
  background: #111f1d;
  border-color: rgba(255, 255, 255, .1);
}

.api-keys-card h2 {
  margin: 0 0 6px;
}

.api-keys-card > p {
  margin: 0 0 16px;
  color: var(--muted);
}

.api-keys-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px auto;
  gap: 12px;
  align-items: end;
}

.api-keys-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.api-keys-form input,
.api-keys-form select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  font: inherit;
  color: var(--ink);
  background: #f8fffe;
}

body[data-theme="dark"] .api-keys-form input,
body[data-theme="dark"] .api-keys-form select {
  background: #0c1716;
  color: #e9fbf3;
  border-color: rgba(255, 255, 255, .14);
}

.api-keys-form button {
  min-height: 46px;
  white-space: nowrap;
}

.api-keys-message {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.api-keys-message.is-error {
  color: #b42318;
}

.api-keys-new {
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid #f0c36d;
  background: #fff8e6;
  color: #5b4300;
}

.api-keys-new strong {
  display: block;
  margin-bottom: 4px;
}

.api-keys-new code {
  display: block;
  margin: 10px 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #0c1f1c;
  color: #e9fbf3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  overflow-wrap: anywhere;
  user-select: all;
}

.api-keys-new-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.api-keys-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.api-keys-empty {
  color: var(--muted);
}

.api-keys-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

body[data-theme="dark"] .api-keys-row {
  border-color: rgba(255, 255, 255, .1);
}

.api-keys-row.is-inactive {
  opacity: .6;
}

.api-keys-row-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.api-keys-label {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.api-keys-prefix {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--muted);
}

.api-keys-meta {
  color: var(--muted);
  font-size: 13px;
}

.api-keys-status {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: #d9f3ec;
  color: #10302c;
}

.api-keys-row.is-inactive .api-keys-status {
  background: rgba(127, 127, 127, .18);
  color: inherit;
}

.api-keys-quickstart pre {
  margin: 10px 0 0;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: #0c1f1c;
  color: #e9fbf3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  overflow-x: auto;
}

@media (max-width: 760px) {
  .api-keys-form,
  .api-keys-row {
    grid-template-columns: 1fr;
  }
}

body[data-theme="dark"] .api-keys-new,
html[data-theme="dark"] .api-keys-new {
  background: #3a2f10;
  border-color: #8a6a1c;
  color: #ffe9b0;
}
