/* Dashboard-specific styles */

.auth-section,
.dashboard-section {
  padding: 3rem 0;
  min-height: calc(100vh - var(--header-h) - 4rem);
}

.auth-panel {
  max-width: 420px;
  margin: 2rem auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
}

.auth-panel h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.auth-lead {
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1rem;
}

.auth-status {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

#auth-notice {
  margin-bottom: 1.25rem;
}

.auth-error {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.85rem;
  background: rgba(240, 100, 100, 0.15);
  border: 1px solid rgba(240, 100, 100, 0.35);
  border-radius: 6px;
  color: #f0a0a0;
  font-size: 0.85rem;
}

.dashboard-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
  /* minmax(0, …): long code/URLs inside a card must not widen the track past the viewport */
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 768px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card {
  min-width: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.35rem;
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.profile-info,
.usage-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.info-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.loading-state {
  padding: 1rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.loading-section {
  padding: 4rem 0;
  text-align: center;
  min-height: calc(100vh - var(--header-h));
}

.checkout-redirect-section p {
  margin: 0;
  font-size: 1rem;
  color: var(--text-muted);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 1rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.notice {
  padding: 1rem 1.1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.notice p {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.notice p:last-child {
  margin-bottom: 0;
}

.notice-info {
  background: rgba(61, 214, 198, 0.1);
  border: 1px solid rgba(61, 214, 198, 0.3);
  color: var(--text);
}

.notice-warning {
  background: rgba(232, 184, 74, 0.1);
  border: 1px solid rgba(232, 184, 74, 0.3);
  color: var(--text);
}

.notice-footer {
  font-size: 0.8rem !important;
  color: var(--text-muted) !important;
}

.key-display {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.75rem 0;
  padding: 0.75rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.key-display code {
  flex: 1;
  font-size: 0.85rem;
  word-break: break-all;
  color: var(--accent);
}

.key-note {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.usage-stat {
  text-align: center;
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.75rem;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.usage-list {
  max-height: 300px;
  overflow-y: auto;
}

.usage-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

.usage-item:last-child {
  border-bottom: none;
}

.usage-date {
  color: var(--text-muted);
}

.usage-count {
  font-family: var(--font-mono);
  color: var(--text);
  font-weight: 500;
}

/* —— API key mask —— */
.key-display code.key-masked {
  letter-spacing: 0.02em;
}

/* —— Try it out —— */
/* Some panels set display (flex/grid); keep the hidden attribute authoritative. */
.tryit [hidden] {
  display: none !important;
}

.card-wide {
  grid-column: 1 / -1;
}

.tryit-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 1rem;
}

.tryit-head h2 {
  margin: 0;
}

.tryit-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.tryit-form .form-field {
  margin-bottom: 0.9rem;
}

.tryit-row {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
}

.tryit-row input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
}

.tryit-hint {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.tryit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.chip {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.chip:hover,
.chip.active {
  border-color: var(--accent-dim);
  color: var(--accent);
  background: var(--accent-bg);
}

.tryit-request {
  margin-top: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--code-bg);
  overflow: hidden;
}

.tryit-request-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  overflow-x: auto;
}

.tryit-request-line code {
  color: var(--text);
  white-space: nowrap;
}

.http-method {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  color: #061018;
  background: var(--accent);
}

.tryit-curl {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
}

.tryit-curl pre {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.tryit-curl-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.tryit-error {
  margin-top: 1rem;
  padding: 0.7rem 0.9rem;
  background: rgba(240, 100, 100, 0.12);
  border: 1px solid rgba(240, 100, 100, 0.35);
  border-radius: 8px;
  color: #f0b0b0;
  font-size: 0.85rem;
}

.tryit-error strong {
  color: #f4c4c4;
}

.tryit-error .tryit-error-detail {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.tryit-result {
  margin-top: 1rem;
}

.tryit-result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.tabs {
  display: inline-flex;
  padding: 0.2rem;
  gap: 0.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.tab {
  padding: 0.3rem 0.85rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 560;
  cursor: pointer;
}

.tab[aria-selected="true"] {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--border);
}

.tryit-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.status-pill {
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid var(--border);
}

.status-pill.ok {
  color: var(--accent);
  border-color: rgba(61, 214, 198, 0.4);
  background: var(--accent-bg);
}

.status-pill.warn {
  color: var(--warn);
  border-color: rgba(232, 184, 74, 0.4);
  background: rgba(232, 184, 74, 0.08);
}

.status-pill.err {
  color: #f0a0a0;
  border-color: rgba(240, 100, 100, 0.4);
  background: rgba(240, 100, 100, 0.1);
}

.tryit-raw {
  margin: 0;
  max-height: 480px;
  overflow: auto;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--code-bg);
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
}

.tryit-pretty {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pretty-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.pretty-summary-item {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.pretty-summary-item .k {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pretty-summary-item .v {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
}

.pretty-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .pretty-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

.pretty-section {
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  min-width: 0;
}

.pretty-section h3 {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.pretty-rows {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: 0.3rem 0.9rem;
  font-size: 0.83rem;
}

.pretty-rows dt {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-dim);
  padding-top: 0.08rem;
}

.pretty-rows dd {
  margin: 0;
  color: var(--text);
  word-break: break-word;
  text-align: right;
}

.pretty-rows dd.null {
  color: var(--text-dim);
}

.pretty-rows dd .pretty-rows {
  margin-top: 0.2rem;
  text-align: left;
}

.pretty-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pretty-rows + .pretty-badges {
  margin-top: 0.7rem;
}

.flag-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
}

.flag-badge::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--border);
}

.flag-badge.on {
  color: var(--accent);
  border-color: rgba(61, 214, 198, 0.45);
  background: var(--accent-bg);
}

.flag-badge.on::before {
  background: var(--accent);
}

@media (max-width: 560px) {
  .tryit-curl {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Buttons set display:inline-flex, which would override [hidden] (e.g. Logout
   while signed out, Pay invoice). Keep the attribute authoritative in the
   header, key card, billing card, and modals. */
.site-header [hidden],
.auth-panel [hidden],
#key-content [hidden],
#keys-card [hidden],
#billing-card [hidden],
.modal [hidden] {
  display: none !important;
}

.key-warn {
  color: var(--warn);
}

.key-legacy-notice {
  margin-top: 0.85rem;
}

#key-actions {
  margin-top: 0.9rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.keys-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
  margin-bottom: 1rem;
}

.keys-toolbar h2 {
  margin: 0 0 0.35rem;
}

.keys-lead,
.keys-toolbar-copy .keys-lead {
  margin: 0;
  max-width: 36rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.keys-limit-hint {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(232, 184, 74, 0.35);
  border-radius: 8px;
  background: rgba(232, 184, 74, 0.08);
}

.keys-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.key-card {
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.key-card-inactive {
  opacity: 0.78;
  border-style: dashed;
}

.key-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.8rem;
}

.key-name-edit {
  min-width: 0;
  flex: 1;
}

.key-name-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  margin: 0;
  padding: 0.15rem 0.4rem 0.15rem 0.2rem;
  border: 1px dashed transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  text-align: left;
  cursor: pointer;
}

.key-name-btn-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-name-edit-icon {
  flex: 0 0 auto;
  width: 0.875rem;
  height: 0.875rem;
  color: var(--text-dim);
}

.key-name-btn:hover,
.key-name-btn:focus-visible {
  border-color: var(--accent-dim);
  outline: none;
}

.key-name-btn:hover .key-name-edit-icon,
.key-name-btn:focus-visible .key-name-edit-icon {
  color: var(--text-muted);
}

.key-name-input {
  width: 100%;
  max-width: 22rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--accent-dim);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.95rem;
}

.key-card-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 0.85rem;
  margin: 0.7rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.key-card-meta dt {
  margin: 0;
  color: var(--text-dim);
}

.key-card-meta dd {
  margin: 0;
  color: var(--text);
}

.key-card-meta code,
.key-prefix-hint {
  color: var(--accent);
  font-size: 0.78rem;
}

.key-restrictions-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
}

.key-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.modal-dialog-wide {
  max-width: 36rem;
}

.modal-dialog-wide .modal-panel {
  max-height: calc(100vh - 2.5rem);
  overflow: auto;
}

.key-display-reveal {
  margin-top: 0.35rem;
}

.key-reveal-value {
  font-size: 0.82rem;
}

.restrictions-editor {
  margin: 0.25rem 0 0.5rem;
  /* Override the global section padding (4.5rem) so the editor
     does not reserve a large empty gap above Allowed origins. */
  padding: 0;
}

.restrictions-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.restrictions-title .optional {
  font-weight: 400;
  color: var(--text-dim);
}

.restrictions-lead,
.chip-help {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.restrictions-lock[hidden] {
  display: none !important;
  margin: 0;
  padding: 0;
  border: 0;
  min-height: 0;
}

.restrictions-lock:not([hidden]) {
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(61, 214, 198, 0.28);
  border-radius: 8px;
  background: var(--accent-bg);
}

.restrictions-lock p {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
}

.restrictions-fields {
  display: grid;
  gap: 1rem;
}

.restrictions-fields[aria-disabled="true"] {
  opacity: 0.72;
}

.chip-editor-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 550;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 1.9rem;
  margin-bottom: 0.45rem;
}

.chip-empty {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.allow-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.3rem 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text);
}

.allow-chip-remove {
  appearance: none;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.allow-chip-remove:hover,
.allow-chip-remove:focus-visible {
  color: var(--text);
  background: var(--bg);
  outline: none;
}

.chip-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: stretch;
}

.chip-add-row input {
  flex: 1;
  min-width: 12rem;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.chip-add-row input:focus {
  border-color: var(--accent-dim);
  outline: none;
  box-shadow: 0 0 0 2px rgba(61, 214, 198, 0.15);
}

.chip-add-row input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.chip-error {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  color: #f0a0a0;
}

@media (max-width: 560px) {
  .keys-toolbar .btn-primary {
    width: 100%;
  }
}

.quota-block {
  margin-bottom: 1rem;
}

.quota-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.quota-numbers {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.quota-bar {
  height: 0.55rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.quota-bar-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.quota-bar-fill.warn {
  background: var(--warn);
}

.quota-bar-fill.err {
  background: #e07070;
}

.usage-chart {
  margin: 0.5rem 0 1rem;
}

.usage-chart svg {
  width: 100%;
  height: 120px;
  display: block;
  color: var(--accent);
}

.rename-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
  align-items: stretch;
}

.rename-row input {
  flex: 1;
  min-width: 8rem;
  font-size: 0.85rem;
}

.tryit-save {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin-top: 0.5rem;
}

.tryit-save .tryit-hint {
  margin: 0;
}

.billing-plans-heading {
  margin: 1.15rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.billing-details {
  margin: 1.5rem 0 0;
  padding: 1.1rem 0 0;
  border-top: 1px solid var(--border);
}

.billing-details-heading {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
}

#billing-trial-banner {
  margin: 0 0 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

#billing-launch-banner {
  margin: 0 0 0.85rem;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--accent), #7ee8dc);
  color: #0b0f14;
  padding: .55rem .85rem;
  font-size: .9rem;
}

#billing-launch-banner .lb-inner {
  max-width: none;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .4rem .75rem;
  text-align: center;
}

#billing-upgrades.pricing-grid .price-card .popular-badge {
  position: absolute;
  top: 0;
  left: 1.5rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--accent);
  color: #0b0f14;
  font-family: var(--font-sans);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  line-height: 1;
  padding: .3rem .6rem;
  border-radius: 999px;
  white-space: nowrap;
}

#billing-upgrades.pricing-grid .price-card .popular-badge svg {
  flex: none;
  display: block;
}

#billing-toggle {
  margin: 0 0 1rem;
}

#billing-upgrades.pricing-grid {
  margin: 1.1rem 0 1rem;
}

