/* Your stats dialog. Palette tokens come from theme.css. */
.stats-open{margin:0 0 6px;font-size:14px}
.stats-dialog{width:min(560px,calc(100% - 32px))}
.stats-body{display:flex;flex-direction:column;gap:14px;margin:12px 0 16px}
.stats-tiles{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.stats-tile{display:flex;flex-direction:column;justify-content:space-between;gap:4px;min-width:0;padding:10px;border:2px solid var(--ink);border-radius:12px;background:var(--sun-soft);box-shadow:var(--hard-sm)}
.stats-tile:nth-child(2){background:var(--teal-soft)}
.stats-tile:nth-child(3){background:var(--pink-soft)}
.stats-tile:nth-child(4){background:var(--paper)}
.stats-tile strong{font:800 24px/1.1 var(--display);font-variant-numeric:tabular-nums;color:var(--ink);overflow-wrap:anywhere}
.stats-tile span{font:800 10px/1.2 var(--sans);letter-spacing:.04em;color:var(--muted)}
.stats-section{padding:12px 14px;border:2px solid var(--ink);border-radius:14px;background:var(--paper)}
.stats-section h3{margin:0 0 6px;font:800 17px/1.25 var(--display);color:var(--ink)}
.stats-line{margin:4px 0 0;font-size:15px;line-height:1.45;color:var(--ink)}
.stats-line strong{font-variant-numeric:tabular-nums}
.stats-days{display:grid;grid-template-columns:repeat(14,minmax(0,22px));gap:4px;margin:10px 0 0;padding:0;list-style:none}
.stats-day,.stats-key{aspect-ratio:1;border:1.5px solid var(--ink);border-radius:4px;background:var(--panel)}
.stats-day-solved{background:var(--teal)}
.stats-day-missed{background:var(--tomato);background-image:repeating-linear-gradient(135deg,transparent 0 3px,rgba(27,36,51,.35) 3px 4.5px)}
.stats-legend{display:flex;flex-wrap:wrap;align-items:center;gap:4px 14px;margin:8px 0 0;font-size:13px;color:var(--muted)}
.stats-legend span{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
.stats-key{display:inline-block;width:12px;height:12px}
.stats-table-wrap{overflow-x:auto}
.stats-table{width:100%;border-collapse:collapse;font-size:14px;font-variant-numeric:tabular-nums}
.stats-table th,.stats-table td{padding:6px 4px;border-bottom:1px solid rgba(27,36,51,.18);text-align:right;white-space:nowrap}
.stats-table th:first-child{text-align:left}
.stats-table thead th{font-size:11px;letter-spacing:.03em;color:var(--muted)}
.stats-table abbr{text-decoration:none}
.stats-tough{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none}
.stats-tough li{display:flex;flex-direction:column;gap:2px;padding:8px 10px;border-left:4px solid var(--tomato);background:var(--panel);border-radius:6px}
.stats-tough small{font-size:13px;color:var(--muted)}
@media(max-width:520px){.stats-tiles{grid-template-columns:repeat(2,1fr)}.stats-section{padding:10px 12px}}
@media(max-width:400px){.stats-table tr>:nth-child(4),.stats-table tr>:nth-child(5){display:none}.stats-table th,.stats-table td{padding:6px 3px}}
