:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --text: #202527;
  --muted: #657072;
  --line: #d8dedb;
  --accent: #176b5c;
  --accent-strong: #0f4d42;
  --error: #9f2f2f;
  --shadow: 0 24px 70px rgba(25, 38, 35, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.shell {
  width: min(100%, 820px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 72px) 18px;
  display: grid;
  align-items: center;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(22px, 5vw, 44px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  margin: 0 0 28px;
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

form {
  display: grid;
  gap: 12px;
}

label {
  font-weight: 650;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  font: inherit;
  color: var(--text);
  background: #fbfcfb;
}

textarea:focus {
  outline: 3px solid rgba(23, 107, 92, 0.18);
  border-color: var(--accent);
}

.actions {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

button {
  min-width: 112px;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

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

#status {
  color: var(--muted);
  min-height: 1.4em;
}

.result {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.answer-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
}

.answer-label,
dt {
  color: var(--muted);
}

#answer {
  font-size: clamp(2.2rem, 8vw, 5rem);
  line-height: 1;
  letter-spacing: 0;
}

dl {
  margin: 18px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

dt {
  font-size: 0.9rem;
}

dd {
  margin: 4px 0 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.error {
  margin: 18px 0 0;
  color: var(--error);
}

@media (max-width: 540px) {
  .shell {
    align-items: start;
  }

  .answer-row,
  dl {
    display: grid;
    grid-template-columns: 1fr;
  }
}