#billing-upgrades.pricing-grid .price-card {
  position: relative;
}

#billing-upgrades.pricing-grid .price-card.current {
  box-shadow: 0 0 0 1px var(--accent-dim);
}

#billing-upgrades.pricing-grid .price-card .badge.current-badge {
  left: auto;
  right: 1rem;
  top: -.7rem;
  background: var(--bg-elevated);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
}

#billing-upgrades.pricing-grid .price-card.featured .badge.current-badge {
  top: -.7rem;
}

button.lb-btn,
button.lb-alt,
button.trial-banner-cta {
  appearance: none;
  font: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}

button.lb-btn {
  background: #0b0f14;
  color: #fff !important;
  font-weight: 700;
  font-size: .88rem;
  padding: .45rem .9rem;
  border-radius: 8px;
}

button.trial-banner-cta {
  color: var(--accent);
  font-weight: 600;
  margin-left: .4rem;
}

.billing-plans-note {
  margin: 0 0 0.75rem;
}

.billing-plans {
  display: grid;
  gap: 0.85rem;
  margin: 1.1rem 0 1rem;
}

/* Plan picker: keep display:grid once JS removes [hidden]. Same-specificity
   .billing-plans { display: grid } would otherwise fight the UA [hidden] rule.
   #billing-card [hidden] / .modal [hidden] still hide true [hidden] descendants. */
