html, body { margin: 0; height: 100%; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
#app { height: 100%; }
.loading { display: flex; height: 100%; align-items: center; justify-content: center; color: #555; }

#map { position: absolute; inset: 0; }

.panel {
    position: absolute; top: 12px; left: 12px; z-index: 1000; width: 340px; max-width: calc(100vw - 24px);
    background: #1e1e22ee; color: #eee; border-radius: 14px; padding: 14px; box-shadow: 0 4px 16px #0006;
    box-sizing: border-box;
}
.panel h1 { font-size: 18px; margin: 0 0 10px; }
.field { position: relative; margin-bottom: 8px; }
.field label { display: block; font-size: 12px; color: #aaa; margin-bottom: 2px; }
.field input, .field select {
    width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 8px; border: 1px solid #555;
    background: #2b2b31; color: #fff; font-size: 15px;
}
.hits {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 10; background: #2b2b31; border: 1px solid #555;
    border-radius: 8px; margin-top: 2px; max-height: 300px; overflow-y: auto;
}
.hit { padding: 6px 10px; cursor: pointer; border-bottom: 1px solid #3a3a42; }
.hit:hover { background: #3a3a48; }
.hit small { display: block; color: #aaa; }
button {
    width: 100%; padding: 10px; border: 0; border-radius: 8px; background: #8a4fd6; color: #fff; font-size: 16px;
    cursor: pointer; margin-top: 4px;
}
button:disabled { background: #555; cursor: default; }
button.secondary { background: #3a3a48; }
.status { font-size: 13px; color: #ccc; margin-top: 8px; white-space: pre-line; }
.result { font-size: 16px; margin-top: 8px; }

#blazor-error-ui {
    background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); display: none; left: 0;
    padding: 0.6rem 1.25rem; position: fixed; width: 100%; z-index: 2000; box-sizing: border-box;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

.head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.head h1 { margin: 0; }
.lang { background: #2b2b31; color: #eee; border: 1px solid #555; border-radius: 6px; padding: 3px 4px; font-size: 13px; }
.tabs { display: flex; gap: 4px; margin-bottom: 10px; background: #2b2b31; border-radius: 8px; padding: 3px; }
.tabs div { flex: 1; text-align: center; padding: 6px; border-radius: 6px; cursor: pointer; font-size: 14px; color: #bbb; }
.tabs div.on { background: #8a4fd6; color: #fff; }
.row { display: flex; gap: 8px; }
.row .field { flex: 1; }
.elev { margin-top: 8px; background: #2b2b31; border-radius: 8px; padding: 6px; cursor: crosshair; }
.elev svg { width: 100%; height: 80px; display: block; }
.elev-text { font-size: 12px; color: #ccc; margin-top: 2px; }
.mapmenu-popup .leaflet-popup-content-wrapper { background: #1e1e22; color: #eee; border-radius: 10px; padding: 0; }
.mapmenu-popup .leaflet-popup-content { margin: 4px 0; }
.mapmenu-popup .leaflet-popup-tip { background: #1e1e22; }
.mapmenu div { padding: 8px 14px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.mapmenu div:hover { background: #3a3a48; }

.overlay { position: absolute; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center;
           background: #0004; pointer-events: all; }
.overlay-card { width: 300px; max-width: calc(100vw - 48px); background: #1e1e22f2; color: #eee; border-radius: 16px;
                padding: 20px 22px; box-shadow: 0 8px 30px #0008; text-align: center; }
.overlay-title { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.overlay-stage { font-size: 14px; color: #ccc; margin-bottom: 10px; }
.overlay-pct { font-size: 34px; font-weight: 700; margin-bottom: 8px; }
.overlay-small { font-size: 12px; color: #999; margin-top: 6px; }
.bar { height: 8px; background: #3a3a48; border-radius: 4px; overflow: hidden; position: relative; }
.bar-fill { height: 100%; background: #8a4fd6; transition: width .2s; }
.bar-run { position: absolute; top: 0; bottom: 0; width: 35%; background: #8a4fd6; border-radius: 4px;
           animation: run 1.2s ease-in-out infinite; }
@keyframes run { 0% { left: -35%; } 100% { left: 100%; } }

.flag { position: relative; width: 34px; height: 34px; font-size: 26px; line-height: 30px; filter: drop-shadow(0 1px 2px #0009); }
.flag b { position: absolute; left: 18px; top: -4px; background: #d33; color: #fff; font: bold 11px/16px system-ui, sans-serif;
          min-width: 16px; height: 16px; border-radius: 8px; text-align: center; padding: 0 2px; border: 1px solid #fff; }
.tip { font-size: 12px; color: #aaa; margin-top: 6px; line-height: 1.35; }
.flag-list { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; max-height: 210px; overflow-y: auto; }
.flag-row { display: flex; align-items: center; gap: 4px; }
.flag-name { flex: 1; font-size: 14px; cursor: pointer; }
.flag-row button.mini { width: 30px; height: 26px; padding: 0; font-size: 13px; margin: 0; }
.flag-row button.mini:disabled { opacity: 0.3; }
.flags-sort { font-size: 13px; color: #9cc8ff; margin-top: 6px; cursor: pointer; text-decoration: underline dotted; }
.flags-count { font-size: 13px; color: #f0a0a0; margin-top: 6px; cursor: pointer; text-decoration: underline dotted; }
.newplan { margin-top: 12px; font-size: 14px; padding: 8px; }
.overlay-msg { font-size: 15px; line-height: 1.45; margin-bottom: 14px; }
.overlay-card.pair { width: 340px; }
.qr { width: 240px; height: 240px; image-rendering: pixelated; background: #fff; border-radius: 8px; padding: 8px; margin: 10px auto; display: block; }
