/* Quiz editor */

.editor .start-main {
  max-width: 860px;
  padding-bottom: 160px;
}

.edit {
  gap: 20px;
}

.edit-meta,
.question-card {
  display: grid;
  gap: 16px;
}

.field--narrow {
  max-width: 280px;
}

.field-hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.field-error {
  color: var(--rose);
  font-size: 0.85rem;
  font-weight: 600;
}

.field-error:empty {
  display: none;
}

.field-error--list {
  margin: -8px 0 0;
  padding-left: 1.1em;
}

.input.is-invalid {
  border-color: var(--wrong);
}

textarea.input {
  min-height: 3.2em;
  resize: vertical;
  line-height: 1.4;
}

.questions {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.question-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.question-card__number {
  font-size: 1.1rem;
}

.question-card__tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 10px;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

.icon-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.icon-button:disabled,
.link-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  text-decoration: none;
}

.answers {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.answers legend {
  margin-bottom: 8px;
  padding: 0;
  font-weight: 600;
  font-size: 0.9rem;
}

.answer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  border-radius: var(--radius-small);
  background: var(--tile-bg);
  color: var(--tile-fg);
  box-shadow: var(--tile-ring, none);
}

.answer .input {
  padding: 0.55em 0.8em;
  font-size: 1rem;
}

.answer:has(:checked) {
  box-shadow: var(--tile-ring, 0 0 0 0 transparent), 0 0 0 3px var(--success);
}

.answer__correct {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.answer__correct input {
  width: 1.1em;
  height: 1.1em;
  margin: 0;
  accent-color: var(--charcoal);
  cursor: pointer;
}

.add-question {
  align-self: flex-start;
}

.edit-bar {
  position: fixed;
  inset: auto 0 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 14px max(16px, calc((100vw - 860px) / 2 + 16px));
  background: var(--grey);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.25);
  /* The bar keeps its look from before the new design (running text is looser there). */
  line-height: 1.4;
  letter-spacing: normal;
}

.edit-bar__status {
  display: grid;
  gap: 2px;
  font-size: 0.9rem;
}

.edit-bar__status p:first-child {
  font-weight: 600;
}

.edit-bar .form-error {
  flex-basis: 100%;
  order: 3;
}

#view-ERROR {
  gap: 24px;
  align-items: flex-start;
}

@media (max-width: 560px) {
  .answer {
    grid-template-columns: auto 1fr;
  }

  .answer__correct {
    grid-column: 2;
  }
}
