:root {
  --bg: #0d1016;
  --bg-2: #111827;
  --panel: #151c28;
  --panel-2: #0f1623;
  --text: #e5edf5;
  --muted: #98a6b5;
  --accent: #ffbf3c;
  --accent-2: #3ad6ff;
  --danger: #ff6b6b;
  --border: #243145;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --max: 1080px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 700px at 10% -10%, #1c2740 0%, transparent 60%),
              radial-gradient(800px 500px at 90% 0%, #12283f 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(transparent 92%, rgba(255, 255, 255, 0.04) 94%),
                    linear-gradient(90deg, transparent 92%, rgba(255, 255, 255, 0.04) 94%);
  background-size: 36px 36px;
  pointer-events: none;
  opacity: 0.35;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 40px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  backdrop-filter: blur(12px);
  background: rgba(13, 16, 22, 0.7);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #0d0f14;
  font-weight: 800;
  text-transform: lowercase;
  font-family: "Fraunces", serif;
}

.brand-title {
  font-weight: 700;
  letter-spacing: 0.4px;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 18px;
  font-size: 14px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover {
  color: var(--accent);
}

.layout {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 28px 60px;
  display: grid;
  gap: 26px;
}

.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 28px;
  box-shadow: var(--shadow);
}

.panel-header h1,
.panel-header h2 {
  font-family: "Fraunces", serif;
  margin: 0 0 6px;
}

.panel-header p {
  margin: 0;
  color: var(--muted);
}

.oauth {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.oauth-btn {
  border: 1px solid var(--border);
  padding: 14px 18px;
  border-radius: 14px;
  background: #0f1725;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, border 0.2s ease;
}

.oauth-btn:hover {
  border-color: var(--accent-2);
  transform: translateY(-1px);
}

.notice {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed #2f3c54;
  color: var(--muted);
  background: rgba(20, 26, 40, 0.6);
}

.card {
  margin-top: 20px;
  padding: 18px 18px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(15, 22, 35, 0.85);
}

.card-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.key-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.key {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  background: #0d131f;
  border: 1px solid #223046;
  padding: 12px 14px;
  border-radius: 12px;
  min-width: 260px;
  display: inline-block;
  color: #f5f7ff;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.primary,
.danger,
.ghost {
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}

.primary {
  background: var(--accent);
  color: #111;
}

.danger {
  background: transparent;
  border-color: #ff9a9a;
  color: #ff9a9a;
}

.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.primary:disabled,
.danger:disabled,
.ghost:disabled,
.oauth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.helper {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.example {
  margin-top: 16px;
  border-top: 1px dashed #2d3b52;
  padding-top: 14px;
}

.example-title {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.example-code {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #223046;
  background: #0d131f;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #d6e4ff;
  white-space: pre-wrap;
}

.profile {
  color: var(--muted);
  font-size: 14px;
}

.usage-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 18px;
}

.usage-card {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 22, 35, 0.8);
}

.usage-label {
  color: var(--muted);
  font-size: 13px;
}

.usage-value {
  font-size: 26px;
  font-weight: 700;
  margin-top: 6px;
}

.status {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.footer {
  padding: 32px 28px 50px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.muted { color: var(--muted); }

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .layout {
    padding: 20px 18px 50px;
  }
}
