:root {
  --bg: #edf1f6;
  --ink: #10243a;
  --muted: #4d6178;
  --panel: #ffffff;
  --border: #d3dee9;
  --accent: #0a6a78;
  --accent-soft: #d8eef2;
  --critical: #a1261f;
  --shadow: 0 24px 48px rgba(16, 36, 58, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(145deg, #f8fbfe 0%, #edf1f6 42%, #e7edf5 100%);
  color: var(--ink);
  font-family: "IBM Plex Sans", sans-serif;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 0%, rgba(10, 106, 120, 0.14), transparent 35%),
    radial-gradient(circle at 90% 20%, rgba(245, 183, 67, 0.16), transparent 28%);
}

.shell {
  position: relative;
  max-width: 980px;
  margin: 28px auto;
  padding: 0 18px 24px;
}

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

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-controls label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

select {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  min-width: 280px;
  max-width: 420px;
}

.eyebrow {
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0;
}

.title {
  margin: 2px 0 0;
  font-size: clamp(1.7rem, 4vw, 2.25rem);
  font-family: "Source Serif 4", serif;
}

.progress-pill {
  margin: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  color: var(--muted);
}

.panel {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
  animation: rise 260ms ease;
}

.intro-copy {
  margin: 0 0 16px;
  color: var(--muted);
}

.case-title {
  margin-top: 0;
  font-family: "Source Serif 4", serif;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
}

.details {
  margin: 0;
  border-radius: 14px;
  background: #f6f9fd;
  border: 1px solid #dce6f0;
  padding: 14px;
  line-height: 1.52;
  color: #24374b;
  white-space: pre-wrap;
}

.question-head h2 {
  margin: 6px 0 14px;
  font-family: "Source Serif 4", serif;
  font-size: clamp(1.2rem, 3vw, 1.55rem);
}

.section-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 600;
}

.input-label {
  display: inline-block;
  margin-bottom: 8px;
  font-weight: 600;
}

textarea {
  width: 100%;
  min-height: 170px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  line-height: 1.45;
}

textarea:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(10, 106, 120, 0.16);
}

.actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
}

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

button.secondary {
  background: #365f81;
}

button:hover {
  transform: translateY(-1px);
}

.answer,
.feedback {
  margin-top: 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 14px;
}

.answer {
  background: #f8fbff;
}

.feedback {
  background: #f9fcf7;
}

.feedback-grid,
.wrap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.feedback-tile,
.wrap-tile {
  border: 1px solid #d7e4d2;
  border-radius: 10px;
  padding: 10px;
  background: #ffffff;
}

.feedback-tile h4,
.wrap-tile h4 {
  margin: 0 0 6px;
  font-size: 0.92rem;
}

.feedback-tile p,
.wrap-tile p {
  margin: 0;
  line-height: 1.43;
  color: #26412b;
}

.feedback-tile ul,
.feedback-tile ol,
.wrap-tile ul,
.wrap-tile ol,
.next-step ul,
.next-step ol {
  margin: 0;
  padding-left: 18px;
}

.feedback-tile li,
.wrap-tile li,
.next-step li {
  margin: 0 0 4px;
  line-height: 1.43;
}

.feedback-tile p + p,
.wrap-tile p + p,
.next-step p + p {
  margin-top: 8px;
}

.feedback-tile.redline {
  border-color: #eccbc8;
  background: #fff8f8;
}

.feedback-tile.redline p {
  color: var(--critical);
}

.next-step {
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: #0b3f48;
}

.wrap-overall {
  margin-top: 0;
  font-size: 1.02rem;
}

.hidden {
  display: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .feedback-grid,
  .wrap-grid {
    grid-template-columns: 1fr;
  }

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

  select {
    min-width: 220px;
  }
}
