/* MSH Run Club page structure */
:root{--safe-top:max(12px,env(safe-area-inset-top));--safe-bottom:max(12px,env(safe-area-inset-bottom));--safe-left:max(12px,env(safe-area-inset-left));--safe-right:max(12px,env(safe-area-inset-right))}
.home-events-only{padding-top:28px}.home-event-head{align-items:flex-start}.home-event-head h1{margin:0;font-size:clamp(2rem,6vw,3.5rem);line-height:1.04}.home-event-head p:not(.eyebrow){margin:8px 0 0;color:#6b7280;font-size:1rem}.event-counts{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:18px}.event-counts span{display:block;padding:12px 14px;border-radius:15px;background:#f5f5f5;font-size:.9rem;color:#525252}.event-counts strong{display:inline;font-size:1.15rem;color:#171717}.event-footer{justify-content:flex-end!important}.event-footer .btn{min-width:150px}.two-nav{grid-template-columns:repeat(2,1fr)!important}

/* Topbar avatar uses the same private profile photo */
.avatar-btn{position:relative!important;overflow:hidden!important;display:grid!important;place-items:center!important;padding:0!important;width:52px!important;height:52px!important;min-width:52px!important;flex:0 0 52px!important;aspect-ratio:1/1!important;border-radius:50%!important;background:#fff!important}
.auth-avatar-image{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-width:none!important;object-fit:cover!important;object-position:center!important;border-radius:50%!important;display:block!important}
.auth-avatar-image.hidden{display:none!important}
.avatar-btn #avatarText{position:relative;z-index:1}

.member-profile-card{margin-bottom:16px}.profile-avatar-wrap{width:76px!important;height:76px!important;min-width:76px!important;flex:0 0 76px!important;aspect-ratio:1/1!important;border-radius:50%!important;overflow:hidden!important;position:relative!important;display:grid!important;place-items:center!important}.profile-avatar-image{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-width:none!important;object-fit:cover!important;object-position:center!important;border-radius:50%!important;display:block!important}.profile-avatar-image.hidden{display:none!important}.profile-copy{min-width:0}.admin-entry-wrap{margin-top:14px;padding-top:14px;border-top:1px solid #ececec}.admin-entry-wrap:empty{display:none}.admin-entry-wrap .btn{width:100%;background:#171717;color:#fff;border-color:#171717}.profile-photo-editor{display:grid;grid-template-columns:auto 1fr;gap:18px;align-items:center;padding:14px;border:1px solid #e5e7eb;border-radius:20px;background:#fafafa}.profile-photo-preview{width:96px;height:96px;aspect-ratio:1/1;border-radius:50%;overflow:hidden;background:#171717;color:#fff;display:grid;place-items:center;font-size:2.2rem;font-weight:800}.profile-photo-preview img{width:100%;height:100%;object-fit:cover;object-position:center;border-radius:50%}.profile-photo-preview img.hidden{display:none!important}.profile-upload-button{display:inline-flex!important;width:auto!important;align-items:center;justify-content:center;margin:0!important}.profile-photo-editor .fineprint{margin:8px 0 0}.brand-mark{font-size:.82rem!important;letter-spacing:-.02em}.brand strong{font-size:1.06rem!important;line-height:1.15}.brand small{font-size:.72rem!important}.event-capacity{display:none!important}.qr-result-dialog{margin:auto!important;inset:0!important;width:min(680px,calc(100% - 28px))!important;max-height:min(86vh,760px)!important;border-radius:28px!important}.qr-result-dialog .sheet-body{max-height:86vh!important}.section-view.hidden{display:none!important}

/* Member action buttons */
#member .member-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px!important;margin-top:14px!important}
#member .member-actions .btn{width:100%!important;min-height:56px!important;padding:11px 14px!important;border-radius:18px!important;font-size:1rem!important;line-height:1.15!important;box-shadow:none!important}
#member #editProfileBtn{background:#fff!important;border:1.5px solid #d9dce1!important;color:#171717!important}
#member #connectStravaBtn{background:#fff4ef!important;border:1.5px solid #ffd2bf!important;color:#d94801!important}
#member #connectStravaBtn:disabled{opacity:1!important;cursor:default!important}
#member #syncStravaBtn{background:#171717!important;color:#fff!important;border:1.5px solid #171717!important}
#member #disconnectStravaBtn{background:#fff5f6!important;color:#b4233f!important;border:1.5px solid #ffd8df!important}
#member .member-actions #syncStravaBtn:not(.hidden),#member .member-actions #disconnectStravaBtn:not(.hidden){display:flex!important;align-items:center!important;justify-content:center!important}

/* Notifications: always visible near the top, below the sticky header */
.toast{top:calc(env(safe-area-inset-top) + 88px)!important;bottom:auto!important;left:50%!important;transform:translate(-50%,-14px)!important;width:max-content;max-width:min(92vw,620px)!important;padding:14px 20px!important;border-radius:16px!important;box-shadow:0 12px 34px rgba(0,0,0,.24)!important;z-index:100!important;font-size:1rem!important;font-weight:700!important;line-height:1.35!important}
.toast.show{transform:translate(-50%,0)!important}

/* Registration dialog: centered, viewport-safe, elderly-friendly */
#registerDialog{margin:auto!important;inset:0!important;width:min(680px,calc(100vw - var(--safe-left) - var(--safe-right)))!important;max-width:680px!important;max-height:calc(100dvh - var(--safe-top) - var(--safe-bottom))!important;border-radius:28px!important;overflow:hidden!important;background:#fff!important}
#registerDialog::backdrop{background:rgba(0,0,0,.46);backdrop-filter:blur(4px)}
#registerDialog .sheet-close{top:14px!important;right:14px!important;width:52px!important;height:52px!important;z-index:5}
#registerDialog .sheet-body{display:flex!important;flex-direction:column!important;max-height:calc(100dvh - var(--safe-top) - var(--safe-bottom))!important;overflow:hidden!important;padding:28px 22px 18px!important}
#registerDialog .sheet-body>.eyebrow{margin-right:64px!important}
#registerDialog .sheet-body>h2{margin:4px 68px 18px 0!important;font-size:clamp(1.7rem,5vw,2.2rem)!important;line-height:1.08!important}
#registerDialog #registerForm{min-height:0!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior:contain;display:grid!important;gap:14px!important;padding:2px 2px calc(10px + var(--safe-bottom)) 0!important}
#registerDialog #registerForm label{font-size:1rem!important;line-height:1.3!important}
#registerDialog #registerForm input:not([type="checkbox"]),#registerDialog #registerForm select{min-height:60px!important;margin-top:7px!important;padding:12px 15px!important;border-radius:17px!important;font-size:1rem!important;line-height:1.25!important}
#registerDialog .consent{grid-template-columns:38px 1fr!important;gap:12px!important;align-items:start!important;padding:6px 2px!important;line-height:1.42!important}
#registerDialog .consent input[type="checkbox"]{width:32px!important;height:32px!important;margin:3px 0 0!important}
#registerDialog .consent span{font-size:.96rem!important;font-weight:600!important}
#registerDialog #registerForm>button[type="submit"]{position:sticky!important;bottom:0!important;z-index:4!important;width:100%!important;min-height:64px!important;margin-top:4px!important;border-radius:19px!important;font-size:1.08rem!important;font-weight:800!important;box-shadow:0 -10px 24px rgba(255,255,255,.96),0 8px 24px rgba(252,76,2,.18)}

@media(max-width:600px){.home-events-only{padding-top:20px}.home-event-head{display:block}.home-event-head .icon-btn{margin-top:12px}.event-counts{grid-template-columns:1fr 1fr}.event-counts span{padding:11px 9px;font-size:.82rem}.event-footer .btn{width:100%;min-width:0}.profile-photo-editor{grid-template-columns:1fr;text-align:center}.profile-photo-preview{margin:auto}.profile-upload-button{width:100%!important}.brand{gap:8px}.brand-mark{width:54px;height:54px}.brand strong{font-size:.96rem!important}.brand small{font-size:.68rem!important}.qr-result-dialog{width:calc(100% - 24px)!important;max-height:calc(100dvh - 40px)!important}
.toast{top:calc(env(safe-area-inset-top) + 84px)!important;max-width:calc(100vw - 24px)!important;padding:13px 17px!important;font-size:.98rem!important}
#member .member-actions{grid-template-columns:1fr 1fr!important;gap:9px!important}
#member .member-actions .btn{min-height:54px!important;padding:10px 9px!important;font-size:.94rem!important;border-radius:17px!important}
#member #connectStravaBtn{grid-column:1/-1!important}
#registerDialog{width:calc(100vw - 20px)!important;max-height:calc(100dvh - var(--safe-top) - var(--safe-bottom) - 4px)!important;border-radius:24px!important}
#registerDialog .sheet-body{padding:22px 16px 14px!important;max-height:calc(100dvh - var(--safe-top) - var(--safe-bottom) - 4px)!important}
#registerDialog .sheet-body>h2{font-size:1.75rem!important;margin-bottom:14px!important}
#registerDialog #registerForm{gap:12px!important}
#registerDialog #registerForm label{font-size:1rem!important}
#registerDialog #registerForm input:not([type="checkbox"]),#registerDialog #registerForm select{min-height:58px!important;padding:11px 14px!important;font-size:1rem!important}
#registerDialog .consent{grid-template-columns:36px 1fr!important;gap:10px!important}
#registerDialog .consent input[type="checkbox"]{width:30px!important;height:30px!important}
#registerDialog .consent span{font-size:.93rem!important;line-height:1.4!important}
#registerDialog #registerForm>button[type="submit"]{min-height:62px!important;font-size:1.05rem!important;border-radius:18px!important}}

@media(max-width:380px){#member .member-actions{grid-template-columns:1fr!important}#member #connectStravaBtn{grid-column:auto!important}.profile-avatar-wrap{width:68px!important;height:68px!important;min-width:68px!important;flex-basis:68px!important}#registerDialog{width:calc(100vw - 12px)!important;border-radius:20px!important}#registerDialog .sheet-body{padding-left:13px!important;padding-right:13px!important}#registerDialog #registerForm{gap:10px!important}#registerDialog .consent span{font-size:.9rem!important}}
