/* StreetMate mobile-first layer. The primary canvas is 360–430 px. */
:root{--sm-gutter:16px;--sm-touch:44px;--sm-nav:72px}
html{min-width:320px;scroll-padding-top:72px;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{min-width:320px}img,svg,canvas{max-width:100%}button,select,input,textarea{max-width:100%}
button,.btn,input[type=button],input[type=submit],select{min-height:var(--sm-touch)}

@media(max-width:767px){
 body:not(.legal-page):not(.admin-locked){padding-bottom:calc(var(--sm-nav) + env(safe-area-inset-bottom))}
 body,p,li{overflow-wrap:anywhere}input,select,textarea{min-height:48px;font-size:16px!important}textarea{line-height:1.5}
 .btn{min-height:44px!important}
 .top,.route-page .top{min-height:62px;height:62px;padding:8px var(--sm-gutter);flex-wrap:nowrap;gap:10px}
 .top .logo,.route-page .logo{min-width:0;font-size:18px}.top .mark,.route-page .mark{width:36px;height:34px}
 .top .site-nav,.route-page .top .site-nav{display:none}.top .city-picker{min-width:112px;height:44px;margin-left:auto}.server-banner{top:62px}
 .mobile,.route-page .mobile{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));position:fixed;inset:auto 0 0;z-index:80;height:calc(var(--sm-nav) + env(safe-area-inset-bottom));padding:4px 4px env(safe-area-inset-bottom);border-top:1px solid #ffffff1f;background:#05080ef0;backdrop-filter:blur(22px);box-shadow:0 -16px 45px #0006}
 .mobile a,.mobile button{min-width:0;min-height:60px;padding:5px 1px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border:0;border-radius:13px;background:transparent;color:#ffffff94;font-size:9px;font-weight:800;line-height:1;text-decoration:none}
 .mobile a[aria-current=page]{color:var(--cyan);background:#25efff14}.mobile span{font-size:19px;line-height:1}
 .section,.route-main.has-content,.map-route{padding-left:var(--sm-gutter)!important;padding-right:var(--sm-gutter)!important}
 .section,.dashboard-section{padding-top:42px;padding-bottom:42px}.route-main.has-content{padding-top:38px;padding-bottom:46px}
 .route-main.has-content .route-intro{margin-bottom:32px;text-align:left}.route-icon{width:52px;height:52px;margin:0 0 18px;border-radius:16px}
 .route-main.has-content .route-intro h1,.venues-hero h1,.legal-hero h1,.legal-document h1{font-size:clamp(40px,13vw,56px);line-height:.96;letter-spacing:-.065em}
 .route-main.has-content .route-intro p,.venues-hero p,.legal-hero p{margin-top:14px;font-size:15px;line-height:1.55}
 .hero{padding:42px var(--sm-gutter) 36px}.hero h1{margin-block:14px 18px;font-size:clamp(45px,14vw,62px);line-height:.92}.hero>p{font-size:15px;line-height:1.55}
 .head,.dashboard-heading,.catalog-heading,.events-result-head,.signals-page-head{align-items:flex-start;flex-direction:column;gap:12px}
 .head h2,.dashboard-heading h2,.catalog-heading h2,.events-result-head h2,.signals-page-head h2{font-size:clamp(29px,9vw,38px);line-height:1}
 .search,.dashboard-search,.events-search,.catalog-search>div,.map-search{min-height:52px}.search{margin-top:24px;padding:8px}.search label{padding-inline:8px}
 .quick,.filters,.event-time-filters,.map-filter-quick{overscroll-behavior-inline:contain;scrollbar-width:none}
 .quick button,.chip,.event-time-filters button,.map-filter-body label>span{min-height:44px;padding-inline:13px}
 .dashboard-stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.dashboard-stats article{min-width:0;padding:14px 8px}
 .dashboard-venue-grid,.dashboard-event-grid,.signals-page-list,.events-grid,.venue-catalog-grid{grid-template-columns:1fr;gap:12px}
 .card,.dashboard-venue,.dashboard-event,.dashboard-signal,.route-signal-card,.event-card,.catalog-card{border-radius:20px}
 .catalog-card-visual,.event-card-accent{height:142px}.catalog-card.expanded .catalog-card-visual{height:160px}
 .catalog-card-body,.event-card-body,.route-signal-card,.dashboard-signal{padding:16px}.catalog-card-body h3,.event-card-title h3{font-size:21px}
 .catalog-card-footer{align-items:stretch;flex-direction:column}.catalog-card-footer .btn,.event-detail-toggle,.dashboard-detail-toggle{width:100%;min-height:46px;display:grid;place-items:center}
 .catalog-controls{grid-template-columns:1fr;gap:12px;margin:22px 0 38px;padding:12px;border-radius:20px}.catalog-search{grid-column:auto}.catalog-toggle{min-height:48px}
 .events-filters{align-items:stretch;flex-direction:column;margin:12px 0 30px}.event-time-filters{display:flex;flex-wrap:nowrap;margin-right:calc(var(--sm-gutter)*-1);padding-right:var(--sm-gutter);overflow-x:auto}.event-time-filters button{flex:0 0 auto}
 .events-filters label,.events-filters select{width:100%}.event-card-title{gap:8px}.event-inline-detail,.catalog-inline-detail{padding:20px 15px}
 .event-detail-facts,.inline-detail-facts,.dashboard-detail-facts,.venue-detail-facts,.venue-info-grid{grid-template-columns:1fr}
 .event-detail-actions,.inline-detail-actions,.dashboard-detail-actions,.venue-final-actions{display:grid;grid-template-columns:1fr;gap:8px}
 .event-detail-actions .btn,.inline-detail-actions .btn,.dashboard-detail-actions .btn,.venue-final-actions .btn{width:100%;min-height:48px;text-align:center}
 .venue-primary-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.venue-primary-action{min-height:92px;padding:12px 8px}.venue-gallery-grid,.similar-venues-grid{grid-template-columns:1fr 1fr}
 .sm-signal-dialog,.signal-dialog,.place-dialog,.account-dialog{width:100%;max-width:none;max-height:100dvh;height:100dvh;margin:0;border-radius:0}
 .sm-signal-dialog form,.signal-form{padding-bottom:calc(22px + env(safe-area-inset-bottom))}.sm-signal-actions,.signal-form-actions{position:sticky;bottom:0;padding-bottom:env(safe-area-inset-bottom);background:#080d16f5}
 .map-route{padding-top:24px!important;padding-bottom:22px!important}.map-route .route-intro{margin-bottom:20px!important}.map-toolbar{grid-template-columns:1fr}
 .map-search,.map-location-btn{height:50px;border-radius:14px}.map-location-btn{width:100%}
 .map-mode-switch{gap:5px;padding:5px;border-radius:17px}.map-mode-switch button{min-width:0;min-height:60px;padding:8px;grid-template-columns:30px 1fr;gap:2px 7px}.map-mode-switch button small{display:none}
 .map-filters summary{min-height:50px}.map-filter-body{padding:0 10px 12px}.map-filter-quick,.map-type-grid{display:flex;flex-wrap:nowrap;overflow-x:auto}.map-filter-body label{flex:0 0 auto}
 .map-filter-selects{grid-template-columns:1fr}.map-filter-selects button{grid-column:auto;width:100%;min-height:44px}
 .map-stage{height:max(480px,calc(100dvh - 270px));min-height:480px;border-radius:18px}
 .leaflet-control-zoom a,.leaflet-control-layers-toggle{width:44px!important;height:44px!important;line-height:44px!important}.streetmate-leaflet-popup .leaflet-popup-content{width:min(260px,calc(100vw - 56px))!important}
 .route-page footer,footer{padding:34px var(--sm-gutter) calc(34px + var(--sm-nav));flex-direction:column;gap:12px;text-align:center}
 .legal-main{width:calc(100% - 32px);padding:38px 0 78px}.legal-grid{grid-template-columns:1fr}.legal-card{min-height:220px;padding:18px}.legal-card p,.legal-copy{font-size:15px}.legal-card a,.legal-back{min-height:44px;align-items:center}
 .legal-page footer{padding-bottom:34px}
 body:has(.admin-shell){padding-bottom:0}.admin-top{min-height:58px!important;height:auto!important;padding:8px 10px!important;gap:8px!important}.admin-brand{flex:0 0 auto}.admin-top-actions{min-width:0;margin-left:auto;gap:6px}
 .account-switcher{min-width:0}.account-switcher select{width:min(48vw,180px);max-width:180px;min-height:44px;font-size:12px!important}.admin-top-actions a,.admin-top-actions button{min-width:44px;min-height:44px}
 .prototype-alert{min-height:48px;padding:9px 12px;align-items:flex-start;font-size:11px;line-height:1.45}.admin-shell{display:block}
 .admin-sidebar{min-height:0;padding:10px 0 8px;position:sticky;top:58px;z-index:22;border-right:0;border-bottom:1px solid var(--line);background:#070b12f5;backdrop-filter:blur(18px)}.admin-side-head{display:none}
 .admin-sidebar nav{display:flex;gap:6px;padding:0 10px;overflow-x:auto;scroll-snap-type:x proximity;scrollbar-width:none}.admin-sidebar nav button{width:auto;min-width:max-content;height:46px;padding:0 12px;flex:0 0 auto;scroll-snap-align:start;font-size:11px}
 .admin-main{padding:24px 10px 52px}.section-heading{min-height:0;margin-bottom:18px;align-items:stretch;flex-direction:column;gap:12px}.section-heading h2{font-size:34px}.section-heading p{font-size:13px;line-height:1.5}
 .section-actions{align-items:stretch;flex-direction:column}.admin-primary,.admin-search,.admin-search.small,[data-reset-access]{width:100%;min-height:46px}.admin-search input{min-height:42px}
 .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.metric-card{min-height:112px;padding:14px}.quick-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.quick-actions button{min-height:96px;padding:12px}
 .dashboard-grid,.city-grid,.insight-grid,.accounts-grid{grid-template-columns:1fr}.table-card{border-radius:16px}.table-meta{min-height:48px;padding:0 12px}.table-scroll{overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:thin}.table-scroll table{min-width:720px}
 .table-scroll th,.table-scroll td{padding:12px 10px;font-size:11px}.table-scroll td strong{font-size:12px}.row-actions button,.legal-actions button{min-width:44px;min-height:44px;font-size:10px}
 .admin-dialog,.admin-dialog:has(.dialog-section){width:100%;max-width:none;height:100dvh;max-height:100dvh;margin:0;border-radius:0}.admin-dialog form{min-height:100%;padding:18px 14px calc(20px + env(safe-area-inset-bottom))}
 .dialog-head{position:sticky;top:-18px;z-index:4;padding:12px 0;background:#0c1522}.dialog-head button{width:44px;height:44px;color:#fff}
 .dialog-fields,.seo-fields,.location-coordinates,.permission-add{grid-template-columns:1fr}.dialog-fields label.full,.seo-fields label:nth-child(2){grid-column:auto}.dialog-fields label,.field-help,.legal-markdown-help{font-size:12px;line-height:1.45}.dialog-fields input,.dialog-fields select,.dialog-fields textarea{min-height:48px}
 .dialog-section{padding:13px}.dialog-section-head{align-items:stretch;flex-direction:column}.dialog-section-head>button,.photo-upload{width:100%;min-height:44px;justify-content:center}.dialog-gallery{grid-template-columns:1fr 1fr}.hours-editor{grid-template-columns:1fr}.hours-day{padding:12px}.hours-day-head strong,.kitchen-toggle,.kitchen-until{font-size:12px!important}
 .hours-interval{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) 40px}.hours-interval button{width:40px;height:40px}
 .dialog-actions{position:sticky;bottom:calc(-20px - env(safe-area-inset-bottom));z-index:5;display:grid;grid-template-columns:1fr 1fr;margin:22px -14px calc(-20px - env(safe-area-inset-bottom));padding:12px 14px calc(12px + env(safe-area-inset-bottom));background:#070c14f7;border-top:1px solid var(--line)}.dialog-actions button{min-height:48px}
}

@media(min-width:768px){.mobile{display:none}.btn,button{touch-action:manipulation}}
@media(max-width:374px){:root{--sm-gutter:14px}.mobile a,.mobile button{font-size:8px}.mobile span{font-size:18px}.venue-primary-action{font-size:10px}}
