*{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;background:#111}
#map{position:fixed;inset:0;overflow:hidden;background:#d8e0d8;touch-action:none}
.tile{position:absolute;width:256px;height:256px;user-select:none;-webkit-user-drag:none;pointer-events:none}
.topbar{position:fixed;top:max(12px,env(safe-area-inset-top));left:12px;right:12px;display:flex;justify-content:space-between;align-items:center;z-index:20;pointer-events:none}
.title,.status{background:rgba(255,255,255,.92);backdrop-filter:blur(8px);border-radius:12px;padding:9px 12px;box-shadow:0 2px 10px rgba(0,0,0,.18);font-weight:700}
.status{font-size:13px;font-weight:600}
.controls{position:fixed;left:12px;top:92px;z-index:20;display:flex;flex-direction:column;gap:8px}
.controls button{width:48px;height:48px;border:0;border-radius:12px;background:rgba(255,255,255,.94);font-size:28px;box-shadow:0 2px 10px rgba(0,0,0,.2)}
.controls #locate{font-size:24px}
.controls #cache{font-size:25px}
.panel{display:none;position:fixed;left:12px;right:12px;bottom:max(18px,env(safe-area-inset-bottom));z-index:30;background:rgba(255,255,255,.97);border-radius:18px;padding:16px;box-shadow:0 4px 24px rgba(0,0,0,.28)}
.panel.open{display:block}
.panel-title{font-size:19px;font-weight:800;margin-bottom:12px}
.row{display:flex;gap:10px;margin-bottom:12px}
.row label{font-size:14px;display:flex;align-items:center;gap:5px}
.row input{width:62px;padding:7px;border:1px solid #bbb;border-radius:8px;font-size:16px}
button.primary,button.secondary{width:100%;border:0;border-radius:11px;padding:12px;font-size:16px;font-weight:700;margin-top:7px}
.primary{background:#1f2937;color:white}
.secondary{background:#eee;color:#222}
.progress{min-height:20px;font-size:13px;margin-top:8px;text-align:center}
.hint{position:fixed;left:50%;transform:translateX(-50%);bottom:max(18px,env(safe-area-inset-bottom));z-index:10;background:rgba(0,0,0,.65);color:white;padding:8px 12px;border-radius:12px;font-size:12px;pointer-events:none;white-space:nowrap;max-width:92%;overflow:hidden;text-overflow:ellipsis}
#map.dragging{cursor:grabbing}
