:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --ink: #111816;
  --muted: #69726e;
  --line: #dfe3dc;
  --soft: #eef3ef;
  --accent: #0b6f5f;
  --accent-strong: #092f2a;
  --danger: #b42318;
  --shadow: 0 18px 48px rgba(17, 24, 22, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  background:
    linear-gradient(180deg, rgba(238, 243, 239, 0.85), rgba(246, 247, 244, 0.95)),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

.shell {
  margin: 0 auto;
  max-width: 860px;
  min-height: 100vh;
  padding: 28px 18px;
}

.topbar {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 auto 14px;
  max-width: 780px;
}

.eyebrow {
  color: var(--accent);
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(28px, 6vw, 52px);
  letter-spacing: 0;
  line-height: 1.02;
  margin: 0;
}

.progress {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  display: flex;
  flex: 0 0 auto;
  font-weight: 850;
  justify-content: center;
  min-height: 50px;
  min-width: 64px;
  padding: 0 14px;
}

.bar {
  background: rgba(17, 24, 22, 0.08);
  border-radius: 999px;
  height: 8px;
  margin: 0 auto 18px;
  max-width: 780px;
  overflow: hidden;
}

.bar span {
  background: var(--accent);
  display: block;
  height: 100%;
  transition: width 180ms ease;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin: 0 auto;
  max-width: 780px;
  padding: clamp(20px, 5vw, 40px);
}

.helper,
.lead {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
  margin: 0 0 22px;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 28px;
}

.facts span {
  background: var(--soft);
  border-radius: 999px;
  color: var(--accent);
  font-weight: 800;
  padding: 8px 12px;
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

input {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 48px;
  padding: 10px 12px;
  width: 100%;
}

input:focus,
button:focus-visible {
  outline: 3px solid rgba(11, 111, 95, 0.18);
  outline-offset: 2px;
}

.concept p {
  font-size: 19px;
  line-height: 1.6;
  margin: 0 0 22px;
}

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

.concept-points div {
  background: var(--soft);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 14px;
}

.concept-points strong,
.concept-points span {
  display: block;
}

.concept-points span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.check {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  margin-top: 22px;
  padding: 14px;
}

.check input {
  height: 20px;
  min-height: 20px;
  width: 20px;
}

.set-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.maxdiff {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.maxdiff-head,
.name-row {
  align-items: center;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 92px;
  gap: 12px;
}

.maxdiff-head {
  background: #f1f4f0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  padding: 10px 14px;
  text-transform: uppercase;
}

.maxdiff-head span:last-child {
  text-align: right;
}

.name-row {
  border-top: 1px solid var(--line);
  min-height: 72px;
  padding: 12px 14px;
}

.name-row strong {
  font-size: 23px;
  overflow-wrap: anywhere;
  text-align: center;
}

.choice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
  min-height: 44px;
}

.choice.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.winner {
  background: var(--accent-strong);
  border-radius: 8px;
  color: #fff;
  margin-bottom: 22px;
  padding: 18px;
}

.winner span {
  color: rgba(255, 255, 255, 0.72);
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.winner strong {
  display: block;
  font-size: clamp(34px, 10vw, 58px);
  line-height: 1;
}

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

.matrix-row {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding-top: 16px;
}

.matrix-row p {
  font-size: 16px;
  font-weight: 750;
  margin: 0;
}

.scale-labels {
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 750;
  justify-content: space-between;
  margin-bottom: 8px;
}

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

.scale-dot {
  aspect-ratio: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
}

.scale-dot.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.done {
  text-align: center;
}

.done span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.done p {
  font-size: 24px;
  font-weight: 850;
  margin: 12px 0;
}

.done strong {
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin: 18px auto 0;
  max-width: 780px;
}

.primary,
.secondary {
  border-radius: 8px;
  cursor: pointer;
  font-weight: 850;
  min-height: 54px;
  min-width: 132px;
  padding: 0 20px;
}

.primary {
  background: var(--accent-strong);
  border: 1px solid var(--accent-strong);
  color: #fff;
}

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

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.error {
  color: var(--danger);
  font-weight: 800;
  margin: 18px 0 0;
}

@media (max-width: 620px) {
  .shell {
    padding: 18px 12px;
  }

  .topbar {
    align-items: flex-start;
  }

  h1 {
    font-size: 32px;
  }

  .progress {
    min-height: 42px;
    min-width: 54px;
  }

  .concept-points {
    grid-template-columns: 1fr;
  }

  .maxdiff-head,
  .name-row {
    grid-template-columns: 76px minmax(0, 1fr) 76px;
    gap: 8px;
  }

  .name-row {
    min-height: 68px;
    padding: 10px;
  }

  .name-row strong {
    font-size: 20px;
  }

  .choice {
    min-height: 42px;
  }

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

  .primary,
  .secondary {
    min-width: 0;
    width: 100%;
  }
}
