:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --fg: #221f1a;
  --muted: #5b554c;
  --line: #d8d0c3;
  --blue: #2f6f7c;
  --blue-dark: #245b65;
  --danger: #a33d2d;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(135deg, #f7f4ee 0%, #edf3f1 52%, #f4efe8 100%);
  color: var(--fg);
  font-family: Arial, Helvetica, sans-serif;
}

button,
textarea {
  font: inherit;
}

main {
  min-height: 100vh;
  padding: 32px 20px;
}

.shell {
  min-height: calc(100vh - 64px);
  width: min(100%, 960px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
}

.header {
  display: grid;
  gap: 12px;
}

.eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 8vw, 72px);
  line-height: 1.08;
  font-weight: 900;
}

.intro {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

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

@media (min-width: 900px) {
  .grid {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.85fr);
  }
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(34, 31, 26, 0.08);
}

.input-panel {
  background: rgba(255, 255, 255, 0.82);
}

label {
  display: block;
  margin-bottom: 12px;
  color: #332d25;
  font-size: 14px;
  font-weight: 700;
}

textarea {
  min-height: 176px;
  width: 100%;
  resize: vertical;
  border: 1px solid #cfc6b8;
  border-radius: 6px;
  background: #fffdf8;
  padding: 16px;
  line-height: 1.75;
  outline: none;
}

textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 111, 124, 0.15);
}

.controls {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #6c665d;
  font-size: 14px;
}

.controls .too-long {
  color: var(--danger);
  font-weight: 700;
}

button {
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.15s ease, opacity 0.15s ease;
}

#generate {
  border: 0;
  background: var(--blue);
  color: white;
  padding: 10px 20px;
}

#generate:hover:not(:disabled) {
  background: var(--blue-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.error {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 14px;
}

.output-panel {
  background: #221f1a;
  color: #fffaf0;
}

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

h2 {
  margin: 0;
  font-size: 14px;
}

#copy {
  border: 1px solid rgba(255, 250, 240, 0.3);
  background: transparent;
  color: #fffaf0;
  padding: 8px 12px;
  font-size: 14px;
}

#copy:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.result {
  min-height: 288px;
  white-space: pre-wrap;
  border: 1px solid rgba(255, 250, 240, 0.15);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.12);
  padding: 16px;
  color: #fffaf0;
  font-size: 15px;
  line-height: 2;
}
