@layer components {
  /* How a site is going, by colour, wherever it is said or picked. */
  .outlook--on-track {
    --outlook-color: var(--color-success);
  }

  .outlook--some-risk {
    --outlook-color: oklch(var(--lch-yellow-medium));
  }

  .outlook--concerned {
    --outlook-color: var(--color-error);
  }

  /* A small dot in its colour, the word, and when it was said. */
  .outlook-mark {
    align-items: center;
    display: inline-flex;
    gap: 0.4em;
    white-space: nowrap;

    &::before {
      background-color: var(--outlook-color);
      block-size: 0.7em;
      border-radius: 50%;
      content: "";
      flex: none;
      inline-size: 0.7em;
    }
  }

  .outlook-mark__time {
    color: var(--color-meta);
  }

  /* In a site's strip, after who is on it; on a phone without its time. */
  .project__outlook {
    color: inherit;
    flex: none;
    text-decoration: none;

    @media (width < 640px) {
      .outlook-mark__time {
        display: none;
      }
    }

    @media (any-hover: hover) {
      &:hover .outlook-mark__word {
        text-decoration: underline;
      }
    }
  }

  /* How the site is going, as last said: who said it on top, the word in its colour, and the note under it all. */
  .needle {
    align-items: center;
    border: 1px solid var(--color-ink-lighter);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    margin-inline: auto;
    max-inline-size: 40rem;
    overflow: hidden;
    text-align: center;
  }

  .needle__byline {
    --avatar-size: 2rem;

    align-items: center;
    align-self: start;
    display: flex;
    font-size: var(--text-control);
    gap: var(--inline-space-half);
    padding: var(--block-space) var(--block-space) 0;
    text-align: start;

    > span:not(.avatar) {
      display: flex;
      flex-direction: column;
    }

    time {
      color: var(--color-meta);
    }
  }

  .needle__outlook {
    align-items: center;
    display: inline-flex;
    font-size: var(--text-section);
    font-weight: 700;
    gap: 0.4em;
    margin: var(--block-space-half) 0 0;

    &::before {
      background-color: var(--outlook-color);
      block-size: 0.7em;
      border-radius: 50%;
      content: "";
      inline-size: 0.7em;
    }
  }

  .needle__updated {
    color: var(--color-meta);
    font-size: var(--text-small);
    margin: 0 0 var(--block-space);
  }

  .needle__note {
    align-self: stretch;
    background-color: var(--color-meta-fill);
    overflow-wrap: anywhere;
    padding: var(--block-space) var(--block-space-double);
    text-align: start;

    p {
      margin: 0;

      & + p {
        margin-block-start: var(--block-space-half);
      }
    }
  }

  /* The question as the page's centred title, then the three answers by colour, the note and the save. */
  .needle-form__title {
    font-size: var(--text-page-title);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 var(--block-space);
    text-align: center;
  }

  .needle-form__outlooks {
    border: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--inline-space-half) var(--inline-space-double);
    justify-content: center;
    margin: 0;
    padding: 0;
  }

  .needle-form__outlook {
    align-items: center;
    cursor: pointer;
    display: inline-flex;
    gap: 0.4em;

    input {
      appearance: none;
      background-color: var(--outlook-color);
      block-size: 1.1em;
      border-radius: 50%;
      cursor: pointer;
      inline-size: 1.1em;
      margin: 0;

      &:checked {
        box-shadow: 0 0 0 2px var(--color-canvas), 0 0 0 4px var(--outlook-color);
      }
    }
  }
}
