:root {
  color-scheme: light;
  --page: #f7f4ee;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --ink: #1d211f;
  --muted: #666f6a;
  --soft: #858d88;
  --line: #d8d2c6;
  --line-strong: #bdb5a8;
  --field: #fffefa;
  --blue: #1e5d74;
  --green: #3f6b52;
  --amber: #8a5b13;
  --danger: #9d3328;
  --shadow: 0 18px 42px rgba(35, 29, 18, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
  color: var(--ink);
}

body {
  min-height: 100%;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus,
textarea:focus {
  outline: 3px solid rgba(30, 93, 116, 0.26);
  outline-offset: 2px;
}

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

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  column-gap: 26px;
  row-gap: 14px;
  align-items: start;
}

.editor-column,
.details-column,
.mutation-column {
  min-width: 0;
}

.editor-column,
.details-column {
  grid-column: 1 / 2;
}

.mutation-column {
  grid-column: 2 / 3;
  grid-row: 1 / span 2;
}

.field-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 680;
  line-height: 1.2;
}

.field-hint {
  color: var(--soft);
  font-size: 13px;
}

.input,
.textarea,
.card-textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.input {
  min-height: 58px;
  padding: 13px 14px;
  font-size: 17px;
  line-height: 1.35;
  resize: vertical;
}

.textarea {
  min-height: 96px;
  resize: vertical;
  padding: 13px 14px;
  font-size: 16px;
  line-height: 1.48;
}

.seed-input {
  min-height: 68px;
  font-size: 18px;
}

.separator {
  height: 1px;
  background: var(--line);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--ink);
  color: #fffefa;
  font-size: 15px;
  font-weight: 680;
  line-height: 1;
  white-space: nowrap;
}

.button svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.button.secondary {
  border: 1px solid var(--line-strong);
  background: var(--surface-strong);
  color: var(--ink);
}

.button.ghost {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--danger);
}

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

h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 720;
  line-height: 1.2;
}

.section-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.card-count {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

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

.mutation-card {
  display: grid;
  gap: 10px;
  min-height: 164px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.mutation-card[data-selected="true"] {
  border-color: rgba(30, 93, 116, 0.55);
  box-shadow: 0 0 0 3px rgba(30, 93, 116, 0.1);
}

.card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.lens-name {
  margin: 0;
  color: var(--blue);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.2;
}

.lens-prompt {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.select-card {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface-strong);
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.select-card[data-state="on"] {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.card-textarea {
  min-height: 82px;
  resize: vertical;
  padding: 11px 12px;
  font-size: 15px;
  line-height: 1.45;
}

.toast-viewport {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: grid;
  width: min(360px, calc(100vw - 36px));
  margin: 0;
  padding: 0;
  list-style: none;
}

.toast-root {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
}

.toast-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

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

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

  .editor-column,
  .details-column,
  .mutation-column {
    grid-column: 1 / 2;
    grid-row: auto;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 18px;
  }

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

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

  .mutation-card {
    min-height: 176px;
  }

  .card-textarea {
    min-height: 96px;
  }

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