*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
:root{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#fff;background:#111315;--blue:#047bbc;--green:#04ac5c;--orange:#fc6c2c;--panel:#202328;--border:#343940;--muted:#adb5bd}
html,body{margin:0;min-height:100%;background:#111315;overscroll-behavior:none}
body{min-height:100dvh}button,input{font:inherit}
.app{width:min(100%,560px);min-height:100dvh;margin:0 auto;padding:max(24px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) max(28px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left));display:grid;grid-template-rows:auto 1fr auto;gap:22px}
.brand{min-height:62px;display:flex;align-items:center;justify-content:center}
.logo{display:block;width:min(82%,400px);max-height:62px;object-fit:contain}
.meter{align-self:center;display:grid;justify-items:center;gap:18px}
.tap-button{width:min(82vw,360px);aspect-ratio:1;border:0;border-radius:50%;padding:20px;color:#fff;background:linear-gradient(145deg,#058bd2,var(--blue));box-shadow:0 20px 48px #0008,0 0 0 5px #047bbc24,inset 0 2px 1px #fff3;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer;touch-action:manipulation;user-select:none}
.tap-button:active,.tap-button.is-tapping{transform:scale(.97);box-shadow:0 11px 30px #0007,0 0 0 7px #04ac5c2e,inset 0 4px 10px #0003}
.tap-button:focus-visible,.icon-button:focus-visible,input:focus-visible{outline:3px solid var(--orange);outline-offset:5px}
.bpm{font-size:clamp(4.7rem,24vw,8rem);font-weight:800;line-height:.9;font-variant-numeric:tabular-nums}
.unit{margin-top:12px;font-size:1.2rem;font-weight:750;letter-spacing:.14em}
.tap-count{margin-top:14px;color:#d9f5e7;font-weight:650}
.controls{display:flex;gap:18px}
.icon-button{width:58px;height:58px;border:2px solid;border-radius:50%;color:#fff;background:#24272c;box-shadow:0 8px 20px #0005;font-size:1.8rem;line-height:1;cursor:pointer;touch-action:manipulation}
.reset-button{border-color:var(--orange)}.settings-button{border-color:var(--green)}
.icon-button:active{transform:scale(.95);background:#30343a}.reset-button:active{transform:rotate(-20deg) scale(.95)}
.settings-button[aria-expanded=true]{background:var(--green)}
.settings{padding-top:8px;border-top:1px solid #2c3035;display:grid;gap:12px;animation:reveal 150ms ease-out}
.settings[hidden],[hidden]{display:none!important}
.setting-row{min-height:58px;padding:10px 14px;border:1px solid var(--border);border-radius:16px;background:var(--panel);display:flex;align-items:center;justify-content:space-between;gap:14px}
.switch-label{flex:1;min-width:0;display:flex;align-items:center;justify-content:space-between;gap:16px;font-weight:700}
.switch{position:relative;width:52px;height:30px;flex:0 0 auto}.switch input{position:absolute;width:1px;height:1px;opacity:0}
.slider{position:absolute;inset:0;border-radius:999px;background:#4b5159;cursor:pointer;transition:background 140ms ease}
.slider:before{content:"";position:absolute;top:4px;left:4px;width:22px;height:22px;border-radius:50%;background:#fff;box-shadow:0 2px 5px #0006;transition:transform 140ms ease}
.switch input:checked+.slider{background:var(--green)}.switch input:checked+.slider:before{transform:translateX(22px)}
.seconds-label{display:flex;align-items:center;gap:8px;color:var(--muted);white-space:nowrap}
.seconds-label input{width:66px;height:40px;border:1px solid #525963;border-radius:10px;color:#fff;background:#15171a;text-align:center;font-weight:750}
.seconds-label input:disabled{opacity:.42}
@keyframes reveal{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@media(max-height:730px){.app{gap:14px}.brand{min-height:42px}.logo{max-height:46px}.tap-button{width:min(65vh,300px)}}
@media(prefers-reduced-motion:no-preference){.tap-button,.icon-button{transition:transform 80ms ease,background 120ms ease,box-shadow 120ms ease}}
