/* The app's own rules, after rucy.io's stylesheet and the dashboard's. */

/* The opening of the first page, set apart from the list under it. */
.overview {
  margin-bottom: 48px;
}

/* The store's abandoned checkouts: the largest thing on the page. */
.figure {
  margin: 20px 0 8px;
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 560px) {
  .figure {
    font-size: 56px;
  }
}

/* The currency beside a sum of money. */
.figure__unit {
  font-size: 0.4em;
  font-weight: 400;
}

/* Where the money recovered opens the page, the count of checkouts comes second. */
.figure--second {
  font-size: 48px;
}

/* What the app said about a change that was just asked for. */
.said {
  font-weight: 700;
}

.said--no {
  color: var(--red);
}

/* A setting: a label over a field and its button on one line. */
.setting {
  margin: 16px 0;
}

.setting label {
  display: block;
  margin-bottom: 6px;
}

.setting__row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.setting input {
  width: 12ch;
  padding: 0 8px;
  border: 1px solid var(--fg);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  line-height: 18px;
}

/* A switch: a setting that is on or off, and the other once it is pressed. */
.switch {
  display: flex;
  gap: 10px;
  align-items: center;
}

button.switch__knob {
  position: relative;
  flex: none;
  width: 40px;
  height: 20px;
  padding: 0;
  border: 1px solid var(--fg);
  background: var(--bg);
  cursor: pointer;
}

button.switch__knob::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--fg);
}

button.switch__knob[aria-checked='true'] {
  background: var(--fg);
}

button.switch__knob[aria-checked='true']::after {
  left: 22px;
  background: var(--bg);
}

/* What a setting means: shown under its name while the name is pointed at or focused. */
.tip {
  position: relative;
  cursor: help;
}

.tip__mark {
  display: inline-block;
  width: 18px;
  border: 1px solid var(--fg);
  font-size: 12px;
  line-height: 16px;
  text-align: center;
}

.tip__text {
  display: none;
  position: absolute;
  z-index: 1;
  /* It opens above the name: the switches are the page's last lines, and below them it would run
     off the page's end, where it cannot be read. */
  bottom: 24px;
  left: 0;
  width: min(420px, 80vw);
  padding: 8px 10px;
  border: 1px solid var(--fg);
  background: var(--bg);
  color: var(--fg);
  /* The pointer passes through it, so that it closes when the pointer leaves the name and never
     keeps the setting under it from being reached. */
  pointer-events: none;
}

.tip:hover .tip__text,
.tip:focus .tip__text {
  display: block;
}

/* Where the store's staff write to a shopper, set apart from the conversation above it. */
.staff {
  margin-top: 48px;
}

.setting textarea {
  display: block;
  width: 100%;
  max-width: 480px;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid var(--fg);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  line-height: 18px;
  resize: vertical;
}

/* The site's button is a link. A real button needs the browser's own look taken off. */
button.cta {
  border: 0;
  font-family: inherit;
  cursor: pointer;
}
