.tools-popover{position:fixed;z-index:200;width:216px;max-width:calc(100vw - 16px);border:1px solid var(--border);border-radius:13px;background:var(--bar);padding:5px;display:flex;align-items:stretch;gap:3px;box-shadow:0 5px 20px #51384712}
.tools-popover[hidden]{display:none!important}
.tools-popover button{flex:1;min-width:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:5px;border:0;border-radius:8px;background:transparent;color:var(--ink);padding:6px 5px;font-size:10px;cursor:pointer}
.tools-popover button:hover,.tools-popover button:focus-visible{background:var(--soft)}
.tools-popover svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.55;stroke-linecap:round;stroke-linejoin:round}
.tools-popover button[data-tool=timer]{color:#a86d84}
.tools-popover span{font-size:10px}
.tools-popover button.drop-ready{background:var(--accent);color:#fff;transform:translateY(-3px)}
.timer-overlay{position:fixed;inset:0;margin:0;padding:0;width:100%;height:100dvh;max-width:none;max-height:none;border:0;background:#588eaa;overflow:hidden}
.timer-overlay::backdrop{background:#588eaa}
.timer-overlay iframe{display:block;border:0;width:100%;height:100%}
body.timer-is-open{overflow:hidden}
.timer-overlay.is-loading::after{content:"";position:absolute;left:calc(50% - 14px);top:calc(50% - 14px);width:28px;height:28px;border:2px solid #ffffff40;border-top-color:white;border-radius:50%;animation:timer-load 1s linear infinite;pointer-events:none}
@keyframes timer-load{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.timer-overlay.is-loading::after{animation:none}}

html.timer-surface,html.timer-surface body{background-color:var(--timer-edge-top,#70b2d6)!important;background-image:none!important}
.timer-overlay,.timer-overlay::backdrop{background-color:var(--timer-edge-top,#70b2d6)}
.timer-browser-edge{position:fixed;left:0;right:0;z-index:5;pointer-events:none;display:block}
.timer-browser-edge.top{top:0;height:max(8px,env(safe-area-inset-top));background-color:var(--timer-edge-top,#70b2d6);mask-image:linear-gradient(#000,transparent)}
.timer-browser-edge.bottom{bottom:0;height:max(8px,env(safe-area-inset-bottom));background-color:var(--timer-edge-bottom,#348da4);mask-image:linear-gradient(transparent,#000)}
body:not(.timer-is-open){padding-top:env(safe-area-inset-top)}
body:not(.timer-is-open)>.toolbar{top:env(safe-area-inset-top)}

html.timer-surface body{overflow:hidden}

@media(min-width:701px){.timer-browser-edge{display:none}}
