/* Settings → Setup: what's wrong with this install, worst first, then what
   works. Severity reads in words as well as colour. */
.setup-header {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;

  .btn {
    flex-shrink: 0;
  }
}

.setup-problems {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setup-problem {
  --setup-tone: var(--color-alert);

  border: 1px solid color-mix(in oklch, var(--setup-tone) 32%, transparent);
  background-color: color-mix(in oklch, var(--setup-tone) 6%, var(--color-bg));
  border-radius: 12px;
  display: flex;
  gap: 12px;
  padding: 16px 18px;
}

.setup-problem--error {
  --setup-tone: var(--color-negative);
}

.setup-problem__icon {
  --icon-size: 18px;

  color: var(--setup-tone);
  flex-shrink: 0;
  margin-block-start: 1px;
}

.setup-problem__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-inline-size: 0;
}

.setup-problem__title {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.90625rem;
  font-weight: 600;
  gap: 4px 10px;
  justify-content: space-between;
  margin: 0;
}

.setup-problem__severity {
  color: var(--setup-tone);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.setup-problem__detail {
  color: var(--color-text-lighter);
  font-size: 0.84375rem;
  line-height: 1.5;
  margin: 0;
  text-wrap: pretty;
}

.setup-problem__setting {
  align-self: flex-start;
  background-color: var(--color-bg-sunk);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  overflow-wrap: anywhere;
  padding: 4px 8px;
}

.setup-problem__link {
  align-self: flex-start;
  font-size: 0.84375rem;
}

.setup-check {
  justify-content: flex-start;

  .setting-row__text {
    flex: 1;
    min-inline-size: 0;
  }
}

.setup-check__mark {
  --icon-size: 18px;

  color: var(--color-positive);
  flex-shrink: 0;
}

.setup-check--pending .setup-check__mark {
  animation: setup-spin 0.9s linear infinite;
  block-size: 16px;
  border: 2px solid var(--color-border-dark);
  border-block-start-color: var(--color-accent-brand);
  border-radius: 50%;
  inline-size: 16px;

  @media (prefers-reduced-motion: reduce) {
    animation: none;
  }
}

.setup-check__status {
  color: var(--color-positive);
  font-weight: 600;
}

@keyframes setup-spin {
  to { transform: rotate(1turn); }
}

/* The problem count beside Setup in the settings navigation */
.settings-nav__count {
  background-color: var(--color-negative);
  border-radius: 999px;
  color: var(--color-text-reversed);
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  margin-inline-start: 6px;
  padding: 3px 6px;
  vertical-align: 1px;
}

/* A check's live test: its button, and what came back */
.setup-action {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-block-start: 6px;

  form {
    display: contents;
  }
}

.setup-action__result {
  color: var(--color-text-subtle);
  font-size: 0.78125rem;
}

.setup-action__result--ok {
  color: var(--color-positive);
  font-weight: 600;
}

.setup-action__result--error {
  color: var(--color-negative);
  font-weight: 600;
}

/* The browser-side real-time row draws its own mark: a spinner while it
   connects, then a dot in the outcome's colour. */
.setup-check--ok .setup-check__mark,
.setup-check--failed .setup-check__mark {
  block-size: 12px;
  border-radius: 50%;
  inline-size: 12px;
  margin-inline: 3px;
}

.setup-check--ok .setup-check__mark {
  background-color: var(--color-positive);
}

.setup-check--failed {
  .setup-check__mark {
    background-color: var(--color-negative);
  }

  .setup-check__status {
    color: var(--color-negative);
  }
}

.setup-check--pending .setup-check__status {
  color: var(--color-text-subtle);
}
