/* The daily check-in. One component, two shapes: a block inside an account card and a single
   control in a toolbar (the workbench user bar). Colours and spacing come from tokens.css. */

.checkin {
  display: grid;
  gap: var(--s3);
}

/* The account card explains the reward above; the state follows it. */
.checkin-slot {
  margin-top: var(--s3);
}

.checkin-body {
  display: grid;
  justify-items: start;
  gap: var(--s3);
}

.checkin-line {
  display: grid;
  gap: 2px;
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
}

.checkin-streak {
  color: var(--text);
  font-weight: 500;
}

.checkin-next {
  color: var(--muted);
  font-size: 13px;
}

.checkin-button {
  /* The shared button is a full control; next to a paragraph it should not stretch. */
  justify-self: start;
}

.checkin-message {
  color: var(--secondary);
}

.checkin-message:empty {
  display: none;
}

/* ---- compact: the same state as one control in a bar ------------------------------------ */

.checkin-compact {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.checkin-compact .checkin-body {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.checkin-compact .checkin-line {
  display: flex;
  align-items: baseline;
  gap: var(--s1);
  white-space: nowrap;
}

.checkin-compact .checkin-streak {
  color: var(--secondary);
  font-size: 13px;
  font-weight: 500;
}

.checkin-compact .checkin-next {
  display: none;
}

.checkin-compact .checkin-button {
  padding: 0 var(--s3);
}

/* The result of a claim in a bar is announced, not laid out: the status line replaces the
   control, and this note only appears over the page for a moment without moving the bar. */
.checkin-compact .checkin-message,
.checkin-compact .checkin-error {
  position: absolute;
  top: calc(100% + var(--s2));
  right: 0;
  z-index: 3;
  width: max-content;
  max-width: 240px;
  margin: 0;
  padding: var(--s2) var(--s3);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  box-shadow: 0 8px 24px rgb(0 0 0 / 32%);
  font-size: 13px;
}

.checkin-compact .checkin-message:empty {
  display: none;
}
