:root {
  --accent: #115e59;
  --accent-soft: #e6f4f3;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --danger: #b91c1c;
  --bg: #f8fafc;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; background: var(--bg); color: var(--text); }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; color: var(--accent); text-decoration: none; }
.container { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; flex: 1; width: 100%; }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; margin-bottom: 16px;
}
h1 { font-size: 1.5rem; margin: 0 0 8px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 0.9rem; }
label { display: block; font-size: 0.85rem; font-weight: 600; margin: 12px 0 4px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font: inherit;
}
textarea { min-height: 120px; resize: vertical; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; font-weight: 600; cursor: pointer; font: inherit;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.alert { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 0.9rem; }
.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-info { background: var(--accent-soft); color: var(--accent); }
.status { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; }
.status-queued, .status-generating, .status-pdf_queued { background: #fef3c7; color: #92400e; }
.status-ready_for_edit { background: #dbeafe; color: #1e40af; }
.status-pdf_ready { background: #d1fae5; color: #065f46; }
.status-failed { background: #fee2e2; color: var(--danger); }
.section-list { list-style: none; padding: 0; margin: 0; }
.section-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.section-list li.locked { opacity: 0.7; }
.emsal-item { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.preview-frame {
  width: 100%; height: min(70vh, 720px); border: 1px solid var(--border);
  border-radius: 8px; background: #fff;
}
.steps { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.step { padding: 6px 10px; border-radius: 6px; background: #e2e8f0; font-size: 0.8rem; }
.step.active { background: var(--accent); color: #fff; }
.report-list { padding: 0; margin: 20px 0 0; list-style: none; }
.empty-state { margin-top: 20px; }
.empty-state p { margin: 0 0 8px; }
