:root {
  --bg: #f2eee5;
  --panel: rgba(255, 252, 246, 0.84);
  --ink: #1e2a2f;
  --muted: #5f6d72;
  --line: rgba(28, 53, 58, 0.12);
  --brand: #0c7c78;
  --brand-deep: #0a5d63;
  --accent: #c76839;
  --accent-soft: #f2b38d;
  --shadow: 0 18px 38px rgba(20, 40, 46, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(199, 104, 57, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(12, 124, 120, 0.15), transparent 30%),
    linear-gradient(180deg, #f7f2ea 0%, #ede5d8 100%);
  font-family: "Avenir Next", "Segoe UI", "Trebuchet MS", sans-serif;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 28px;
}

.hero-copy,
.hero-panel,
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 34px;
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--brand);
  font-weight: 700;
}

h1,
h2,
h3 {
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

h1 {
  margin: 0;
  font-size: clamp(2.3rem, 4.2vw, 4.4rem);
  line-height: 0.95;
}

.lead {
  max-width: 62ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-points span,
.example-chip {
  border: 1px solid rgba(12, 124, 120, 0.18);
  background: rgba(12, 124, 120, 0.08);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.92rem;
}

.hero-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(12, 124, 120, 0.92), rgba(10, 93, 99, 0.92)),
    linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 55%);
  color: #f9fbfb;
}

.metric-card {
  border-radius: 22px;
  padding: 18px 18px 16px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.metric-card strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 8px;
}

.metric-card p {
  margin: 0;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
}

.workspace {
  display: grid;
  gap: 22px;
}

.panel {
  padding: 28px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

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

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

.generator-form,
.outline-editor {
  display: grid;
  gap: 16px;
}

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

label {
  display: grid;
  gap: 8px;
}

label span {
  font-weight: 700;
  font-size: 0.95rem;
}

input,
textarea,
select,
.editable-input,
.editable-textarea {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(30, 42, 47, 0.12);
  background: rgba(255, 255, 255, 0.7);
  padding: 14px 16px;
  font: inherit;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus,
.editable-input:focus,
.editable-textarea:focus {
  outline: none;
  border-color: rgba(12, 124, 120, 0.45);
  box-shadow: 0 0 0 4px rgba(12, 124, 120, 0.1);
}

textarea,
.editable-textarea {
  resize: vertical;
}

.upload-label input {
  padding: 10px 0;
  border: none;
  background: transparent;
}

.primary-btn,
.download-link {
  border: none;
  border-radius: 999px;
  padding: 14px 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.secondary-btn {
  border: 1px solid rgba(12, 124, 120, 0.16);
  border-radius: 999px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.secondary-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(12, 124, 120, 0.28);
}

.primary-btn {
  color: #fff8f0;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  box-shadow: 0 10px 20px rgba(10, 93, 99, 0.14);
}

.accent-btn {
  background: linear-gradient(135deg, var(--accent), #a64922);
  box-shadow: 0 10px 20px rgba(166, 73, 34, 0.14);
}

.primary-btn:hover,
.download-link:hover {
  transform: translateY(-1px);
}

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

.status-line.error {
  color: #a64321;
}

.status-line.ok {
  color: var(--brand-deep);
}

.quality-meter {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 12px 0 18px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(30, 42, 47, 0.1);
  background: rgba(255, 255, 255, 0.62);
}

.quality-meter.good {
  border-color: rgba(12, 124, 120, 0.24);
  background: rgba(12, 124, 120, 0.08);
}

.quality-meter.warn {
  border-color: rgba(199, 104, 57, 0.28);
  background: rgba(199, 104, 57, 0.1);
}

.quality-meter.bad {
  border-color: rgba(166, 67, 33, 0.3);
  background: rgba(166, 67, 33, 0.09);
}

.quality-label {
  font-weight: 700;
  color: var(--muted);
}

.quality-meter strong {
  color: var(--ink);
}

.quality-note {
  color: var(--muted);
  line-height: 1.45;
}

.example-strip,
.download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-edit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.example-chip {
  cursor: pointer;
}

.outline-card,
.result-card {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  padding: 18px;
}

.outline-card h3,
.result-card h3 {
  margin: 0 0 12px;
  font-size: 1.12rem;
}

.bullet-list,
.text-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(30, 42, 47, 0.12);
}

.download-link strong {
  font-weight: 800;
}

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

.result-editor,
.result-grid {
  display: grid;
  gap: 16px;
}

.progress-toast {
  position: sticky;
  top: 14px;
  z-index: 20;
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(12, 124, 120, 0.14);
  background: rgba(255, 252, 246, 0.94);
  box-shadow: 0 18px 38px rgba(20, 40, 46, 0.1);
  backdrop-filter: blur(14px);
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.progress-bar {
  overflow: hidden;
  height: 10px;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(12, 124, 120, 0.09);
}

.progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  transition: width 0.35s ease;
}

.progress-toast p {
  margin: 10px 0 0;
  color: var(--muted);
}

.result-card label {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.result-card label:first-of-type {
  margin-top: 0;
}

@media (max-width: 980px) {
  .hero,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .hero-copy,
  .panel {
    padding: 22px;
  }
}
