.stats-choice {
  position: fixed;
  z-index: 12;
  inset-block-end: max(.75rem, env(safe-area-inset-bottom));
  inset-inline-end: max(.75rem, env(safe-area-inset-right));
  box-sizing: border-box;
  width: min(24rem, calc(100% - 1.5rem));
  max-height: calc(100vh - 1.5rem);
  max-height: calc(100dvh - 1.5rem);
  overflow-y: auto;
  padding: 1rem 1.125rem;
  border: 1px solid #b7a995;
  border-radius: .9rem;
  background: #f3eee4;
  color: #292821;
  box-shadow: 0 .25rem 1.25rem rgb(35 28 18 / 14%);
  font: 400 1rem/1.45 Onest, system-ui, sans-serif;
  text-align: start;
  color-scheme: light;
}

.stats-choice[hidden], .stats-choice [hidden] { display: none; }
.stats-choice h2 {
  margin: 0 0 .3rem;
  font: 540 1.125rem/1.25 Geologica, Onest, system-ui, sans-serif;
  letter-spacing: -.025em;
}
.stats-choice p { margin: 0; font: inherit; }
.stats-choice .stats-choice-state { margin-top: .35rem; color: #625746; }
.stats-choice-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.stats-choice-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: .35rem .85rem;
  border: 1px solid #a99a86;
  border-radius: .55rem;
  color: #352c23;
  background: transparent;
  font: 500 1rem/1.25 Onest, system-ui, sans-serif;
  cursor: pointer;
}
.stats-settings {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: .25rem 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .9375rem;
  text-align: start;
  cursor: pointer;
}
.ws-footer:has(.stats-settings) { flex-wrap: wrap; gap: .3rem 1rem; }
.stats-choice :focus-visible, .stats-settings:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: .18rem;
}
@media (hover: hover) {
  .stats-choice-actions button:hover { background: #e2d7c6; border-color: #877865; }
  .stats-settings:hover { color: #f0ba91; }
}
@media (max-width: 40rem) {
  .stats-choice-inline {
    position: static;
    width: 100%;
    max-height: none;
    overflow: visible;
    box-shadow: none;
  }
  [data-stats-inline-after] + .stats-choice { margin-bottom: 2rem; }
  .stats-settings + .stats-choice-inline { flex-basis: 100%; margin-top: .5rem; }
  .stats-choice-inline .stats-choice-actions button { flex: 1; }
}
@media (max-width: 25rem) {
  .stats-choice { padding: .85rem 1rem; }
  .stats-choice-actions button { flex: 1; padding-inline: .5rem; }
}
