:root {
  --navy: #1b2a4a;
  --navy-2: #243656;
  --gold: #b08d3e;
  --paper: #f7f3ea;
  --ink: #1a1a1a;
  --muted: #4d4a45;
  --line: #c9c1b2;
  --white: #fffcf6;
  --danger: #7a1f1f;
  --page: 960px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", Tahoma, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #d8d1c4;
  line-height: 1.65;
}

.site-head {
  background: var(--navy);
  color: #f3ead6;
  border-bottom: 4px solid var(--gold);
}

.site-head__inner,
.sheet,
.site-foot {
  width: min(var(--page), calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

.site-head__inner {
  padding: 20px 4px 18px;
}

.site-head__uni {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  line-height: 1.3;
}

.site-head__dept {
  margin: 6px 0 0;
  font-size: 0.95rem;
  color: #e2d4a8;
}

.sheet {
  background: var(--paper);
  border: 1px solid #b9b09f;
  box-shadow: 0 1px 0 #fff inset, 0 8px 24px rgba(40, 32, 18, 0.12);
  padding: 28px 36px 40px;
  margin-top: 28px;
  margin-bottom: 28px;
}

.sheet h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 1.85rem;
  line-height: 1.3;
  margin: 8px 0 16px;
  border-bottom: 2px solid var(--navy);
  padding-bottom: 12px;
}

.intro {
  white-space: pre-line;
  font-size: 1.05rem;
  line-height: 1.75;
  margin: 0 0 18px;
  max-width: 42em;
}

.researchers {
  white-space: pre-line;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
  border-left: 4px solid var(--gold);
  padding-left: 14px;
  margin: 8px 0 0;
}

.progress__now {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--navy);
  font-weight: 700;
}

.steps {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 28px;
  padding: 0 0 16px;
  list-style: none;
  border-bottom: 1px solid var(--line);
}

.steps li {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.25;
}

.steps__n {
  display: flex;
  width: 1.7rem;
  height: 1.7rem;
  margin: 0 auto 6px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--white);
  font-weight: 700;
  font-size: 0.9rem;
}

.steps li.is-on {
  color: var(--navy);
  font-weight: 700;
}

.steps li.is-on .steps__n {
  background: var(--navy);
  color: #f7f1e4;
  border-color: var(--navy);
}

.steps li.is-done .steps__n {
  background: #e8dfc8;
  border-color: var(--gold);
}

.note {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--muted);
  margin: 0 0 22px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 28px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  min-width: 0;
}

.field span,
.field legend {
  font-size: 1.02rem;
  font-weight: 600;
  padding: 0;
}

.field input[type="text"],
.field input[type="number"] {
  font: inherit;
  font-size: 1.05rem;
  padding: 11px 12px;
  border: 1px solid #7f7768;
  background: var(--white);
  width: 100%;
  max-width: 22rem;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choices label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #b7ae9d;
  background: var(--white);
  font-size: 1rem;
  cursor: pointer;
}

.choices input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--navy);
}

.scale-key {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 18px;
  line-height: 1.5;
}

.item {
  margin: 0 0 18px;
  padding: 14px 16px 16px;
  border: 1px solid #d2cbbd;
  background: var(--white);
  scroll-margin-top: 20px;
}

.item legend {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
  padding: 0 6px;
}

.scale-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.scale-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 7.2rem;
  flex: 1 1 7.2rem;
  padding: 10px 8px;
  border: 1px solid #b7ae9d;
  background: #fbf8f1;
  cursor: pointer;
  text-align: center;
}

.scale-opt:has(input:checked) {
  border-color: var(--navy);
  background: #e8edf4;
}

.scale-opt input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--navy);
}

.scale-opt__n {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
}

.scale-opt__t {
  font-size: 0.88rem;
  line-height: 1.3;
  color: var(--ink);
}

.nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

button {
  font: inherit;
  cursor: pointer;
}

.btn {
  background: var(--navy);
  color: #f7f1e4;
  border: 1px solid #111a30;
  padding: 12px 22px;
  min-width: 140px;
  font-size: 1.05rem;
}

.btn:hover {
  background: var(--navy-2);
}

.btn.secondary {
  background: var(--white);
  color: var(--navy);
  border-color: #8f8778;
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.err {
  margin-top: 16px;
  background: #f4e3d8;
  border: 1px solid #c9a08e;
  color: var(--danger);
  padding: 12px 14px;
  font-size: 1rem;
}

.done h1 {
  border-bottom-color: var(--gold);
}

.done p {
  font-size: 1.08rem;
  max-width: 36em;
}

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

.loading {
  color: var(--muted);
  font-size: 1.05rem;
}

.site-foot {
  padding: 0 0 36px;
  font-size: 0.9rem;
  color: #5e584e;
  text-align: center;
}

@media (max-width: 900px) {
  .steps__t {
    display: none;
  }

  .steps {
    gap: 4px;
  }
}

@media (max-width: 800px) {
  html {
    font-size: 17px;
  }

  .site-head__inner {
    width: calc(100% - 32px);
    padding: 18px 0 16px;
  }

  .sheet,
  .site-foot {
    width: 100%;
  }

  .sheet {
    margin: 0;
    border: 0;
    box-shadow: none;
    padding: 22px 16px 36px;
  }

  .sheet h1 {
    font-size: 1.45rem;
  }

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

  .field input[type="text"],
  .field input[type="number"] {
    max-width: none;
  }

  .scale-opt {
    min-width: calc(50% - 8px);
    flex-basis: calc(50% - 8px);
  }
}

@media (max-width: 520px) {
  .scale-opt {
    min-width: 100%;
    flex-basis: 100%;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    text-align: left;
  }
}
