:root {
  --ink: #18212f;
  --muted: #667085;
  --soft: #f3f6f8;
  --paper: #ffffff;
  --line: #dce3ea;
  --teal: #0f766e;
  --teal-2: #12a594;
  --amber: #d97706;
  --red: #b42318;
  --blue: #2563eb;
  --violet: #6d28d9;
  --shadow: 0 18px 50px rgba(24, 33, 47, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #f7faf9 0%, #eef4f3 46%, #f8f7f2 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.08;
}

h1 {
  font-size: clamp(34px, 4.5vw, 58px);
}

h2 {
  font-size: 20px;
}

p {
  margin: 0;
  color: var(--muted);
}

.top-actions,
.button-row,
.output-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 800;
  color: var(--ink);
  background: var(--paper);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(24, 33, 47, 0.12);
}

.button.primary {
  background: var(--teal);
  color: #fff;
}

.button.secondary {
  background: var(--amber);
  color: #fff;
}

.button.subtle {
  background: #e8f4f1;
  border-color: #bfddd6;
  color: #075e54;
}

.button.ghost {
  background: transparent;
  border-color: var(--line);
}

.button.danger {
  border-color: #f2c4bd;
  color: var(--red);
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

.intro-copy,
.stat-strip,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.intro-copy {
  padding: 22px;
}

.intro-copy h2 {
  font-size: clamp(28px, 4vw, 44px);
  max-width: 850px;
}

.intro-copy p {
  max-width: 820px;
  margin-top: 10px;
  font-size: 17px;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  padding: 18px;
  gap: 12px;
}

.stat-strip div {
  min-height: 94px;
  display: grid;
  align-content: center;
  justify-items: start;
  border-left: 4px solid var(--teal-2);
  padding-left: 14px;
  background: #f8fbfb;
  border-radius: 6px;
}

.stat-strip div:nth-child(2) {
  border-color: var(--amber);
}

.stat-strip div:nth-child(3) {
  border-color: var(--blue);
}

.stat-strip strong {
  display: block;
  font-size: 34px;
  line-height: 1;
}

.stat-strip span {
  color: var(--muted);
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.panel {
  padding: 20px;
}

.controls {
  position: sticky;
  top: 12px;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  max-width: 240px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef7f5;
  color: #0f5f57;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

label {
  display: block;
  margin: 14px 0 6px;
  font-size: 13px;
  color: #2f3b4a;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd8e3;
  border-radius: var(--radius);
  background: #fbfcfd;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

textarea {
  resize: vertical;
}

.hint {
  margin-top: 6px;
  font-size: 12px;
}

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

.option-toggle {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin: 16px 0 4px;
  border: 1px solid #bfded7;
  border-radius: var(--radius);
  padding: 13px;
  background: #f0faf7;
  cursor: pointer;
}

.option-toggle {
  margin-top: 10px;
  background: #f7fbff;
  border-color: #c9d9ef;
}

.option-toggle input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--teal);
}

.option-toggle strong {
  display: block;
  color: #12352f;
  font-size: 14px;
}

.option-toggle small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.recommendations {
  margin-top: 16px;
  border: 1px solid #d7e6e1;
  border-radius: var(--radius);
  background: #fbfefd;
  padding: 13px;
}

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

.recommendation-head h3 {
  margin: 0;
  font-size: 14px;
}

.recommendation-head span {
  max-width: 180px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.recommendation-card {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 10px;
  text-align: left;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.recommendation-card:hover,
.recommendation-card.selected {
  border-color: var(--teal);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.12);
  transform: translateY(-1px);
}

.recommendation-card.selected {
  background: #f0faf7;
}

.recommendation-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.recommendation-card strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.25;
}

.accordion {
  width: 100%;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #f8fafc;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 900;
}

.accordion span:last-child {
  color: var(--teal);
  font-size: 12px;
  text-transform: uppercase;
}

.advanced {
  display: none;
  padding-top: 2px;
}

.advanced.open {
  display: block;
}

.button-row {
  margin-top: 18px;
}

.clear-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.mini-clear {
  border: 0;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 0;
}

.mini-clear:hover {
  text-decoration: underline;
}

.output {
  min-height: 760px;
}

.prompt-output {
  min-height: 650px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  color: #152033;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.035), transparent 18%),
    #fff;
}

.output-actions {
  margin-top: 12px;
  justify-content: flex-end;
}

.variations {
  margin-top: 12px;
  border: 1px solid #dde5ef;
  border-radius: var(--radius);
  background: #fbfcff;
  padding: 13px;
}

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

.variation-head h3 {
  margin: 0;
  font-size: 14px;
}

.variation-head span {
  max-width: 220px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.variation-card {
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 10px;
  text-align: left;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.variation-card:hover,
.variation-card.selected {
  border-color: var(--blue);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.variation-card.selected {
  background: #f2f6ff;
}

.variation-card strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
}

.variation-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

@media (max-width: 1100px) {
  .intro-grid,
  .workspace {
    grid-template-columns: 1fr;
  }

  .controls {
    position: static;
  }

  .output {
    min-height: auto;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 20px, 1440px);
    padding-top: 12px;
  }

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

  .top-actions,
  .button-row,
  .output-actions,
  .button {
    width: 100%;
  }

  .button {
    justify-content: center;
  }

  .stat-strip,
  .two-col,
  .recommendation-grid,
  .variation-grid {
    grid-template-columns: 1fr;
  }

  .intro-copy,
  .panel {
    padding: 16px;
  }

  .prompt-output {
    min-height: 500px;
  }
}
