:root {
  color-scheme: light;
  --bg: #edf3f1;
  --surface: #ffffff;
  --surface-strong: #f7faf9;
  --ink: #18211f;
  --muted: #66736f;
  --line: #d9e4e1;
  --accent: #18635f;
  --accent-strong: #0f4744;
  --gold: #d49a2d;
  --rose: #c95c7a;
  --shadow: 0 18px 55px rgba(20, 42, 39, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(212, 154, 45, 0.16), transparent 28rem),
    radial-gradient(circle at 92% 18%, rgba(201, 92, 122, 0.14), transparent 24rem),
    var(--bg);
  color: var(--ink);
}

button,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

.workspace {
  display: grid;
  gap: 18px;
}

.topbar,
.hero-panel,
.writer-form,
.draft-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(217, 228, 225, 0.9);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.02;
}

h2 {
  margin-bottom: 0;
  line-height: 1.12;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--surface-strong);
  font-size: 0.9rem;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2baa6f;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
  min-height: 220px;
  padding: 22px;
  overflow: hidden;
  border-radius: 8px;
}

.hero-copy {
  align-self: center;
}

.hero-copy h2 {
  max-width: 620px;
  font-size: clamp(1.55rem, 4vw, 2.75rem);
}

.hero-copy p {
  max-width: 560px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.visual-card {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 18px;
  min-height: 180px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(24, 99, 95, 0.96), rgba(15, 71, 68, 0.9)),
    #18635f;
}

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.metric-row span {
  color: var(--muted);
  font-weight: 800;
}

.metric-row strong {
  color: var(--accent-strong);
  font-size: 1.25rem;
}

.writer-form,
.draft-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 8px;
}

.field-group {
  display: grid;
  gap: 8px;
}

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

label,
.section-label {
  color: var(--ink);
  font-weight: 800;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  outline: none;
}

select {
  min-height: 48px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 92px;
  padding: 12px;
  line-height: 1.45;
}

select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(24, 99, 95, 0.14);
}

.tone-section {
  display: grid;
  gap: 10px;
}

.tone-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.tone-grid label {
  min-width: 0;
}

.tone-grid input {
  position: absolute;
  opacity: 0;
}

.tone-grid span {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.tone-grid input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.generate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.generate-button:active {
  transform: translateY(1px);
}

.generate-button svg,
.copy-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

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

.copy-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--accent);
  cursor: pointer;
}

#draftTitle {
  margin: 0;
  font-size: 1.2rem;
}

#draftBody {
  white-space: pre-wrap;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .tone-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero-panel,
  .writer-form,
  .draft-panel,
  .topbar {
    padding: 14px;
  }
}
