@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;700&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Serif:wght@500;600&display=swap");

:root {
  --bg: #f4efe6;
  --bg-accent: #fffaf2;
  --card: rgba(255, 252, 247, 0.84);
  --ink: #1d2730;
  --muted: #5e6b76;
  --line: rgba(29, 39, 48, 0.12);
  --brand: #0d7b74;
  --brand-strong: #0b5f59;
  --danger: #a73f2c;
  --danger-bg: rgba(167, 63, 44, 0.1);
  --notice-bg: rgba(13, 123, 116, 0.12);
  --shadow: 0 24px 80px rgba(38, 45, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(13, 123, 116, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(212, 127, 74, 0.18), transparent 24%),
    linear-gradient(180deg, var(--bg-accent), var(--bg));
}

a {
  color: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 24px;
  padding: 8px 0 28px;
}

.brand {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tagline {
  margin: 8px 0 0;
  max-width: 36rem;
  color: var(--muted);
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 24px;
}

.auth-grid {
  align-items: stretch;
  margin-top: 6vh;
}

.hero-copy h1,
.single-card h1 {
  margin: 8px 0 12px;
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.05;
}

.hero-copy p,
.single-card p {
  margin: 0;
  max-width: 44rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.eyebrow {
  display: inline-block;
  color: var(--brand-strong);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.metrics {
  display: flex;
  gap: 16px;
}

.metric,
.card,
.token-card,
.record-editor {
  backdrop-filter: blur(10px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.metric {
  min-width: 150px;
  padding: 18px 20px;
}

.metric strong {
  display: block;
  font-size: 2rem;
}

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

.grid {
  display: grid;
  gap: 24px;
}

.two-column {
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
}

.card {
  padding: 24px;
}

.auth-card {
  width: min(100%, 420px);
}

.single-card {
  max-width: 640px;
  margin: 8vh auto 0;
}

.section-head,
.token-card-head,
.record-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.section-head h2,
.token-card h3,
.record-editor h3 {
  margin: 6px 0 0;
  font-size: 1.2rem;
}

.stack {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(29, 39, 48, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

textarea {
  resize: vertical;
}

button,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: white;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease;
}

button:hover,
.ghost-link:hover {
  background: var(--brand-strong);
  transform: translateY(-1px);
}

.ghost-button {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.ghost-button:hover {
  background: rgba(255, 255, 255, 0.66);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.checkbox-row input {
  width: auto;
}

.flash {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 18px;
}

.flash-notice {
  background: var(--notice-bg);
  color: var(--brand-strong);
}

.flash-error {
  background: var(--danger-bg);
  color: var(--danger);
}

.inline-flash {
  margin-top: 12px;
  margin-bottom: 0;
}

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

.section-rule {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.hero-copy code,
.muted code {
  font-family: "IBM Plex Mono", monospace;
}

.token-list,
.record-editor-list {
  display: grid;
  gap: 16px;
}

.token-card,
.record-editor {
  padding: 18px;
}

.compact-editor {
  padding: 14px 18px;
}

.child-list {
  margin-bottom: 24px;
}

.token-card-error {
  border-color: rgba(167, 63, 44, 0.26);
}

.api-key-secret-card {
  margin-bottom: 24px;
}

.status-pill {
  display: inline-block;
  margin: 10px 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(13, 123, 116, 0.1);
  color: var(--brand-strong);
  font-size: 0.9rem;
  font-weight: 700;
}

.record-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.record-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.record-list li:first-child {
  border-top: 0;
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

.detail-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.code-block,
.mono {
  font-family: "IBM Plex Mono", monospace;
}

.code-block {
  margin: 16px 0;
  padding: 16px 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(29, 39, 48, 0.05);
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 860px) {
  .hero,
  .topbar,
  .section-head,
  .token-card-head,
  .record-editor-head {
    flex-direction: column;
    align-items: stretch;
  }

  .two-column {
    grid-template-columns: 1fr;
  }

  .metrics {
    width: 100%;
  }

  .metric {
    flex: 1;
  }

  .auth-card {
    width: 100%;
  }
}
