:root {
  --bg: #f8fcf6;
  --bg-accent: #eef7ea;
  --card: rgba(255, 255, 255, 0.88);
  --border: rgba(133, 173, 133, 0.22);
  --primary: #6f9d75;
  --primary-strong: #4f7f57;
  --text: #223127;
  --muted: #69806e;
  --shadow: 0 24px 60px rgba(92, 126, 96, 0.14);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(180, 219, 178, 0.3), transparent 28%),
    radial-gradient(circle at bottom right, rgba(196, 228, 194, 0.35), transparent 32%),
    linear-gradient(180deg, #fbfef9 0%, var(--bg) 100%);
}

.page-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

.ambient {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.45;
  background: radial-gradient(circle, rgba(161, 209, 161, 0.5), rgba(161, 209, 161, 0));
}

.ambient-left {
  top: -80px;
  left: -60px;
}

.ambient-right {
  right: -80px;
  bottom: -90px;
}

.card {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  padding: 32px;
  background: var(--card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg-accent);
  color: var(--primary-strong);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  margin: 18px 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

.subtitle {
  margin: 0 0 24px;
  max-width: 56ch;
  color: var(--muted);
  line-height: 1.65;
}

.chat-form {
  display: grid;
  gap: 16px;
}

textarea,
.response-content {
  width: 100%;
  border-radius: 20px;
  border: 1px solid rgba(116, 158, 117, 0.2);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

textarea {
  resize: vertical;
  min-height: 150px;
  padding: 18px 18px;
  font: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea:focus {
  border-color: rgba(90, 138, 95, 0.55);
  box-shadow: 0 0 0 4px rgba(156, 201, 159, 0.18);
}

textarea::placeholder {
  color: #92a395;
}

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

.action-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  font: inherit;
  font-weight: 600;
  color: white;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 12px 24px rgba(79, 127, 87, 0.24);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(79, 127, 87, 0.28);
}

button:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.button-secondary {
  color: var(--primary-strong);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(111, 157, 117, 0.25);
  box-shadow: 0 10px 20px rgba(79, 127, 87, 0.1);
}

.button-secondary:hover {
  box-shadow: 0 12px 24px rgba(79, 127, 87, 0.14);
}

.status {
  font-size: 0.95rem;
  color: var(--muted);
}

.response-panel {
  margin-top: 26px;
  padding: 22px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(241, 249, 239, 0.8), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(111, 157, 117, 0.18);
}

.response-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.response-header h2 {
  margin: 0;
  font-size: 1rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9ed39d;
  box-shadow: 0 0 0 6px rgba(158, 211, 157, 0.16);
}

.response-content {
  min-height: 140px;
  padding: 18px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.muted {
  color: #7a8f7d;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .card {
    padding: 22px;
    border-radius: 20px;
  }

  .actions {
    align-items: stretch;
  }

  .action-buttons {
    width: 100%;
  }

  button {
    width: 100%;
  }

  .status {
    width: 100%;
  }
}
