:root {
  --bg: #f4efe7;
  --bg-accent: #e7f5ee;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-strong: #ffffff;
  --ink: #15332a;
  --ink-soft: #4f635c;
  --line: rgba(21, 51, 42, 0.12);
  --primary: #0f8a5f;
  --primary-dark: #0a6646;
  --warm: #ef7d57;
  --gold: #ddb35f;
  --shadow: 0 20px 70px rgba(26, 46, 39, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(221, 179, 95, 0.2), transparent 22%),
    radial-gradient(circle at top right, rgba(15, 138, 95, 0.12), transparent 28%),
    linear-gradient(180deg, #f8f4ee 0%, #eff7f1 100%);
  min-height: 100vh;
}

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

.page {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

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

.hero {
  overflow: hidden;
}

.hero-top {
  padding: 56px 48px 40px;
  background:
    linear-gradient(135deg, rgba(10, 102, 70, 0.98), rgba(17, 52, 43, 0.92)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
  color: white;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
}

.hero h1 {
  font-family: "DM Serif Display", serif;
  font-size: clamp(2.4rem, 4vw, 4.6rem);
  line-height: 0.98;
  max-width: 720px;
  margin-top: 22px;
}

.hero p {
  max-width: 740px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.02rem;
  line-height: 1.7;
  margin: 18px 0 0;
}

.hero-actions,
.row,
.tab-row,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  padding: 28px 32px 32px;
}

.btn {
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  padding: 14px 18px;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: white;
  font-weight: 800;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(239, 125, 87, 0.14);
  color: #8b482f;
  font-weight: 700;
  font-size: 0.84rem;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-two {
  grid-template-columns: 1.2fr 0.8fr;
}

.panel {
  padding: 28px;
}

.panel-header {
  margin-bottom: 20px;
}

.panel-title {
  font-size: 1.35rem;
  font-weight: 800;
}

.panel-subtitle {
  color: var(--ink-soft);
  margin-top: 8px;
  line-height: 1.6;
}

.progress {
  height: 10px;
  background: rgba(15, 138, 95, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--warm), var(--primary));
  border-radius: inherit;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

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

.field input,
.field textarea,
.field select,
.chat-input,
.date-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  outline: none;
}

.field textarea,
.chat-input,
.planner-script {
  min-height: 120px;
  resize: vertical;
}

.workspace {
  padding: 20px;
}

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

.workspace-title {
  font-size: 1.2rem;
  font-weight: 800;
}

.tab-row {
  margin-bottom: 18px;
}

.tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}

.tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.card {
  padding: 22px;
}

.blueprint-output,
.chat-box,
.script-preview,
.analysis-box {
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
}

.blueprint-output,
.script-preview,
.analysis-box {
  white-space: pre-wrap;
  line-height: 1.7;
}

.chat-box {
  min-height: 240px;
  max-height: 420px;
  overflow: auto;
}

.message {
  padding: 14px 16px;
  border-radius: 18px;
  margin-bottom: 12px;
  white-space: pre-wrap;
  line-height: 1.6;
}

.message.user {
  background: rgba(15, 138, 95, 0.1);
}

.message.ai {
  background: rgba(21, 51, 42, 0.06);
}

.chip-list,
.options-list,
.history-list {
  display: grid;
  gap: 12px;
}

.chip,
.option,
.history-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.86);
}

.chip {
  cursor: pointer;
}

.chip.active {
  border-color: var(--primary);
  background: rgba(15, 138, 95, 0.1);
}

.option {
  cursor: pointer;
}

.mini-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  font-weight: 800;
  margin-bottom: 8px;
}

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

.score {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

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

.status {
  margin-top: 12px;
  color: var(--ink-soft);
}

.loading {
  opacity: 0.72;
  pointer-events: none;
}

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

  .hero-top,
  .hero-actions,
  .panel,
  .workspace {
    padding-left: 22px;
    padding-right: 22px;
  }

  .workspace-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
