:root {
  color-scheme: light;
  --bg: #f4f7f5;
  --ink: #17211d;
  --muted: #5f6f68;
  --panel: #ffffff;
  --line: #d8e2dc;
  --accent: #0b7a75;
  --accent-dark: #075f5b;
  --amber: #d88c1d;
  --rose: #b44a63;
  --blue: #386fa4;
  --shadow: 0 20px 50px rgba(23, 33, 29, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(11, 122, 117, 0.12), transparent 34%),
    linear-gradient(300deg, rgba(216, 140, 29, 0.16), transparent 36%),
    var(--bg);
}

button,
input {
  font: inherit;
}

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

.workspace {
  display: grid;
  gap: 22px;
  min-height: calc(100vh - 64px);
  align-content: center;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 32px;
  align-items: center;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 34px 38px;
  overflow: hidden;
}

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

h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(2.4rem, 5vw, 4.25rem);
  line-height: 1.04;
  letter-spacing: 0;
  text-wrap: balance;
}

.lead {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.lab-visual {
  position: relative;
  min-height: 230px;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: transparent;
}

.lab-visual img {
  display: block;
  width: 100%;
  height: 230px;
  object-fit: cover;
  object-position: center;
}

.generator-form,
.result,
.chips {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.generator-form {
  padding: 22px;
}

label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
}

.level-field {
  margin-bottom: 14px;
}

.level-label {
  margin: 0 0 8px;
  font-weight: 700;
}

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

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

input {
  min-width: 0;
  width: 100%;
  border: 1px solid #b9c8c1;
  border-radius: 6px;
  padding: 14px 15px;
  color: var(--ink);
  background: #fff;
}

input:focus {
  outline: 3px solid rgba(11, 122, 117, 0.22);
  border-color: var(--accent);
}

button {
  border: 0;
  border-radius: 6px;
  padding: 12px 16px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

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

.level-option {
  color: var(--accent-dark);
  background: #eef6f3;
  border: 1px solid #c6ded8;
  padding: 11px 12px;
}

.level-option:hover {
  background: #dcefeb;
}

.level-option.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.level-option:focus {
  outline: 3px solid rgba(11, 122, 117, 0.22);
  outline-offset: 2px;
}

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

.form-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
}

.chips button {
  color: var(--accent-dark);
  background: #e5f2ef;
  border: 1px solid #c6ded8;
}

.chips button:hover {
  background: #d4ebe6;
}

.result {
  min-height: 260px;
  padding: 24px;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.proposal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.proposal h2 {
  margin: 0;
  font-size: 1.65rem;
  line-height: 1.2;
}

.tag {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 10px;
  color: #fff;
  background: var(--blue);
  font-size: 0.86rem;
  font-weight: 700;
}

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

.proposal-block {
  border-left: 4px solid var(--accent);
  padding-left: 14px;
}

.proposal-block:nth-child(2) {
  border-color: var(--amber);
}

.proposal-block:nth-child(3) {
  border-color: var(--rose);
}

.proposal-block h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.proposal-block p,
.proposal-block ul,
.proposal-block ol {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.proposal-block li + li {
  margin-top: 6px;
}

.ai-output {
  margin: 0;
  white-space: pre-wrap;
  color: var(--muted);
  line-height: 1.6;
}

.loading {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--accent-dark);
  font-weight: 700;
}

.loading::before {
  content: "";
  width: 11px;
  height: 11px;
  border: 2px solid rgba(11, 122, 117, 0.24);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding: 10px 0;
  }

  .workspace {
    min-height: calc(100vh - 20px);
    align-content: start;
  }

  .intro {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  h1 {
    font-size: clamp(2rem, 12vw, 3.2rem);
  }

  .lab-visual {
    min-height: 180px;
  }

  .lab-visual img {
    height: 180px;
  }

  .input-row,
  .level-options,
  .proposal-grid {
    grid-template-columns: 1fr;
  }

  .proposal-header {
    display: grid;
  }
}
