:root {
  color-scheme: light;
  --bg: #f5f4f0;
  --surface: #ffffff;
  --text: #151817;
  --muted: #6c7470;
  --border: #e7e2d8;
  --primary: #0e5a50;
  --primary-dark: #0a4039;
  --focus: #dbeae5;
  --shadow: 0 24px 80px rgba(27, 34, 31, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(14, 90, 80, 0.08), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
}

.page-shell {
  width: min(100% - 28px, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px 0 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero {
  margin: 0 auto 24px;
  text-align: center;
}

.brand {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 800;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.25rem, 7vw, 4.25rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0;
}

.lede {
  width: min(100%, 520px);
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(1.02rem, 2.6vw, 1.2rem);
}

.app-card,
.result-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.app-card {
  padding: 22px;
}

.result-card {
  margin-top: 18px;
  padding: 22px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.result-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

label {
  display: block;
  margin-bottom: 10px;
  font-weight: 800;
  font-size: 1.02rem;
}

textarea {
  display: block;
  width: 100%;
  min-height: 180px;
  max-height: 360px;
  resize: vertical;
  padding: 17px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fffefd;
  color: var(--text);
  font: inherit;
  font-size: 18px;
  line-height: 1.75;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea::placeholder {
  color: #8c928f;
}

textarea:focus {
  outline: 0;
  border-color: rgba(14, 90, 80, 0.55);
  box-shadow: 0 0 0 4px var(--focus);
  background: #ffffff;
}

.field-note,
.muted {
  color: var(--muted);
}

.field-note {
  margin: 10px 2px 16px;
  font-size: 0.98rem;
}

button {
  display: inline-flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 18px;
  padding: 12px 18px;
  background: var(--primary);
  color: #ffffff;
  font: inherit;
  font-size: 1.04rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, opacity 160ms ease;
}

button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

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

.button-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

button.is-loading .button-spinner {
  display: inline-block;
}

.result-card h2 {
  margin-bottom: 8px;
  font-size: 1.35rem;
  line-height: 1.35;
}

.result-card .muted {
  margin-bottom: 14px;
}

.prompt-output {
  min-height: 260px;
  max-height: 58vh;
  background: #ffffff;
  direction: ltr;
  text-align: left;
}

.copy-button {
  margin-top: 14px;
}

.message-card {
  text-align: center;
}

.message-card .message-text {
  margin-bottom: 0;
  color: var(--primary-dark);
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 50%;
  bottom: 22px;
  z-index: 10;
  transform: translate(50%, 10px);
  opacity: 0;
  padding: 11px 16px;
  border-radius: 999px;
  background: #13231f;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 14px 40px rgba(19, 35, 31, 0.18);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(50%, 0);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 760px) {
  .page-shell {
    padding-top: 52px;
    padding-bottom: 56px;
  }

  .app-card,
  .result-card {
    padding: 30px;
  }
}

@media (max-width: 520px) {
  .page-shell {
    width: min(100% - 22px, 760px);
    min-height: auto;
    padding: 30px 0 38px;
    justify-content: flex-start;
  }

  .hero {
    margin-bottom: 20px;
  }

  .app-card,
  .result-card {
    padding: 18px;
    border-radius: 22px;
  }

  textarea {
    min-height: 170px;
    padding: 15px;
  }

  .prompt-output {
    min-height: 240px;
  }
}
