/* Navigation uses the shared tokens; icon artwork is independent of the 48px hit area. */
body.app-shell-nav-mode #app-bottom-nav,body.my-page-mobile-mode #my-page-bottom-nav {grid-template-columns:repeat(4,minmax(0,1fr));gap:0;}
.app-bottom-nav-btn.app-bottom-nav-create .app-bottom-nav-icon {display:grid;place-items:center;width:24px;height:24px;border-radius:8px;background:#e5f0ec;color:#145c68;}
.app-bottom-nav-create .app-bottom-nav-label {font-size:11px;}
.app-bottom-nav-create svg {width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;}
.contribution-dialog {box-sizing:border-box;width:min(440px,calc(100% - 32px));max-height:calc(var(--mobile-visible-height,100dvh) - 32px);padding:16px;border:1px solid #d9e4de;border-radius:20px;background:var(--bm-paper,#fcfaf5);color:var(--bm-ink,#183e47);overscroll-behavior:contain;}
.contribution-dialog::backdrop {background:#183e4770;}
.contribution-dialog header {display:flex;align-items:center;gap:16px;margin-bottom:16px;}
.contribution-dialog h2 {flex:1;margin:0;font:700 20px/1.4 system-ui;}
.contribution-dialog button {min-height:48px;border:1px solid #72888c;border-radius:12px;background:#fff;color:#183e47;font:600 16px/1.5 system-ui;cursor:pointer;}
.contribution-dialog [data-contribution-close] {width:48px;flex:none;}
.contribution-dialog [data-contribution-choices] {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.contribution-dialog [data-contribution-action] {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-width:0;min-height:96px;text-align:center;padding:12px 8px;background:#fff;border-color:#b8ccca;}
.contribution-dialog [data-contribution-action] svg {width:24px;height:24px;color:#1c6370;}
.contribution-dialog [data-contribution-action] span {overflow-wrap:anywhere;}
.contribution-dialog [data-contribution-action]:hover {background:#eaf3ef;border-color:#1c6370;}
.contribution-dialog :focus-visible,#map-heatmap-control:focus-visible {outline:3px solid #1c6370;outline-offset:3px;}
#current-location-fab #map-heatmap-control,#current-location-fab #current-location-fab-btn {box-sizing:border-box;display:grid;place-items:center;width:48px;height:48px;min-height:48px;padding:0;border:1px solid #d9e4de;border-radius:50%;background:linear-gradient(180deg,#ffffffed,#eef4f6ed);color:#183e47;box-shadow:0 2px 8px #183e4714;touch-action:manipulation;}
#map-heatmap-control svg {width:24px;height:24px;stroke:none;}
#current-location-fab #map-heatmap-control[aria-pressed=true] {background:#e5f0ec;border-color:#1c6370;box-shadow:0 0 0 2px #1c637033;}
#region-picker-trigger.needs-country {outline:3px solid #a64e2f;outline-offset:3px;animation:country-cue 600ms ease-in-out 2;}
@keyframes country-cue {50% {box-shadow:0 0 0 7px #a64e2f30;}}
@media(prefers-reduced-motion:reduce) {#region-picker-trigger.needs-country {animation:none;}}
#map-contribution-pick {position:static;z-index:360;top:calc(env(safe-area-inset-top,0px) + 150px);left:max(16px,env(safe-area-inset-left,0px));right:max(16px,env(safe-area-inset-right,0px));display:flex;align-items:center;gap:12px;padding:12px;border:1px solid #72888c;border-radius:12px;background:#fcfaf5;color:#183e47;font:400 14px/1.5 system-ui;}
#map-contribution-pick span {flex:1;}
#map-contribution-pick button {min-height:48px;padding:8px 12px;border:1px solid #72888c;border-radius:12px;background:#fff;color:#183e47;font:inherit;}
@media(max-height:500px) {.contribution-dialog {margin:16px auto;}.contribution-dialog [data-contribution-choices] {grid-template-columns:1fr 1fr;}#map-contribution-pick {top:calc(env(safe-area-inset-top,0px) + 76px);left:auto;width:min(360px,45vw);}}

#header #map-contribution-pick {position:static;box-sizing:border-box;width:100%;grid-column:1/-1;flex-basis:100%;margin-top:8px;}

/* Equal-height actions keep attribution clear of the fixed bar. */
body.app-shell-nav-mode #app-bottom-nav {box-sizing:border-box;height:var(--app-bottom-nav-height);}
body.app-shell-nav-mode #app-bottom-nav .app-bottom-nav-btn {min-height:48px;padding:3px 2px;}
body.app-shell-nav-mode #map-credits {max-width:calc(100vw - 24px);}
body.app-shell-nav-mode.protomaps-basemap #map-credits span {padding:0;}
body.app-shell-nav-mode #legal-stack {bottom:calc(var(--app-bottom-nav-height) + 12px);}

#current-location-fab.is-active #current-location-fab-btn {background:#e5f0ec;border-color:#1c6370;}

/* Heatmap state uses text and a check, as well as a high-contrast warm surface. */
#current-location-fab #map-heatmap-control{position:relative}
#map-heatmap-control [data-heatmap-state],#map-heatmap-control [data-heatmap-check]{display:none}
#current-location-fab #map-heatmap-control[aria-pressed=true]{display:flex;flex-direction:column;justify-content:center;gap:0;background:#a44c29;color:#fff;border:2px solid #fff;box-shadow:0 0 0 2px #a44c29,0 4px 12px #48230f38}
#map-heatmap-control[aria-pressed=true] svg{width:23px;height:23px}
#map-heatmap-control[aria-pressed=true] [data-heatmap-state]{display:block;font:800 10px/12px system-ui;letter-spacing:.04em;color:#fff}
#map-heatmap-control[aria-pressed=true] [data-heatmap-check]{display:grid;place-items:center;position:absolute;top:-5px;right:-5px;width:17px;height:17px;border:2px solid #fff;border-radius:50%;background:#183e47;color:#fff;font:800 11px/1 system-ui}
#map-heatmap-control[aria-busy=true] [data-heatmap-check]{font-size:0;background:#a44c29;border-color:#fff5;border-top-color:#fff;animation:heatmap-loading .8s linear infinite}
#heatmap-toggle[aria-pressed=true]{background:#a44c29;color:#fff;border-color:#a44c29}
@keyframes heatmap-loading{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){#map-heatmap-control[aria-busy=true] [data-heatmap-check]{animation:none}}

/* Four equal destinations; personal trips stay prominent at the left. */
body.app-shell-nav-mode #app-bottom-nav .app-bottom-nav-btn{display:grid;grid-template-rows:38px auto;justify-items:center;align-content:center;gap:3px;}
body.app-shell-nav-mode #app-bottom-nav .app-bottom-nav-icon{align-self:center;}
body.app-shell-nav-mode #app-bottom-nav [data-app-nav="contribute"] .app-bottom-nav-icon{background:transparent;}
body.app-shell-nav-mode #app-bottom-nav [data-app-nav="trips"] .app-bottom-nav-icon{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:#204f58;color:#fff;opacity:1;}
body.app-shell-nav-mode #app-bottom-nav [data-app-nav="trips"].is-active .app-bottom-nav-icon{border-radius:50%;background:#176b78;box-shadow:0 0 0 3px #e1eeeb;}
body.app-shell-nav-mode #app-bottom-nav [data-app-nav="trips"] .app-bottom-nav-label{font-weight:700;color:#204f58;}
body.app-shell-nav-mode #app-bottom-nav .app-bottom-nav-label{font-size:12px;line-height:15px;}
body.app-shell-nav-mode #app-bottom-nav .app-bottom-nav-icon > svg{width:26px;height:26px;}
.trip-quick-menu{position:fixed;z-index:410;box-sizing:border-box;width:min(320px,calc(100vw - 24px));margin:0;padding:10px;border:1px solid #d9e4de;border-radius:18px;background:#fcfbf6f7;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);box-shadow:0 8px 28px #183e4726;color:#183e47;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;}
.trip-quick-menu[hidden]{display:none;}
.trip-quick-menu button{display:flex;align-items:center;box-sizing:border-box;width:100%;min-height:46px;padding:10px 12px;border:0;border-radius:10px;background:transparent;color:inherit;font:600 15px/1.4 system-ui;text-align:start;cursor:pointer;overflow-wrap:anywhere;}
.trip-quick-menu button:hover,.trip-quick-menu button:focus-visible{background:#e8f1ee;}
.trip-quick-menu button:focus-visible{outline:2px solid #20616d;outline-offset:-2px;}
.trip-quick-menu__actions{margin-top:6px;padding-top:6px;border-top:1px solid #d9e4de;}
.trip-quick-menu__actions [data-quick-action=list]::before{content:'☰';margin-right:12px;font-size:18px;}
.trip-quick-menu__actions [data-quick-action=create]::before{content:'＋';margin-right:12px;font-size:20px;}
.trip-quick-menu h3{margin:12px 12px 4px;font:600 12px/1.5 system-ui;color:#657a7d;}
.trip-quick-menu__recent p{margin:10px 12px;font:400 14px/1.5 system-ui;}
.trip-quick-menu .trip-quick-menu__trip{position:relative;flex-direction:column;align-items:stretch;gap:2px;font-weight:500;height:81px;min-height:81px;padding-right:76px;}
.trip-quick-menu__trip strong{font-size:15px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.trip-quick-menu__trip span{font-size:12px;line-height:1.5;color:#657a7d;font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.trip-quick-menu__cover{position:absolute;right:12px;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:52px;height:52px;border-radius:10px;background:#e7efec;color:#718887;overflow:hidden;}
.trip-quick-menu__cover svg{width:24px;height:24px;}
.trip-quick-menu__cover img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;}
body.app-shell-popular-tabs-hidden #popular-mobile-tabs{display:none!important;}

/* Show only the highest-priority loading indicator in the map controls. */
body:has(.global-loading-overlay.is-visible:not([hidden])) .country-load-status,
body:has(.global-loading-overlay.is-visible:not([hidden]), .country-load-status:not([hidden])) #map-heatmap-control[aria-busy=true] [data-heatmap-check],
body:has(.global-loading-overlay.is-visible:not([hidden]), .country-load-status:not([hidden])) #current-location-fab.is-loading .current-location-fab-btn::after,
#current-location-fab.is-loading #map-heatmap-control[aria-busy=true] [data-heatmap-check] {
  display: none;
}
body:has(.global-loading-overlay.is-visible:not([hidden]), .country-load-status:not([hidden])) #current-location-fab.is-loading .current-location-fab-icon {
  opacity: 1;
}
