:root {
  --bg: #f4f1ea;
  --panel: #fffdf8;
  --panel-border: #d6cfc3;
  --text: #1d1f1b;
  --muted: #596155;
  --accent: #21554a;
  --accent-strong: #173b33;
  --danger: #8f2f22;
  --danger-bg: #f7e4df;
  --success: #1d5f42;
  --success-bg: #e3f3ea;
  --shadow: 0 14px 36px rgba(53, 45, 28, 0.08);
  --radius: 18px;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --font-body: "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(33, 85, 74, 0.08), transparent 22rem),
    linear-gradient(180deg, #faf7f2 0%, var(--bg) 100%);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
}

.shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  padding: 2.5rem 0 1.5rem;
}

.site-header h1,
.section-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-header h1 {
  font-size: clamp(2.2rem, 4vw, 3.7rem);
}

.lede,
.section-copy,
.eyebrow,
.prompt-card p,
label,
input,
textarea,
summary,
table,
.empty-state,
.flash p {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
}

.panel,
.flash {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: 1.25rem;
  margin: 0 0 1.25rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.section-copy {
  max-width: 28rem;
  margin: 0;
}

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

.prompt-card {
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 1rem;
  background: #fff;
}

.prompt-card-missing {
  border-color: #e1b4aa;
}

.prompt-card-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: start;
}

.prompt-card h3 {
  margin: 0 0 0.25rem;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.15rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

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

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--accent-strong);
}

.button-secondary {
  background: #e7efe8;
  color: var(--accent-strong);
}

.render-form {
  display: grid;
  gap: 0.75rem;
}

.form-grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

input,
textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid #b9c1b4;
  border-radius: 12px;
  background: #fff;
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 24rem;
  font-family: "SFMono-Regular", "Menlo", monospace;
  color: var(--text);
}

details {
  margin-top: 0.75rem;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f6f4ef;
  border-radius: 12px;
  padding: 0.85rem;
  overflow-x: auto;
  color: var(--text);
}

.flash {
  padding: 1rem 1.25rem;
  margin: 0 0 1.25rem;
}

.flash h2 {
  margin-top: 0;
}

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

.flash-success {
  border-color: #b8d9c7;
  background: var(--success-bg);
}

.flash-info {
  border-color: #b9cfe3;
  background: #eaf3fb;
}

.flash-body {
  margin: 0;
  color: var(--danger);
}

.inline-error {
  color: var(--danger);
  font-weight: 600;
}

.recent-table-wrap {
  overflow-x: auto;
}

.recent-table {
  width: 100%;
  border-collapse: collapse;
}

.recent-table th,
.recent-table td {
  text-align: left;
  padding: 0.8rem 0.65rem;
  border-bottom: 1px solid #ddd6cb;
  vertical-align: top;
}

.download-link {
  color: var(--accent-strong);
  font-weight: 700;
}

.inline-form {
  margin-top: 0.45rem;
  display: grid;
  gap: 0.45rem;
}

.inline-disclosure {
  margin-top: 0.1rem;
}

.inline-disclosure summary {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 0.12em;
  font-weight: 700;
}

.inline-disclosure-body {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.inline-input {
  min-width: 14rem;
  padding: 0.65rem 0.8rem;
  font-size: 0.92rem;
}

.button-small {
  min-height: 36px;
  padding: 0.55rem 0.9rem;
  font-size: 0.92rem;
}

.muted-note {
  display: inline-block;
  margin-top: 0.45rem;
  color: var(--muted);
}

.empty-state {
  margin: 0;
}

@media (max-width: 720px) {
  .site-header {
    padding-top: 1.5rem;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .prompt-card-header {
    flex-direction: column;
  }

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

  .recent-table thead {
    display: none;
  }

  .recent-table,
  .recent-table tbody,
  .recent-table tr,
  .recent-table td {
    display: block;
    width: 100%;
  }

  .recent-table tr {
    padding: 0.75rem 0;
    border-bottom: 1px solid #ddd6cb;
  }

  .recent-table td {
    border: 0;
    padding: 0.2rem 0;
  }

  .recent-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.1rem;
  }
}
