:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --border: #dbe3f0;
  --danger: #b91c1c;
  --success: #15803d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, #eef4ff 0%, var(--bg) 40%);
  color: var(--text);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.hero,
.dashboard-header {
  margin-bottom: 2rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 700;
}

h1 {
  margin: 0.25rem 0 0.5rem;
  font-size: 2rem;
}

.subtitle,
.caption {
  color: var(--muted);
}

.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
}

input {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  font: inherit;
}

.btn {
  border: none;
  border-radius: 0.6rem;
  padding: 0.65rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn.primary {
  background: var(--primary);
  color: white;
}

.btn.primary:hover {
  background: var(--primary-dark);
}

.btn.secondary {
  background: #e2e8f0;
  color: var(--text);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
}

.error {
  color: var(--danger);
  font-size: 0.875rem;
}

.success {
  color: var(--success);
  font-size: 0.875rem;
}

.hidden {
  display: none;
}

.footer-links {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
}

.footer-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

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

.header-actions {
  display: flex;
  gap: 0.5rem;
}

.quota-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}

.quota-stats .label {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.quota-stats strong {
  font-size: 1.5rem;
}

.progress-track {
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #22c55e, #2563eb);
  transition: width 0.3s ease;
}

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

.inline-form {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}

.inline-form input {
  margin-top: 0;
}

.banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.banner code {
  display: block;
  margin-top: 0.5rem;
  word-break: break-all;
  font-size: 0.85rem;
}

.keys-list,
.usage-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.keys-list li,
.usage-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.code-block {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  font-size: 0.85rem;
  white-space: pre-wrap;
}

@media (max-width: 640px) {
  .dashboard-header,
  .section-header,
  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .quota-stats {
    grid-template-columns: 1fr;
  }
}