#billing-upgrades:not([hidden]) {
  display: grid;
}

.upgrade-compare {
  appearance: none;
  background: none;
  border: 0;
  padding: 0.45rem 0;
  color: var(--accent);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.billing-plan {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  background: var(--bg);
}

.billing-plan h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.billing-plan-price {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.billing-plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.billing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.billing-pending {
  margin: 0.85rem 0 0;
}

.billing-pending p {
  margin: 0 0 0.65rem;
}

#plan-confirm-modal {
  z-index: 210;
}

.modal-dialog-plan {
  max-width: 28rem;
}

.plan-confirm-summary {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
}

.plan-confirm-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  font-size: 0.88rem;
}

.plan-confirm-label {
  color: var(--text-muted);
  flex: 0 0 7.5rem;
}

.plan-confirm-value {
  text-align: right;
  color: var(--text);
}

.plan-confirm-charge {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: var(--text);
}

.notice-success {
  background: rgba(61, 214, 198, 0.1);
  border: 1px solid rgba(61, 214, 198, 0.3);
  color: var(--text);
}

.upsell-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.upsell-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.upsell-list p {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.upsell-list code {
  font-size: 0.78rem;
}

.tryit-mode {
  margin: 0.15rem 0 0.75rem;
}

.tryit-bulk {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}

.tryit-bulk input {
  margin: 0.2rem 0 0;
  flex: none;
}

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

.tryit-bulk-label {
  font-weight: 600;
}

.tryit-bulk-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.tryit-error a.tryit-upgrade {
  display: inline-block;
  margin-top: 0.45rem;
}

.dashboard-section .contact-form {
  max-width: none;
  margin: 0;
}

/* The dashboard header has only two items (API Docs, Logout) and no hamburger
   toggle, so keep the nav inline on small screens instead of the collapsed menu. */
@media (max-width: 720px) {
  .site-header .nav {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  .site-header .nav a {
    padding: 0;
    font-size: 0.9rem;
  }
  .site-header .nav .btn-sm {
    margin: 0;
    width: auto;
  }
}
