/* Status colors stay independent from the chosen accent and background theme. */
.success-outcome-overview,.success-donut,.success-outcome-details {
 --stats-completed:var(--green);
 --stats-partial:var(--yellow);
 --stats-missed:var(--danger,#ef8b91);
 --stats-skipped:var(--muted,#93949d);
 color:var(--text,#f3f3f5);
}
.success-outcome-overview { display:grid;grid-template-columns:minmax(0,1fr);justify-items:center;gap:20px;width:100%;max-width:380px;margin:20px auto 2px;min-width:0; }
.success-donut { position:relative;width:240px;aspect-ratio:1;max-width:100%;justify-self:center;flex:none;background:transparent; }
.success-donut svg { display:block;width:100%;height:100%;overflow:visible; }
.success-donut-track { stroke:var(--line,#36363c); }
.success-donut-segment.completed { stroke:var(--stats-completed); }
.success-donut-segment.partial { stroke:var(--stats-partial); }
.success-donut-segment.missed { stroke:var(--stats-missed); }
.success-donut-segment.skipped { stroke:var(--stats-skipped); }
.success-donut-centre { position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;pointer-events:none;gap:7px; }
.success-donut-centre strong { font-size:46px;line-height:1;letter-spacing:-2px;font-weight:650;font-variant-numeric:tabular-nums; }
.success-donut-centre span { color:var(--muted,#aaa);font-size:12px;line-height:1.5;max-width:130px; }
.success-outcome-details { width:100%;min-width:0; }
.success-outcome-legend { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 22px;padding:0;margin:0;list-style:none; }
.success-outcome-legend>li { display:grid;grid-template-columns:8px minmax(0,1fr);grid-template-rows:auto auto;gap:6px 8px;align-items:start;margin:0;padding:13px 0;border-top:1px solid var(--line,#36363c);font-size:12px;line-height:1.5; }
.success-outcome-legend>li>span:not(.success-outcome-key) { grid-column:2;grid-row:1;min-height:36px;overflow-wrap:break-word; }
.success-outcome-legend strong { grid-column:2;grid-row:2;color:var(--text,#f3f3f5);font-size:24px;line-height:1.15;letter-spacing:-.6px;font-weight:600;font-variant-numeric:tabular-nums; }
.success-outcome-key { width:8px;height:8px;margin-top:5px;border-radius:50%;background:var(--stats-skipped); }
.success-outcome-legend .completed .success-outcome-key { background:var(--stats-completed); }
.success-outcome-legend .partial .success-outcome-key { background:var(--stats-partial); }
.success-outcome-legend .missed .success-outcome-key { background:var(--stats-missed); }
.success-outcome-legend .skipped .success-outcome-key { background:var(--stats-skipped); }
.success-outcome-legend .is-zero { color:var(--muted,#aaa); }
.success-outcome-legend .is-zero .success-outcome-key { opacity:.4; }
.success-outcome-note { max-width:340px;margin:14px auto 0;color:var(--muted,#aaa);font-size:12px;line-height:1.65;text-align:center; }
.success-outcome-overview.is-compact { gap:16px;max-width:340px; }
.success-donut.is-compact { width:220px; }
.success-donut.is-compact .success-donut-centre strong { font-size:42px; }
@media(max-width:374px) {
 .success-outcome-overview,.success-outcome-overview.is-compact { gap:16px; }
 .success-donut { width:220px; }
 .success-donut-centre strong { font-size:42px; }
 .success-outcome-legend { column-gap:16px; }
}
@media(forced-colors:active) {
 .success-donut-segment,.success-outcome-key { forced-color-adjust:none; }
 .success-donut-track { stroke:GrayText; }
}

/* revealSections turns the summary into an h3. Both forms must retain the
   date / result-count hierarchy instead of joining their text on one line. */
.history-calendar .stats-selected-day {
 padding:20px 0 0;
 background:transparent;
 border-top:1px solid var(--line);
}
.history-calendar .stats-selected-day>:is(summary,.visible-section-heading) {
 display:flex;
 flex-direction:row;
 align-items:center;
 justify-content:space-between;
 gap:12px;
 min-height:0;
 padding:0;
 margin:0;
 color:var(--text);
 font-size:15px;
 font-weight:600;
 line-height:1.5;
 text-transform:none;
}
.history-calendar .stats-selected-day>:is(summary,.visible-section-heading)>span {
 display:flex;
 flex-direction:column;
 gap:5px;
 min-width:0;
}
.history-calendar .stats-selected-day>:is(summary,.visible-section-heading) small {
 display:block;
 margin:0;
 color:var(--muted);
 font-size:12px;
 font-weight:400;
 line-height:1.5;
}
.history-calendar .stats-day-entries { padding-top:16px; }
.history-calendar .stats-entry {
 grid-template-columns:40px minmax(0,1fr) 18px;
 gap:3px 12px;
 padding:15px 0;
 min-height:78px;
 background:transparent;
 border-color:var(--line);
}
.history-calendar .stats-entry-icon {
 width:40px;
 min-width:40px;
 height:40px;
 align-self:center;
 border-radius:12px;
 color:var(--accent-ink);
 background:var(--surface-3);
}
.history-calendar .stats-entry-icon>svg { color:inherit; }
.history-calendar .stats-entry-title { color:var(--text); font-size:14px; line-height:1.5; }
.history-calendar .stats-entry-status { font-size:12px; }
.history-calendar .stats-entry-status.completed { color:var(--green); }
.history-calendar .stats-entry-status.partial { color:var(--yellow); }
.history-calendar .stats-entry-status.missed { color:var(--danger); }
.history-calendar .stats-entry-status.skipped,
.history-calendar .stats-entry>svg { color:var(--muted); }

/* Compact labels sit beside their figures instead of leaving tall empty rows. */
.success-outcome-overview{gap:18px;margin-top:16px}
.success-outcome-legend{gap:0 20px}
.success-outcome-legend>li{grid-template-columns:8px minmax(0,1fr) auto;grid-template-rows:auto;align-items:center;gap:8px;padding:15px 0}
.success-outcome-legend>li>span:not(.success-outcome-key){grid-column:2;grid-row:1;min-height:0}
.success-outcome-key{margin-top:0}
.success-outcome-legend strong{grid-column:3;grid-row:1;font-size:21px;letter-spacing:-.4px}
.success-outcome-note{font-size:11px;text-align:left;margin-top:15px;max-width:none}
.strength-card .gauge svg path:first-child{stroke:var(--line)}
.strength-card .gauge svg path:last-child{stroke:var(--accent-graphic,var(--accent))}
@media(max-width:359px){.success-outcome-legend{column-gap:14px}.success-outcome-legend>li{gap:6px;font-size:11px}.success-outcome-legend strong{font-size:19px}}

/* Full Polish dates need room for the calendar and disclosure controls. */
@media(max-width:560px){
 .stats-range .stats-range-controls,.stats-range .stats-range-controls>.form-grid{grid-template-columns:minmax(0,1fr)}
 .stats-range .date-trigger{min-height:52px}
 .stats-range [data-date-caption]{word-break:normal;overflow-wrap:normal;line-height:1.45}
}

/* Keep large-text history labels inside the page used by the fixed dock. */
.stats-range-metrics{grid-template-columns:repeat(auto-fit,minmax(min(100%,10em),1fr))}
.stats-range-metrics>.metric{min-width:0;overflow-wrap:anywhere}
