/* Scoped rest dialog. Button focus styles remain unchanged. */
dialog.rest-overlay{width:min(420px,calc(100vw - 32px));max-width:none;max-height:calc(var(--dialog-visible-height,100dvh) - 32px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));margin:auto;padding:0;border:1px solid var(--border);border-radius:24px;background:var(--surface,var(--bg));color:var(--text-primary);box-shadow:0 24px 80px #0008;overflow:auto}
.rest-overlay::backdrop{background:#080a0bc9;backdrop-filter:blur(5px)}
.rest-overlay-content{padding:28px 24px 24px;text-align:center;display:grid;gap:12px}
.rest-overlay h2{margin:0;font-size:clamp(1.35rem,5vw,1.8rem);line-height:1.2}
.rest-overlay h2:focus{outline:none}
.rest-dial{position:relative;width:min(240px,60vw);aspect-ratio:1;justify-self:center;margin:8px 0}
.rest-dial svg{display:block;width:100%;height:100%;overflow:visible}
.rest-dial circle{fill:none;stroke-width:8}
.rest-ring-track{stroke:var(--border)}
.rest-ring-progress{stroke:url(#rest-ring-color);stroke-linecap:round;stroke-dasharray:100;stroke-dashoffset:0;transform:rotate(-90deg);transform-origin:100px 100px;transition:stroke-dashoffset .2s linear}
.rest-dial-center{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px}
.rest-dial-center time{font-size:clamp(2.8rem,13vw,4rem);font-weight:700;line-height:1;font-variant-numeric:tabular-nums;letter-spacing:-.04em}
.rest-dial-center span{font-size:.8rem;color:var(--text-secondary)}
.rest-finished{margin:0;min-height:1.4em;font-weight:600;color:var(--accent)}
.rest-overlay-actions{display:grid;grid-template-columns:1fr;gap:10px}
.rest-overlay-actions .btn{width:100%;min-height:48px;white-space:normal;justify-content:center}
.rest-complete .rest-overlay-actions{visibility:hidden}
.rest-complete .rest-ring-progress{opacity:0}
.rest-final-seconds [data-rest-countdown]{animation:rest-countdown-pulse 1s ease-in-out infinite}
@keyframes rest-countdown-pulse{0%,100%{opacity:1}50%{opacity:.72}}
@media(min-width:480px){.rest-overlay-actions{grid-template-columns:1fr 1fr}}
@media(max-height:560px){.rest-overlay-content{padding:16px;gap:6px}.rest-dial{width:min(150px,36vh);margin:0}.rest-dial-center time{font-size:2.6rem}.rest-dial-center span{font-size:.7rem}.rest-overlay-actions{grid-template-columns:1fr 1fr}.rest-finished{min-height:1.2em}}
@media(prefers-reduced-motion:reduce){.rest-final-seconds [data-rest-countdown]{animation:none}.rest-ring-progress{transition:none}.rest-overlay::backdrop{backdrop-filter:none}}
