/* v23 layout authority. Legacy styles.css continues to own detail/photo/recovery components. */
:root{--safe-left:env(safe-area-inset-left,0px);--safe-right:env(safe-area-inset-right,0px);--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--header-height:50px;--nav-height:56px;--nav-space:calc(var(--nav-height) + var(--safe-bottom));--viewport-height:100dvh}
html.keyboard-open{--nav-space:0px}
html.keyboard-open .bottom-nav{display:none}
.shell:not(.map-shell){padding:var(--safe-top) max(12px,var(--safe-right)) calc(var(--nav-space) + 16px) max(12px,var(--safe-left))}
.shell:not(.map-shell) .masthead,.shell.map-shell .masthead{height:var(--header-height);min-height:var(--header-height);padding:0 2px;border:0;gap:8px;background:var(--bg)}
.shell .masthead .logo{font-size:18px;gap:8px;letter-spacing:-.3px;min-width:0}
.shell .masthead .logo-mark{width:32px;height:32px;object-fit:contain;border-radius:0;background:none}
.shell .masthead .icon-btn{width:44px;height:44px;min-width:44px;padding:0;border:0;background:none;display:grid;place-items:center;color:var(--ink)}
.bottom-nav{bottom:max(0px,calc(100dvh - var(--viewport-height) - var(--viewport-top,0px)));height:var(--nav-space);padding:0 0 var(--safe-bottom);background:var(--paper);z-index:30}
.bottom-nav>.inner{height:var(--nav-height);display:grid;grid-template-columns:repeat(3,minmax(0,1fr));padding-left:var(--safe-left);padding-right:var(--safe-right)}
.bottom-nav button{min-height:44px;padding:4px;gap:2px;font-size:11px;line-height:1.3}
.bottom-nav button svg{width:19px;height:19px}
.bottom-nav button.active{background:#fff5f7;color:#a34d64}
/* Map: three 44px rows; variable details scroll inside the bounded toolbar. */
.shell.map-shell{height:calc(var(--viewport-height) - var(--nav-space));padding:var(--safe-top) 0 0;min-height:0;overflow:hidden}
.shell.map-shell .masthead{padding-left:max(12px,var(--safe-left));padding-right:max(12px,var(--safe-right))}
.map-shell .map-toolbar{margin:4px max(8px,var(--safe-right)) 0 max(8px,var(--safe-left));padding:3px 5px;border-radius:13px;max-height:48%;overflow:auto;scrollbar-width:thin;overscroll-behavior:contain}
.map-shell .map-mode-row{gap:4px}
.map-shell .map-modes{gap:3px}
.map-shell .map-modes button{min-height:44px;font-size:12px;padding:3px 8px;border-radius:9px}
.map-shell .map-manage-open{min-width:44px;min-height:44px;padding:0;display:grid;place-items:center}
.map-shell .map-top{margin:0;gap:4px;align-items:center}
.map-shell .map-top .map-input{min-height:44px;font-size:16px;padding:8px 10px;border-radius:9px}
.map-shell .map-top .primary-btn{min-width:48px;min-height:44px;padding:5px 8px;font-size:14px}
.map-shell .map-chips{gap:2px;flex-wrap:nowrap}
.map-shell .map-chip{min-height:44px;min-width:44px;padding:3px 4px;font-size:12px;border-radius:9px}
.map-shell .destination-selection{margin:2px 0;padding:3px 5px;display:grid;grid-template-columns:minmax(0,1fr) minmax(88px,112px);gap:1px 4px}
.map-shell .destination-selection strong,.map-shell .destination-selection span{grid-column:1;min-width:0;overflow-wrap:anywhere;font-size:12px;line-height:1.4}
.map-shell .destination-selection button{grid-column:2;grid-row:1/3;min-height:44px;max-width:112px;min-width:0;font-size:12px;padding:4px;white-space:normal;overflow-wrap:anywhere;line-height:1.3}
.map-shell .near-radii{margin:0;gap:3px}
.map-shell .near-radii button{min-height:44px;padding:3px;font-size:12px}
.map-shell .near-explanation{font-size:11px;line-height:1.35;margin:2px 0}
.map-shell .destination-search-status:not(:empty),.map-shell .map-service-error:not(:empty){font-size:12px;line-height:1.5;padding:6px;margin:2px 0}
.map-shell .destination-candidates{margin:2px 0}.map-shell .destination-candidates button{min-height:44px;padding:6px}
.map-shell .map-result-sheet{left:var(--safe-left);right:var(--safe-right);padding:0 12px;border-radius:18px 18px 0 0}
.map-shell .map-sheet-top{height:44px;min-height:44px;justify-content:center}
.map-shell .map-sheet-grip{width:100%;height:44px;min-height:44px;min-width:44px;margin:0;padding:0;touch-action:none}
.map-sheet-grip span{width:32px;height:4px;border-radius:4px}
.map-shell .map-sheet-heading{margin:0 0 2px}
.map-shell .map-sheet-heading h3{font-size:13px;line-height:1.3}
.map-shell .map-progress{margin:1px 0 0;gap:8px;line-height:1.3;font-size:11px}
.map-shell .map-progress strong{font-size:11px}.map-shell .map-progress span{font-size:11px}
.map-shell .map-row{padding:2px 0;gap:4px}
.map-shell .map-row-main{min-height:44px;gap:0;padding:1px 0}
.map-shell .map-row-title{font-size:13px;line-height:1.4}
.map-shell .map-row small{font-size:11px;line-height:1.3}
.map-shell .map-row-buttons button{min-width:44px;min-height:44px;padding:3px;font-size:12px}
.map-shell .map-sheet-scroll{padding-bottom:8px;scroll-padding-top:4px}
.map-shell .map-reset{bottom:calc(var(--sheet-height,136px) + 8px);right:8px;min-height:44px;padding:6px 10px;font-size:12px}
.map-shell .leaflet-top{top:var(--toolbar-bottom,148px)}
.map-shell .leaflet-control-zoom{margin-top:0}.map-shell .leaflet-control-zoom a{width:44px;height:44px;line-height:44px}
.map-shell .map-management{inset:4px max(4px,var(--safe-right)) 4px max(4px,var(--safe-left));padding:8px}.map-management .map-input{font-size:16px}.map-management>header{top:-8px;padding:3px 0}
/* Explore/visits: two compact control rows with native-size input text. */
.explore-controls{margin:4px 0 12px;padding:0;border:0;background:none}
.explore-controls .toolbar{display:flex;align-items:center;flex-wrap:nowrap;margin:0;gap:4px;padding:0;background:none}
.explore-controls .searchbox{flex:1;min-width:0;max-width:none;flex-basis:auto}
.explore-controls .searchbox input{min-height:44px;font-size:16px;padding:9px 6px 9px 28px;line-height:1.4;border-radius:11px}
.explore-controls .searchbox:before{left:8px}
.explore-controls .radius-tabs{flex:0 0 auto;width:auto;display:flex;gap:0;border:0;padding:0;background:none}
.explore-controls .radius-tabs button{min-width:44px;min-height:44px;font-size:13px;padding:4px;border-radius:9px}
.explore-controls .power-filter{flex:0 0 44px;width:44px;min-width:44px;min-height:44px;padding:0;border:1px solid #dce2d7;border-radius:10px;background:var(--paper);display:grid;place-items:center;color:var(--ink)}
.explore-controls .power-filter[aria-pressed=true]{background:#ddebd9;border-color:#7d9c78;box-shadow:inset 0 0 0 1px #7d9c78;color:#284b35}
.filter-strip{display:flex;align-items:center;gap:6px;margin-top:3px;min-width:0}
.explore-controls .chipbar{flex:1;min-width:0;display:flex;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;padding:0;gap:3px;scrollbar-width:none;touch-action:pan-x pan-y pinch-zoom;overscroll-behavior-x:contain}
.explore-controls .chip{flex:0 0 auto;min-height:44px;min-width:44px;padding:6px 10px;font-size:13px;border-radius:20px;white-space:nowrap}
.explore-controls .saved-filter{padding:0;width:44px;font-size:23px}
.explore-controls select{flex:0 0 136px;max-width:136px;min-width:0;min-height:44px;font-size:16px;line-height:1.4;text-align:center;text-align-last:center;appearance:none;-webkit-appearance:none;border:1px solid #dce2d7;border-radius:10px;background:var(--paper);color:var(--ink);padding:6px 8px}
.discovery-section{margin:0 0 14px}.discovery-heading{gap:6px;margin-bottom:4px;min-height:44px}.discovery-heading h2{font-size:18px}
.discovery-shuffle{flex:0 0 44px!important;width:44px;min-height:44px;max-width:44px;border-radius:50%;display:grid;place-items:center;padding:0;border:1px solid #d6dfd1;background:var(--paper);box-shadow:0 2px 5px #3c594d12}
.discovery-shuffle:active{transform:translateY(1px);background:#edf6ee;box-shadow:0 1px 2px #3c594d0d}
.discovery-content,.photo-card .c-body{padding:12px;gap:5px}
.discovery-content h3,.photo-card .c-body h3{font-size:17px;line-height:1.45;overflow-wrap:anywhere}
.discovery-why,.photo-card .c-sub{font-size:13px;line-height:1.6}
.cafe-area{font-size:12px;line-height:1.45}.transport-chip.home{font-size:15px}
.cafe-actions{padding-top:6px;gap:5px}.cafe-actions button{min-height:44px;padding:6px 9px;font-size:13px}
.explore-area .section-head{margin:0 0 6px;gap:6px;min-height:30px}.explore-area .section-head h2{font-size:17px}.section-head .count{font-size:12px;padding:2px 0;background:none}
.cards{gap:10px}.unverified-cafes{margin-top:18px;padding-top:12px}.unverified-cafes .section-head{margin-bottom:8px}
.cafe-state{line-height:1.5;gap:3px 9px}.visit-note-preview{flex-basis:100%;font-size:13px;color:#4d6256;line-height:1.5;margin:2px 0 0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.empty{padding:18px;min-height:0}.empty h3{font-size:16px}.empty p{font-size:13px}
.settings-modal{height:auto;min-height:0;max-width:520px;border-radius:18px}
/* Settings stays small; restore/recovery warning text is deliberately untouched. */
.settings-modal .modal-head{padding:12px 16px}.settings-modal .modal-head h2{font-size:18px}.settings-modal .close{min-width:44px;min-height:44px}
.settings-modal .detail-body{padding:8px 16px 16px}.settings-modal .setting-card{padding:0;margin:0;border:0;background:none;box-shadow:none}
.settings-modal .setting-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.settings-modal .setting-actions button{min-height:44px;font-size:13px;padding:6px 4px;white-space:normal}
.modal,.image-viewer{max-height:calc(var(--viewport-height) - var(--safe-top) - var(--safe-bottom) - 16px)}
.overlay{top:var(--viewport-top,0px);bottom:auto;height:var(--viewport-height);padding-top:calc(var(--safe-top) + 8px);padding-bottom:calc(var(--safe-bottom) + 8px);align-items:center}
.modal input:not([type=checkbox]):not([type=radio]),.modal textarea,.modal select{font-size:16px}
@media(min-width:700px){.map-shell .map-toolbar{width:390px}.map-shell .map-result-sheet{width:440px;max-width:440px}.cards{gap:12px}}
@media(max-height:480px){.map-shell .map-toolbar{max-height:44%;width:56%;margin:3px}.map-shell .map-sheet-heading h3{font-size:12px}.map-shell .map-result-sheet{padding:0 8px}.map-shell .leaflet-control-zoom a{min-height:44px}.map-shell .masthead{min-height:var(--header-height)}}
@media(prefers-reduced-motion:reduce){.discovery-shuffle:active{transform:none}}

/* Keep personal-photo previews compact without changing stored photo data. */
.photo-card .cover{height:64px;min-height:0;aspect-ratio:auto}.discovery-card .discovery-picture{height:64px;min-height:0;aspect-ratio:auto}



@media(min-width:700px){.map-shell .leaflet-top.leaflet-left{left:auto;right:max(8px,var(--safe-right));top:8px}.map-shell .map-reset{right:max(8px,var(--safe-right));bottom:8px}}
