/* UI v2 — flow, tool rail, notice strip, labelled icons, responsive fit. Presentation only; loaded after theme-3d.css. */

/* ---------- compact step indicator ---------- */
.steps li{font-size:10px;gap:6px;padding:4px 0}
.steps b{width:19px;height:19px;font-size:9px}
.finder-active .steps{flex:0 0 30px;padding:0 3%;gap:4px}
.finder-active .steps li{padding:3px 0}

/* ---------- notice: in-flow strip between steps and map; never overlays anything. Tap to dismiss ---------- */
.finder-active #notice{position:relative;inset:auto;flex:0 0 auto;max-width:none;margin:0;border:0;border-bottom:1px solid #dccb92;border-radius:0;box-shadow:none;background:#fff3cf;color:#6b5420;padding:6px 34px 6px 3%;font-size:11.5px;line-height:1.4;max-height:3.9em;overflow:auto;cursor:pointer}
.finder-active #notice:after{content:'✕';position:absolute;right:3%;top:6px;font-size:11px;opacity:.55}

/* ---------- map overlays: flow card + status stacked top-left (no overlap), tool rail top-right ---------- */
.map-overlay{position:absolute;z-index:450;top:10px;left:10px;display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:min(400px,calc(100% - 96px));pointer-events:none}
.map-overlay>*{pointer-events:auto}
.finder-active .map-flow{position:relative;inset:auto;max-width:none;width:100%;margin:0;display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:10px;row-gap:2px;align-items:center;padding:9px 11px;border-radius:16px}
.finder-active .map-flow>span{grid-column:1;font-size:9px;letter-spacing:1.2px}
.finder-active .map-flow h2{grid-column:1;font-size:16px;line-height:1.2;margin:0}
.finder-active .map-flow p{grid-column:1/-1;margin:4px 0 0;font-size:11px;line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.finder-active .map-flow .primary{grid-column:2;grid-row:1/3;width:auto;max-width:124px;min-height:40px;padding:8px 12px;font-size:12px;line-height:1.2;justify-content:center;text-align:center;white-space:normal}
.finder-active .map-location-status{position:relative;inset:auto;max-width:100%;margin:0;padding:5px 10px;border-radius:999px;background:#fffdf6ee;border:1px solid #e3d9ba;font-size:11px;line-height:1.3}

.finder-active .map-tools{position:absolute;z-index:500;inset:10px 10px auto auto;display:flex;flex-direction:column;align-items:center;gap:1px;padding:6px 3px;background:#fffdf6ea;border:1px solid #dccb92;border-radius:18px;box-shadow:0 8px 24px #0a2f2a30;max-height:calc(100% - 56px);overflow-y:auto;overflow-x:hidden;scrollbar-width:none}
.finder-active .map-tools::-webkit-scrollbar{display:none}
.finder-active .map-tool-wrap{display:flex;flex-direction:column;align-items:center;gap:1px;width:58px;max-width:none;flex:none}
.finder-active .map-tool-wrap>span{font:800 9px/1.1 Manrope,sans-serif;letter-spacing:.02em;color:var(--emerald);background:none;border:0;border-radius:0;padding:0 0 3px;max-width:100%;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.finder-active .map-tool{display:grid;place-items:center;width:44px;height:44px;padding:0;font-size:23px;line-height:1;border:0;border-radius:13px;background:transparent;color:var(--green);box-shadow:none;transform:none}
.finder-active .map-tool:hover:not(:disabled){background:#f0e0a8;transform:none}
.finder-active .map-tool:active:not(:disabled){background:#e8d089;transform:none;box-shadow:none}
.finder-active .map-tool:disabled{opacity:.38}
.finder-active .map-tool svg{width:22px;height:22px;pointer-events:none}
.finder-active #locate{background:linear-gradient(180deg,#16806b,#0b4338);color:var(--gold-2);box-shadow:inset 0 1px 0 #ffffff38,0 2px 0 #072a24}
.finder-active #locate:hover:not(:disabled){background:linear-gradient(180deg,#1a937b,#0d4f42)}
.finder-active .map-focus{width:34px;height:34px;border-radius:10px}
.finder-active .map-focus svg{width:18px;height:18px}
.finder-active .map-focus[aria-pressed=true]{background:#f0e0a8}
.finder-active .reset-wrap{margin-top:4px;padding-top:5px;border-top:1px solid #e3d9ba}
.finder-active .map-restart{color:var(--terra)}
.finder-active .map-restart:hover:not(:disabled){background:#f6dcd3}

/* ---------- focus mode: map only; everything hidden except the Show toggle ---------- */
body.map-focus header,body.map-focus .steps,body.map-focus #notice,body.map-focus .map-overlay,body.map-focus .map-footer,body.map-focus .map-result,body.map-focus .leaflet-control-zoom{display:none!important}
body.map-focus.finder-active #finder{height:100dvh}
body.map-focus .map-tools{background:transparent;border-color:transparent;box-shadow:none;padding:0;overflow:visible}
body.map-focus .map-tool-wrap:not(.focus-wrap){display:none}
body.map-focus .map-tool-wrap.focus-wrap{background:#fffdf6ee;border:1px solid #dccb92;border-radius:14px;padding:4px 6px 2px;box-shadow:0 6px 18px #0a2f2a40}

/* ---------- bottom of map: one-line hint bar; zoom and result button sit above it ---------- */
.finder-active .map-footer>span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.finder-active .leaflet-control-zoom{margin-bottom:46px!important;margin-left:10px!important}
.finder-active .map-result{bottom:44px;white-space:normal;text-align:center;max-width:calc(100% - 156px);padding:9px 16px;font-size:13px;line-height:1.25}

/* ---------- landmark popup: scrolls inside; action buttons always fit and stay reachable ---------- */
#landmark-popup{width:min(520px,calc(100vw - 16px));max-height:calc(100dvh - 16px);padding:44px 14px 0}
#landmark-popup .landmarks-section{display:flex;flex-direction:column;gap:8px;padding-top:0}
#landmark-popup .landmarks-section>*{margin-top:0;margin-bottom:0}
#landmark-popup .landmark-list{max-height:min(30dvh,260px);margin:0;padding-right:2px}
#landmark-popup .landmark-item{min-width:0;margin-bottom:6px}
.landmark-item>span:last-child{min-width:0;overflow-wrap:anywhere}
.detail-grid b{overflow-wrap:anywhere}
#landmark-popup #selected-details{max-height:24dvh;overflow:auto;margin:0}
#selected-details[hidden]+#search-another{display:none}
#search-another{align-self:flex-start;padding:6px 0;font-size:12px;text-decoration:underline;min-height:0}
.landmark-actions{position:sticky;bottom:0;z-index:5;display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:12px 0 14px;background:linear-gradient(#f8f1dc00,#f8f1dc 14px)}
.landmark-actions>button,.landmark-actions #continue{position:static;bottom:auto;width:100%;min-width:0;min-height:46px;margin:0;padding:8px 10px;font-size:13px;line-height:1.2;justify-content:center;text-align:center;white-space:normal;gap:8px;box-shadow:none}
.landmark-actions>.primary:not(:disabled){box-shadow:inset 0 1px 0 #ffffff38,0 3px 0 #072a24}
@media(max-width:420px){.landmark-actions{grid-template-columns:1fr}}

/* ---------- direction page: icon + short label stacked, never overlapping ---------- */
.focus-icon svg{width:22px;height:22px}
.focus-icon .icon-label{display:block;font:800 9px/1 Manrope,sans-serif;letter-spacing:.01em;white-space:nowrap;text-transform:none;max-width:100%;overflow:hidden;text-overflow:ellipsis}
#alignment-popup.focus-dialog .popup-close,#alignment-popup.focus-dialog .focus-info{width:50px;height:54px;padding:6px 2px 5px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border-radius:14px;font-size:0}
#alignment-popup.focus-dialog .popup-close svg{width:22px;height:22px}
#alignment-popup.focus-dialog .direction-card{inset:0 0 94px;height:calc(100% - 94px);padding-top:72px}
#alignment-popup.focus-dialog .card-top{top:20px;left:72px;right:72px}
#alignment-popup .focus-toolbar{height:68px;gap:4px;padding:6px 8px;border-radius:22px;max-width:calc(100% - 16px);bottom:max(10px,env(safe-area-inset-bottom))}
#alignment-popup .focus-toolbar .focus-icon,#alignment-popup .focus-toolbar #result-actions .focus-icon{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;width:56px;height:54px;min-width:0;min-height:54px;padding:5px 2px;border-radius:14px;font-size:0}
.focus-prayer#prayer-screen{padding-top:72px}
.focus-prayer#prayer-screen #exit-prayer,.focus-prayer#prayer-screen #reset-prayer,.focus-prayer#prayer-screen .focus-info{width:50px;height:54px;min-height:54px;padding:6px 2px 5px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border-radius:14px;font-size:0}
.focus-prayer#prayer-screen #reset-prayer{bottom:76px}

/* ---------- short instruction card above the dial ---------- */
.direction-message:empty{display:none}
.align-steps{flex:none;margin:8px 2px 0;padding:8px 10px;background:#fffdf6;border:1px solid #dccb92;border-radius:14px;box-shadow:0 3px 0 #e3d9ba;max-height:30dvh;overflow:auto;text-align:left}
.align-steps p{display:flex;gap:8px;align-items:flex-start;margin:0;max-width:none;font-size:12px;line-height:1.35;text-align:left;color:var(--ink)}
.align-steps p+p{margin-top:5px}
.align-steps b{flex:none;width:20px;height:20px;border-radius:50%;display:grid;place-items:center;font:800 11px/1 Manrope,sans-serif;color:#925f12;background:#fff6de;border:1px solid #bd801d}
.align-steps b.n2{color:#2863ae;background:#eef4ff;border-color:#2863ae}
.align-steps b.is-ok{color:#fff;background:var(--green);border-color:var(--green)}
.align-steps span{min-width:0;overflow-wrap:anywhere}

/* ---------- breakpoints ---------- */
@media(max-width:360px){
 .finder-active .map-tool-wrap{width:52px}
 .finder-active .map-tool{width:40px;height:40px}
 .map-overlay{width:calc(100% - 82px)}
 #alignment-popup .focus-toolbar{gap:2px;padding:6px 5px}
 #alignment-popup .focus-toolbar .focus-icon,#alignment-popup .focus-toolbar #result-actions .focus-icon{width:50px}
}
@media(max-height:550px) and (orientation:landscape){
 .finder-active .map-tools{flex-direction:row;align-items:flex-start;max-height:none;max-width:calc(100% - 20px);overflow-x:auto;overflow-y:hidden;padding:5px 5px 2px}
 .finder-active .reset-wrap{margin:0 0 0 4px;padding:0 0 0 6px;border-top:0;border-left:1px solid #e3d9ba}
 .map-overlay{top:10px;width:max(230px,calc(100% - 392px));max-width:400px}
 .finder-active .map-flow p{display:none}
 .finder-active .map-flow{padding:7px 10px}
 .finder-active .map-flow h2{font-size:14px}
 .finder-active .map-result{bottom:40px}
 #landmark-popup{padding-top:40px}
 #landmark-popup .landmark-list{max-height:26dvh}
 #landmark-popup #selected-details{max-height:20dvh}
 .landmark-actions{grid-template-columns:1fr 1fr;padding:8px 0 10px}
 .landmark-actions>button,.landmark-actions #continue{min-height:40px}
 #alignment-popup.focus-dialog .direction-card{inset:0 92px 0 0;height:100%;padding:8px 10px}
 #alignment-popup .focus-toolbar{left:auto;right:10px;top:70px;bottom:10px;width:66px;height:auto;flex-direction:column;justify-content:flex-start;gap:3px;padding:5px;overflow-y:auto;border-radius:18px}
 #alignment-popup .focus-toolbar .focus-icon,#alignment-popup .focus-toolbar #result-actions .focus-icon{width:54px;height:50px;min-height:50px;flex:none}
 #alignment-popup.focus-dialog .popup-close{left:auto;right:82px;top:10px}
 #alignment-popup.focus-dialog .focus-info{right:10px;top:10px}
 .align-steps{margin:4px 2px 0;padding:6px 8px;max-height:34dvh}
 .align-steps p{font-size:11px}
 .focus-prayer#prayer-screen{padding:10px 82px 10px 10px}
 .focus-prayer#prayer-screen #exit-prayer{left:auto;right:10px}
 .focus-prayer#prayer-screen .focus-info{top:70px;right:10px}
 .focus-prayer#prayer-screen #reset-prayer{right:10px;bottom:10px}
}

/* ---------- fixes: attribution above hint bar, label spacing, next-step emphasis ---------- */
.finder-active .leaflet-bottom{bottom:36px}
body.map-focus .leaflet-bottom{bottom:0}
.finder-active .leaflet-control-zoom{margin-bottom:10px!important}
.finder-active .map-tool-wrap>span{margin-top:3px}
#alignment-popup .focus-toolbar #result-actions #prayer.focus-icon{background:linear-gradient(180deg,#16806b,#0b4338);color:var(--gold-2);box-shadow:inset 0 1px 0 #ffffff38,0 3px 0 #072a24}
