:root {
  color-scheme: light;
  --bg: #f4efe6;
  --panel: rgba(255, 252, 247, 0.82);
  --panel-border: rgba(76, 58, 34, 0.12);
  --text: #2d2418;
  --muted: #746754;
  --accent: #1e6b5c;
  --accent-strong: #174f44;
  --danger: #a83a32;
  --shadow: 0 20px 60px rgba(61, 45, 22, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(30, 107, 92, 0.14), transparent 28%),
    radial-gradient(circle at bottom right, rgba(168, 58, 50, 0.12), transparent 25%),
    linear-gradient(135deg, #f7f2ea 0%, #efe5d7 100%);
}

a {
  color: var(--accent-strong);
}

button,
textarea {
  font: inherit;
}

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

.hero {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 0.96;
}

.subtitle {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

.hero-summary .subtitle {
  margin: 0;
}

.hero-button {
  flex-shrink: 0;
}

.api-code-panel {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.code-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(76, 58, 34, 0.09);
}

.code-head h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.code-card pre {
  margin: 0;
  overflow-x: auto;
  padding: 14px;
  border-radius: 16px;
  background: #1f1a15;
  color: #f7f1e7;
  line-height: 1.55;
}

.code-card code {
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
}

.panel {
  backdrop-filter: blur(14px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.composer {
  padding: 20px;
}

.label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 140px;
  padding: 16px;
  border: 1px solid rgba(76, 58, 34, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  outline: none;
}

textarea:focus {
  border-color: rgba(30, 107, 92, 0.5);
  box-shadow: 0 0 0 4px rgba(30, 107, 92, 0.12);
}

.form-actions,
.panel-head,
.record-meta,
.record-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-actions {
  margin-top: 14px;
}

.status {
  margin: 0;
  color: var(--muted);
  min-height: 24px;
}

.status[data-error="true"] {
  color: var(--danger);
}

.primary-button,
.ghost-button {
  border-radius: 999px;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.primary-button {
  border: 0;
  padding: 12px 22px;
  color: white;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.ghost-button {
  border: 1px solid rgba(76, 58, 34, 0.14);
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--text);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.records {
  margin-top: 22px;
  padding: 20px;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.empty-state {
  padding: 32px 0 8px;
  color: var(--muted);
}

.records-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.record-item {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(76, 58, 34, 0.09);
}

.record-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.record-type {
  font-weight: 700;
  color: var(--accent);
}

.record-content {
  margin: 14px 0 16px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.record-actions {
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 880px);
    padding: 28px 0 48px;
  }

  .hero {
    margin-bottom: 20px;
  }

  .hero h1 {
    font-size: clamp(1.9rem, 10vw, 2.8rem);
    line-height: 1;
  }

  .subtitle {
    font-size: 0.98rem;
    line-height: 1.55;
  }

  .composer,
  .records,
  .code-card {
    padding: 16px;
  }

  textarea {
    min-height: 120px;
    padding: 14px;
  }

  .code-card pre {
    padding: 12px;
    font-size: 0.88rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .form-actions,
  .panel-head,
  .record-meta,
  .record-actions,
  .hero-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .record-actions {
    justify-content: stretch;
  }
}
