#stats-panel[hidden], #stats-settings[hidden] { display: none; }
#stats-settings {
  padding: 0; border: 0; background: none; color: inherit; font: inherit;
  font-size: .9rem; text-decoration: underline; cursor: pointer;
}
#stats-panel {
  position: fixed; z-index: 100; inset: auto 1rem 1rem auto; box-sizing: border-box;
  width: min(30rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto;
  padding: 1.1rem 1.25rem; border: 1px solid #b5c8df; border-radius: .75rem;
  background: white; color: #172940; box-shadow: 0 5px 28px #08172c38; text-align: left;
}
#stats-panel h2 { margin: 0 2rem .42rem 0; font-size: 1.25rem; line-height: 1.25; letter-spacing: normal; }
#stats-panel p, #stats-panel details { margin: .4rem 0; font-size: .94rem; color: #344b61; line-height: 1.45; }
#stats-panel details { padding: 0; border: 0; }
#stats-panel summary, #stats-panel a { font-size: .9rem; color: #184c9c; text-decoration: underline; }
#stats-panel summary { display: list-item; list-style: disclosure-closed; }
#stats-panel details[open] summary { list-style: disclosure-open; }
#stats-panel summary::after { content: none; }
#stats-close {
  position: absolute; right: .45rem; top: .35rem; width: 2.35rem; height: 2.35rem;
  padding: 0; border: 0; background: none; color: #344b61; font: inherit; font-size: 1.5rem; cursor: pointer;
}
.stats-actions { display: flex; gap: .55rem; margin-top: .85rem; }
.stats-actions button {
  flex: 1; padding: .62rem .35rem; min-height: 2.6rem; border: 1px solid #275cae;
  border-radius: .4rem; background: #fff; color: #194a93; font: inherit; font-size: .94rem;
  font-weight: 650; line-height: 1.2; cursor: pointer;
}
.stats-actions button:hover { background: #eef4ff; }
#stats-panel :focus-visible, #stats-settings:focus-visible { outline: 3px solid #1674d7; outline-offset: 2px; }
@media (max-width: 35rem) {
  #stats-panel { inset: auto .5rem max(.5rem, env(safe-area-inset-bottom)) .5rem; width: auto; padding: 1rem; }
}
