.mobile-menu-toggle{display:none}
@media(max-width:700px){
 html{scroll-padding-top:120px}
 .mobile-menu-toggle{display:flex;width:100%;align-items:center;justify-content:center;min-height:44px;background:white;border:1px solid var(--line);border-radius:12px;font-size:16px}
 .signed-in .left-sidebar:not(.mobile-menu-open) #navigation{display:none}
 .left-sidebar.mobile-menu-open #navigation{margin-top:8px}
 /* A 16px input prevents focus zoom in iPhone Safari. */
 body input:not([type=checkbox]):not([type=radio]),body select,body textarea,
 #post-form .composer-settings select,#post-visibility,#post-topic,.header-search input{font-size:16px!important;min-width:0;max-width:100%}
 input:not([type=checkbox]):not([type=radio]):not([type=file]),select{min-height:44px}
 textarea{scroll-margin-block:130px 24px}
 .header-notifications,.header-messages{width:44px;height:44px;flex-basis:44px}
 .topbar button.brand{min-width:120px}.brand strong{font-size:22px}
 .reaction-panel .reaction-icon{width:44px;height:44px;flex-basis:44px}.reaction-icons{flex-wrap:wrap;gap:2px}
 .comments-section>.text-button,.social-actions button,.comment-actions button,.rail-heading button,.event-views button,.explore-tabs button,.journey-filters button,.journey-tabs button{min-height:44px}
 .rail-dog-controls button{width:44px;height:44px;min-height:44px}
 .leaflet-control-zoom a{width:44px!important;height:44px!important;line-height:44px!important}
 dialog[open]{box-sizing:border-box;position:fixed;top:calc(var(--mobile-view-top,0px) + 12px);bottom:auto;left:0;right:0;margin:0 auto;width:calc(100% - 24px);max-width:calc(100% - 24px);max-height:calc(var(--mobile-view-height,100dvh) - 24px);overflow-y:auto;overscroll-behavior:contain;padding:18px;padding-bottom:max(18px,env(safe-area-inset-bottom))}
 dialog button[aria-label*="Zavřít"],dialog .dialog-close,.journey-detail-close{min-width:44px;min-height:44px}
 dialog .dialog-actions{display:flex;flex-wrap:wrap;gap:8px}dialog .dialog-actions>button{flex:1 1 140px;min-height:44px;white-space:normal}
 .group-invite-person{flex-wrap:wrap}.group-invite-person>span{min-width:0;overflow-wrap:anywhere}.group-invite-person small{flex-basis:100%;margin-left:28px}
 .group-proposal-row .dialog-actions{width:100%}.group-proposal-row .dialog-actions button{white-space:normal}
 .event-filter label,.explore-tools label{min-width:0!important;flex:1 1 140px}.event-filter .city-input,.explore-tools label:first-child{flex-basis:100%}
 .event-dialog label,.event-dialog select{max-width:100%;min-width:0}.event-card{gap:10px}
 .map-controls{min-width:0}.dog-map-canvas,.explore-map{height:clamp(240px,42svh,350px)}
 .explore-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.explore-tabs button{white-space:normal}
 .chat-thread{scroll-margin-top:120px}.chat-thread-head{flex-wrap:wrap}.chat-thread-head h2{min-width:0;overflow-wrap:anywhere;flex:1 1 140px}
 .chat-messages{max-height:clamp(140px,35dvh,350px);overscroll-behavior:contain}
 .chat-compose textarea{min-height:88px;max-height:30dvh;box-sizing:border-box}.chat-compose>.primary{min-height:44px;width:100%}
 .chat-starters summary{min-height:44px;display:flex;align-items:center;cursor:pointer;color:#287d4c;font-weight:600}.chat-starters[open] summary{margin-bottom:8px}
 .chat-starters .chat-quick{margin-top:8px}.chat-quick button{min-height:44px}
 .post-photo-previews{min-width:0}.post-photo-preview .remove-photo{min-width:44px;min-height:44px}
 .chat-conversation{flex-wrap:wrap}.chat-conversation>span{min-width:0;overflow-wrap:anywhere}
}

@media(max-width:700px){
 .signed-in .topbar{display:grid;grid-template-columns:minmax(88px,1fr) 44px 44px 64px 44px;gap:4px 2px;padding:8px 10px}
 .signed-in .topbar .brand{grid-column:1;grid-row:1;min-width:0;padding:0;gap:3px}.signed-in .brand strong{font-size:20px}.signed-in .topbar .brand img{width:26px;height:26px}
 .signed-in .header-notifications{grid-column:2;grid-row:1}.signed-in .header-messages{grid-column:3;grid-row:1}
 .signed-in .header-journey{grid-column:4;grid-row:1;min-width:0;gap:2px;padding:0;justify-content:center}.signed-in .header-journey strong{font-size:11px}
 .signed-in .header-profile{grid-column:5;grid-row:1;margin:0;min-height:44px;justify-content:center}
 .signed-in .header-search{grid-column:1/-1;grid-row:2;width:100%;margin-top:2px}
 .explore-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.explore-tools label:first-child,.explore-tools label:nth-child(2){grid-column:1/-1}.explore-tools>button{min-height:44px;white-space:normal}
}
@media(max-width:360px){.signed-in .brand strong{font-size:17px}.signed-in .topbar .brand img{display:none}.signed-in .brand small{font-size:10px}}

@media(max-width:700px){.signed-in .topbar .header-notifications,.signed-in .topbar .header-messages{width:44px;height:44px;padding:9px;min-height:44px}}

@media(max-width:700px){dialog>button,dialog form button,.post-photo-picker>button{min-height:44px}.photo-lightbox-bar{flex-wrap:wrap}.photo-lightbox-bar button{min-width:44px;min-height:44px}}
/* Mobile information hierarchy: primary content first, optional controls on demand. */
.mobile-toolbar,.mobile-search-toggle{display:none}
@media(min-width:701px){.mobile-fold>summary{display:none}.mobile-fold{display:contents}}
@media(max-width:700px){
 .mobile-toolbar{display:flex;gap:8px}.mobile-toolbar>button{flex:1;min-width:0;min-height:44px;font-size:14px;margin:0}.mobile-search-toggle{display:block}
 .signed-in:not(.mobile-search-open) .header-search{display:none}
 .signed-in .topbar{min-height:60px;padding-top:6px;padding-bottom:6px}.signed-in .brand small{display:none}
 .signed-in .left-sidebar nav{grid-template-columns:repeat(2,minmax(0,1fr));padding:8px 0;gap:6px}
 .left-sidebar .nav-button{flex-direction:row;justify-content:flex-start;min-height:48px;gap:8px;padding:8px;font-size:14px;text-align:left}
 .left-sidebar #signout{min-height:44px;grid-column:1/-1}
 #navigation .demo-controls{grid-column:1/-1;margin:4px 0 0;padding:12px;gap:4px}#navigation .demo-controls label{font-size:14px}#navigation .demo-controls small{font-size:12px}
 .workspace-heading{padding:14px 16px;gap:8px;margin-bottom:12px;flex-wrap:wrap}.workspace-heading h1{font-size:24px;margin:0}.workspace-heading .lead{font-size:14px;margin:6px 0 0;line-height:1.4}
 body[data-page=journey] .workspace-heading{display:none}
 .mobile-fold{border:1px solid var(--line);border-radius:12px;background:#fff;margin:0 0 12px;min-width:0}
 .mobile-fold>summary{cursor:pointer;padding:12px 14px;min-height:44px;box-sizing:border-box;color:#246c42;font-size:14px;font-weight:650;line-height:20px}
 .mobile-fold[open]>summary{border-bottom:1px solid var(--line);margin-bottom:10px}
 .mobile-fold>.explore-filters{padding:0 12px 12px}.mobile-fold>.journey-goal-list{padding:0 12px 12px}
 .first-steps{padding:14px;margin-bottom:12px}.first-steps h2{font-size:18px}.first-steps>p{font-size:14px;margin:6px 0 10px}.first-steps .mobile-fold{margin:0;border:0;background:#f5faf6}.first-steps-list{padding:0 12px 12px}
 .feed-hero{min-height:180px;margin-bottom:12px}.hero-body{max-width:72%;padding:20px 16px}.hero-body h1{font-size:24px;max-width:230px;margin:0 0 12px}.hero-body p,.hero-shortcuts{display:none}.hero-actions{flex-direction:column;align-items:flex-start;gap:6px}.hero-actions button{font-size:13px;min-height:44px;padding:8px 12px}
 .journey-heading{padding:16px 16px 0;align-items:center}.journey-heading h2{font-size:24px}.journey-heading p,.journey-preview{display:none}.journey-level{font-size:18px;padding:9px 12px}
 .journey-stage{min-height:160px}.journey-puppy-slot{flex-basis:160px}.journey-stage>.journey-puppy,.journey-stage>.journey-video{width:160px;height:160px}
 .has-won-award .journey-puppy-slot{flex-basis:180px}.journey-won-award{flex-basis:100px}.journey-won-award img{height:100px}
 .journey-goals{margin:0 16px 12px}.journey-goals>h3{display:none}.journey-goals .mobile-fold{margin:0}
 .journey-progress{padding-bottom:12px}.journey-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:0 16px 10px}.journey-filters button{padding:8px 3px;font-size:13px;white-space:normal}
 .journey-award{min-height:150px;padding:10px 6px}.journey-award img{height:78px;width:74px}.journey-category{margin-top:0}
 .explore-page>p:first-child{font-size:14px;line-height:1.4;margin:0}.explore-tools{gap:8px}.explore-tools label:first-child{grid-column:1}.explore-tools label:nth-child(2){grid-column:2}.explore-tools input,.explore-tools select{width:100%;box-sizing:border-box}.explore-tabs{gap:6px}.explore-tabs button{font-size:14px}
 .right-sidebar{gap:12px}.form-card{padding:16px}.form-intro{gap:10px}.form-intro h2{font-size:22px}.form-intro p{font-size:14px}
 .social-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}.social-actions button{font-size:13px;padding:8px 3px;white-space:normal}
}
@media(max-width:700px){
 #profile-section:not([hidden]){display:flex;flex-direction:column;gap:12px}#profile-section>.avatar-editor{order:-3}#profile-form{order:-2}#profile-section>.invite-entry{order:2;margin:0}
 .avatar-editor{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center}.avatar-editor>h2{font-size:19px;margin:0}.avatar-editor>div{grid-column:2;grid-row:1}.avatar-editor .person-avatar-large{width:56px;height:56px;font-size:20px;margin:0}.avatar-editor>.mobile-fold{grid-column:1/-1;margin:0}.avatar-editor .mobile-fold>form{padding:0 12px 12px}
 .mobile-fold>.event-filter{border:0;margin:0;padding:0 12px 12px}
 .explore-tools{grid-template-columns:minmax(0,1.6fr) minmax(0,1fr)}
}
@media(min-width:361px) and (max-width:700px){#post-form .composer-settings{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}#post-form .composer-settings label{font-size:13px}}
.mobile-fold:has(>.event-filter[hidden]){display:none}
@media(max-width:700px){.events-page{gap:12px}.events-page>p.muted{font-size:14px;line-height:1.45;margin:0}.events-page>.notice:empty{display:none}}
@media(max-width:700px){
 #map-section>.social-card>h2{display:none}#map-section>.social-card>.mobile-fold>p{padding:0 12px 12px;font-size:14px;margin:0}
 .map-controls{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:8px}.map-controls>*{min-width:0}.map-controls input,.map-controls select{width:100%;box-sizing:border-box}
 #map-section .social-actions{grid-template-columns:repeat(2,minmax(0,1fr));margin:10px 0}#map-section .social-actions button{font-size:14px}
}
/* Care, rescue and account screens keep their actions readable on phones. */
@media(min-width:701px){.adoption-management{display:flex;gap:10px;flex-wrap:wrap}}
@media(max-width:700px){
 .adoption-management{display:grid;gap:8px;padding:0 12px 12px}.adoption-management button{min-height:44px;white-space:normal}
 .adoption-page>.adoption-actions>button{width:100%;min-height:44px}.adoption-page>.mobile-fold{margin:0}
 .adoption-page>p,.lost-page>p{font-size:14px;line-height:1.45;margin:0}
 .adoption-actions button,.lost-actions button,.lost-watch{min-height:44px;font-size:14px}
 .lost-page{gap:12px}.lost-page .event-views{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.lost-page .event-views button{font-size:14px;white-space:normal}
 .lost-page .event-filter{display:grid;grid-template-columns:minmax(0,1fr) auto;padding:12px;gap:8px}.lost-page .event-filter label{min-width:0!important}.lost-page .event-filter input{width:100%;box-sizing:border-box}
 .mobile-fold>.lost-watches{padding:0 12px 12px}.lost-watches button{min-height:44px;font-size:14px}
 dialog.event-dialog .dialog-actions{position:static;bottom:auto;margin-top:12px;padding-top:12px}
 dialog form>h2{padding-top:0;margin-top:0;font-size:23px;line-height:1.25}
 dialog form{min-width:0}dialog input,dialog select,dialog textarea{box-sizing:border-box;max-width:100%;min-width:0}
 .adoption-form,.lost-form{gap:12px}.adoption-form label,.lost-form label{margin:0;gap:6px}.adoption-form p,.lost-form p{font-size:14px;line-height:1.5}
 .health-dialog .dialog-heading{gap:8px;align-items:flex-start}.health-dialog h2{font-size:22px;line-height:1.25;margin:0}.health-dialog .icon-button{flex:0 0 44px;min-width:44px;min-height:44px}
 .health-privacy{font-size:14px!important;line-height:1.5!important;padding:12px;margin:14px 0}
 .health-section{margin-top:18px;padding-top:14px}.health-section .social-toolbar{padding:0;border:0;box-shadow:none;border-radius:0;background:transparent;gap:8px;margin-bottom:4px}.health-section h3{font-size:18px}.health-section>button{min-height:44px;margin:0}.health-section p{margin:6px 0;font-size:14px}
 .health-editor:not(:empty){margin:14px 0;padding:12px}.health-editor form{gap:12px}.health-editor .dialog-actions{gap:8px}.health-record{padding:12px 0}
 .account-preferences{margin-top:0}.account-preferences .mobile-fold{margin:0}.account-preferences .preference-group{border:0;padding:0 12px 12px;gap:4px}.account-preferences .preference-group legend{display:none}.preference-check{min-height:44px;padding:6px 0;font-size:15px;line-height:1.4}.account-preferences .muted{font-size:14px}.account-preferences>button{min-height:44px;width:100%}
}
.persistent-dialog-close{position:sticky!important;top:-24px;z-index:100;display:flex!important;align-items:center;justify-content:flex-end;gap:12px!important;min-height:48px;margin:-8px 0 8px!important;padding:4px 0;background:var(--surface,#fff);width:100%;box-sizing:border-box;float:none!important}
.persistent-dialog-close button{display:grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;border:1px solid #dce7df;border-radius:50%;background:#f1f6f3;color:#264d37;font-size:28px;padding:0;line-height:1;cursor:pointer}.persistent-dialog-close button:focus-visible{outline:3px solid #278d50;outline-offset:2px}.persistent-dialog-close span{font-size:14px;color:#476351}.persistent-dialog-close button:disabled{cursor:wait;opacity:.6}
.mobile-fold:has(>.adoption-management[hidden]){display:none}.adoption-management[hidden]{display:none!important}
@media(max-width:700px){dialog[open]>.persistent-dialog-close{top:-18px;margin-top:-18px!important;padding-top:4px;padding-bottom:4px}.adoption-page>.text-button{min-height:44px}}
.persistent-dialog-close~.dialog-heading>button[aria-label^="Zavřít"],.persistent-dialog-close~.notification-heading>button[aria-label^="Zavřít"]{display:none}
dialog:has(>.persistent-dialog-close)>.journey-detail-close,dialog:has(>.persistent-dialog-close)>.icon-button[aria-label^="Zavřít"]{display:none}

/* Keep the original control as fallback if the shared close bar is unavailable. */
dialog:has(>.persistent-dialog-close) .dialog-close-fallback{display:none!important}
dialog:has(>.persistent-dialog-close)>.adoption-case-top{position:static}
