:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --surface: #fffdf8;
  --text: #191816;
  --muted: #615d55;
  --line: #d9d2c6;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --blue: #275d8c;
  --amber: #9a5b12;
  --danger: #a33a2d;
  --shadow: 0 14px 40px rgba(25, 24, 22, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100svh;
  padding: 20px;
}

.panel {
  width: min(1180px, 100%);
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.narrow {
  width: min(760px, 100%);
}

.header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}

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

h1 {
  font-size: 32px;
}

h2 {
  font-size: 23px;
}

h3 {
  font-size: 18px;
}

p {
  margin: 0 0 14px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 14px;
}

.stack {
  display: grid;
  gap: 16px;
}

.instructions {
  margin: 20px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ee;
}

.instructions ul {
  margin: 10px 0 0;
  padding-left: 22px;
}

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

.field label,
.question-label {
  font-weight: 700;
}

.text-input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  padding: 12px 13px;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}

.button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 16px;
  min-height: 48px;
  cursor: pointer;
  background: var(--teal);
  color: #ffffff;
  font-weight: 750;
}

.button:hover,
.button:focus-visible {
  background: var(--teal-dark);
}

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

.button.secondary:hover,
.button.secondary:focus-visible {
  background: #eee8dc;
}

.button[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}

.progress-wrap {
  display: grid;
  gap: 8px;
  min-width: 210px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7dfd1;
}

.progress div {
  height: 100%;
  width: 0;
  background: var(--teal);
}

.comparison-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.single-idea-card {
  display: grid;
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}

.single-idea-controls {
  width: min(760px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.idea-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.idea-card.a {
  border-top: 5px solid var(--amber);
}

.idea-card.b {
  border-top: 5px solid var(--blue);
}

.idea-label {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 13px;
}

.idea-title {
  font-size: 20px;
}

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

.idea-body h3,
.idea-body h4 {
  margin-top: 8px;
}

.idea-body h3 {
  font-size: 18px;
}

.idea-body h4 {
  font-size: 16px;
}

.idea-body p {
  margin-bottom: 0;
}

.idea-body ul,
.idea-body ol {
  margin: 0;
  padding-left: 22px;
}

.idea-body li + li {
  margin-top: 7px;
}

.idea-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95em;
  background: #f1ece2;
  border-radius: 4px;
  padding: 1px 4px;
}

.section-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.choice-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbf8f1;
}

.timer-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
  color: var(--teal-dark);
  font-weight: 800;
}

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

.summary-review {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-review > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

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

.choice {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  padding: 10px;
  text-align: center;
  font-weight: 700;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice.selected {
  border-color: var(--teal);
  background: #dff3ed;
  box-shadow: inset 0 0 0 2px var(--teal);
}

.review-form {
  display: grid;
  gap: 16px;
}

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

.rating-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  font-weight: 800;
}

.rating-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rating-choice.selected {
  border-color: var(--teal);
  background: #dff3ed;
  box-shadow: inset 0 0 0 2px var(--teal);
}

.rating-scale {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.error {
  margin-top: 12px;
  color: var(--danger);
  font-weight: 700;
}

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

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.completion-code {
  display: inline-flex;
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 8px;
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 800;
}

@media (max-width: 820px) {
  .app-shell {
    padding: 0;
  }

  .panel {
    min-height: 100svh;
    border: 0;
    border-radius: 0;
    padding: 18px;
    box-shadow: none;
  }

  .header {
    display: grid;
    gap: 16px;
  }

  h1 {
    font-size: 28px;
  }

  .comparison-grid,
  .summary-grid,
  .summary-review,
  .choice-grid,
  .rating-grid,
  .checkbox-grid,
  .radio-grid {
    grid-template-columns: 1fr;
  }

  .button-row {
    position: sticky;
    bottom: 0;
    margin: 22px -18px -18px;
    padding: 12px 18px;
    background: rgba(255, 253, 248, 0.96);
    border-top: 1px solid var(--line);
  }

  .button {
    flex: 1 1 140px;
  }
}
