:root {
  color-scheme: light;
  --bg: #f6f1e7;
  --bg-strong: #ece2d2;
  --panel: rgba(255, 250, 243, 0.9);
  --panel-strong: #fffaf3;
  --ink: #1f2a2e;
  --muted: #5f6c72;
  --line: rgba(54, 79, 84, 0.12);
  --accent: #0f766e;
  --accent-strong: #0a5e57;
  --accent-soft: #d7efea;
  --warm: #c9784b;
  --warm-soft: #f4dfcf;
  --danger: #a14a3b;
  --shadow: 0 20px 50px rgba(68, 54, 38, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(201, 120, 75, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.14), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-strong) 100%);
  min-height: 100vh;
}

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

button {
  border: 0;
}

.shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  align-items: start;
}

.panel {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 22px;
  animation: panel-rise 420ms ease both;
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.42), transparent 45%);
  pointer-events: none;
}

.panel > * {
  position: relative;
  z-index: 1;
}

.panel-hero {
  margin-bottom: 18px;
  padding: 28px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.72), transparent 42%),
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(201, 120, 75, 0.14)),
    var(--panel-strong);
}

.hero {
  display: grid;
  gap: 18px;
}

.hero h1,
.panel h2,
.interview-box h3,
.result-card h3,
.report-decision strong {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(2.3rem, 4vw, 4.1rem);
  max-width: 11ch;
  line-height: 0.96;
}

.hero-text,
.section-note,
.helper-card p,
.empty-state,
.status-banner,
.detail-list,
.debug-panel,
.field span,
.metric-label,
.section-kicker,
.eyebrow {
  color: var(--muted);
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-text,
.section-note {
  margin: 0;
  max-width: 62ch;
  line-height: 1.7;
}

.step-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.step-pill {
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(15, 118, 110, 0.12);
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}

.step-pill[data-state="active"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: rgba(15, 118, 110, 0.3);
}

.step-pill[data-state="complete"] {
  background: rgba(15, 118, 110, 0.16);
  color: var(--accent-strong);
}

.panel-form {
  grid-row: span 2;
}

.panel-status {
  grid-column: 1 / -1;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-heading.compact {
  margin-bottom: 14px;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.92rem;
  font-weight: 700;
}

.field-wide {
  grid-column: 1 / -1;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(31, 42, 46, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  padding: 13px 15px;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

textarea {
  resize: vertical;
  min-height: 112px;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible,
summary:focus-visible {
  outline: none;
  border-color: rgba(15, 118, 110, 0.42);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, opacity 180ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #f8fffd;
}

.secondary-button {
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-strong);
}

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

button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.helper-card,
.metric-card,
.result-card,
.interview-entry,
.report-grid article,
.empty-state,
.status-banner {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(31, 42, 46, 0.08);
}

.helper-card {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.85));
  padding: 14px 16px;
}

.helper-card strong {
  display: block;
  margin-bottom: 6px;
}

.helper-card p {
  margin: 0;
  line-height: 1.6;
}

.status-badge,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-badge {
  background: rgba(31, 42, 46, 0.06);
  color: var(--muted);
}

.status-badge[data-state="draft"],
.status-badge[data-state="idle"] {
  background: rgba(95, 108, 114, 0.14);
}

.status-badge[data-state="research_complete"],
.status-badge[data-state="persona_ready"] {
  background: rgba(15, 118, 110, 0.14);
  color: var(--accent-strong);
}

.status-badge[data-state="warning"] {
  background: rgba(201, 120, 75, 0.14);
  color: #8d4d29;
}

.summary-grid,
.report-grid {
  display: grid;
  gap: 12px;
}

.summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-grid div,
.report-grid article {
  background: rgba(255, 255, 255, 0.72);
  padding: 14px 16px;
}

.summary-grid dt {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.summary-grid dd {
  margin: 0;
  line-height: 1.55;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card {
  padding: 15px 16px;
  background: rgba(255, 255, 255, 0.74);
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.28rem;
}

.result-stack {
  display: grid;
  gap: 12px;
}

.result-card {
  background: rgba(255, 255, 255, 0.78);
  padding: 16px;
}

.result-card h3 {
  font-size: 1.18rem;
  margin-bottom: 8px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.chip {
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-strong);
}

.chip.warm {
  background: rgba(201, 120, 75, 0.14);
  color: #8d4d29;
}

.chip.neutral {
  background: rgba(31, 42, 46, 0.08);
  color: var(--muted);
}

.card-copy,
.detail-list,
.quote-block,
.report-placeholder {
  margin: 0;
  line-height: 1.7;
}

.quote-block {
  margin-top: 10px;
  padding: 12px 14px;
  background: rgba(15, 118, 110, 0.06);
  border-left: 3px solid rgba(15, 118, 110, 0.4);
  border-radius: 0 14px 14px 0;
  color: var(--muted);
}

.card-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.card-link:hover {
  text-decoration: underline;
}

.interview-box {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(31, 42, 46, 0.08);
  display: grid;
  gap: 14px;
}

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

.interview-entry {
  background: rgba(255, 255, 255, 0.8);
  padding: 14px 16px;
}

.interview-entry strong {
  display: block;
  margin-bottom: 8px;
}

.report-decision {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
  border-radius: var(--radius-lg);
  background: rgba(15, 118, 110, 0.08);
}

.report-decision[data-tone="go"] {
  background: rgba(15, 118, 110, 0.12);
}

.report-decision[data-tone="refine"] {
  background: rgba(201, 120, 75, 0.14);
}

.report-decision[data-tone="no-go"] {
  background: rgba(161, 74, 59, 0.14);
}

.report-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-grid h3 {
  font-size: 1rem;
  margin-bottom: 10px;
}

.detail-list {
  padding-left: 18px;
}

.detail-list li + li {
  margin-top: 8px;
}

.debug-panel {
  margin-top: 14px;
  border-top: 1px dashed rgba(31, 42, 46, 0.14);
  padding-top: 12px;
}

.debug-panel summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
}

.debug-panel pre {
  margin: 12px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 14px;
  background: rgba(31, 42, 46, 0.04);
  border-radius: var(--radius-md);
  border: 1px solid rgba(31, 42, 46, 0.08);
}

.empty-state,
.status-banner,
.report-placeholder {
  padding: 18px;
  background: rgba(255, 255, 255, 0.62);
  line-height: 1.7;
}

.status-banner[data-tone="success"] {
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-strong);
}

.status-banner[data-tone="warning"] {
  background: rgba(201, 120, 75, 0.12);
  color: #8d4d29;
}

.status-banner[data-tone="danger"] {
  background: rgba(161, 74, 59, 0.12);
  color: var(--danger);
}

@keyframes panel-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .panel-form {
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 18px, 1200px);
    padding: 18px 0 28px;
  }

  .panel,
  .panel-hero {
    padding: 18px;
    border-radius: 22px;
  }

  .brief-form,
  .summary-grid,
  .metric-row,
  .report-grid,
  .step-track {
    grid-template-columns: 1fr;
  }

  .panel-heading,
  .interview-head,
  .report-decision {
    flex-direction: column;
    align-items: stretch;
  }
}
