:root {
  --bg: #f4f7f2;
  --surface: #ffffff;
  --surface-alt: #eef3ed;
  --text: #17211b;
  --muted: #607168;
  --line: #cfd9d1;
  --accent: #146c5f;
  --accent-strong: #0b4f46;
  --gold: #b27722;
  --rose: #b14c53;
  --shadow: rgba(33, 45, 38, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(120deg, rgba(20, 108, 95, 0.08), transparent 36%),
    linear-gradient(145deg, var(--bg), #fbf6ed 58%, #eef4f7);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
textarea,
select {
  font: inherit;
}

button,
select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

button {
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  border-color: var(--accent);
}

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

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow,
.label {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 720px;
  font-size: clamp(2.25rem, 7vw, 4.7rem);
  line-height: 0.95;
}

h2 {
  margin-top: 4px;
  font-size: 1.35rem;
  line-height: 1.1;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.4fr);
  gap: 14px;
  align-items: start;
}

.input-panel,
.output-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 54px var(--shadow);
}

.input-panel {
  position: sticky;
  top: 16px;
  padding: 18px;
}

.output-panel {
  min-height: 640px;
  padding: 18px;
}

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

.stat {
  display: inline-flex;
  min-width: 86px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

textarea {
  display: block;
  width: 100%;
  min-height: 380px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: var(--surface-alt);
  color: var(--text);
  line-height: 1.5;
  outline: none;
  resize: vertical;
}

textarea:focus,
select:focus,
button:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 108, 95, 0.18);
  outline: none;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 800;
  text-transform: uppercase;
}

select {
  width: 100%;
  min-width: 0;
  padding: 0 10px;
}

.primary-button {
  width: 100%;
  margin-top: 12px;
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

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

.empty-state {
  display: grid;
  min-height: 520px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(238, 243, 237, 0.72);
  color: var(--muted);
  text-align: center;
}

.empty-state p {
  width: min(310px, 90%);
  line-height: 1.45;
}

.ideas-list {
  display: grid;
  gap: 12px;
}

.idea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.idea-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(20, 108, 95, 0.08), rgba(178, 119, 34, 0.08));
}

.idea-kicker {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.idea-title {
  margin-top: 4px;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.25;
}

.score {
  display: grid;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.idea-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.field {
  display: grid;
  gap: 5px;
}

.field span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.field p {
  overflow-wrap: anywhere;
  line-height: 1.46;
}

.post-draft {
  padding: 12px;
  border-left: 4px solid var(--rose);
  border-radius: 8px;
  background: #fff8f3;
  white-space: pre-wrap;
}

.idea-actions {
  display: flex;
  gap: 8px;
  padding: 0 14px 14px;
}

.idea-actions button {
  flex: 1;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 20px, 620px);
    padding: 22px 0;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace,
  .controls {
    grid-template-columns: 1fr;
  }

  .input-panel {
    position: static;
  }

  .output-panel {
    min-height: 0;
  }

  textarea {
    min-height: 300px;
  }
}
