/* AppMap base styles. Expanded by later stages (controls, floating PiP, etc.). */

.appmap-root {
    position: relative;
    overflow: hidden;
}

.appmap-host {
    position: absolute;
    inset: 0;
    background: #f3f3f3;
}

/* ---- Floating (PiP) mode — overrides standalone sizing ---- */

/* Tour-map standard: ~1/3 viewport wide, ~viewport-tall with a 20 px
   margin top + bottom. Mobile / short viewports collapse to fullscreen.
   Consumers that need extra bottom-clearance (e.g. video360 above its
   controlbar) override `height` per page. */
.appmap-root.appmap-mode-floating {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 33vw;
    height: calc(100vh - 40px);
    min-width: 240px;
    min-height: 240px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25);
    overflow: visible;
    z-index: 9990;
}
@media (max-width: 900px), (max-height: 500px) {
    .appmap-root.appmap-mode-floating {
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
}

/* Marzipano shell — top bar (#titleBar) is 40 px, action-button strip
   (#buttonContainer) is 50 px buttons + 10 px from floor = 60 px. Add the
   standard 20 px margins on both ends.

   `#sceneList` width depends on its longest scene name (min 150 / max
   500 px) and its visibility toggles via the `.enabled` class — neither
   readable from CSS alone, so `appmapMap.js` measures it and writes the
   real width into `--marzipano-scene-list-w`. The transition matches
   the same 0.5 s ease the scene list itself uses, so both panels slide
   together. */
body.multiple-scenes .appmap-root.appmap-mode-floating {
    top: 40px;
    /* `--marzipano-scene-list-w` is written on <html> by appmapMap.js
       whenever #sceneList opens / closes / resizes. NO local declaration
       here — local would mask the inherited value. Fallback in the var()
       handles the brief moment before the JS observer fires. */
    left: calc(20px + var(--marzipano-scene-list-w, 0px));
    height: calc(100vh - 110px);
    max-height: calc(100vh - 110px);
    max-width: calc(100vw - 40px);
    transition: left 0.5s ease-in-out;
}
/* Drag/resize sets `transition: none` inline (see floating.js) so the
   ease doesn't fight the cursor; this rule re-asserts the smooth slide
   for state changes (sceneList toggle, etc.). */

/* Inner host shifted down to leave room for the drag header. */
.appmap-mode-floating .appmap-host {
    top: 26px;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

/* Header — drag handle + title + collapse button. */
.appmap-mode-floating .appmap-pip-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 26px;
    padding: 0 6px 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(20, 24, 32, 0.88);
    color: #fff;
    border-radius: 8px 8px 0 0;
    cursor: move;
    user-select: none;
    z-index: 5;
}
.appmap-mode-floating .appmap-pip-title {
    flex: 1 1 auto;
    font: 13px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.appmap-mode-floating .appmap-pip-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.appmap-mode-floating .appmap-pip-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Resize handles — invisible 8 zones around the PiP edges + corners.
   Scoped only by the handle classes themselves so the same rules work
   for both the auto-built `appmap-mode-floating` shell and templates
   that own their own PiP container (e.g. video360's `.pip-window`)
   and call `floating.makeResizable()` directly. */
.appmap-pip-resize {
    position: absolute;
    z-index: 6;
}
.appmap-pip-resize-t  { top: -4px;    left: 8px;     right: 8px;     height: 8px;  cursor: ns-resize;   }
.appmap-pip-resize-b  { bottom: -4px; left: 8px;     right: 8px;     height: 8px;  cursor: ns-resize;   }
.appmap-pip-resize-l  { left: -4px;   top: 8px;      bottom: 8px;    width: 8px;   cursor: ew-resize;   }
.appmap-pip-resize-r  { right: -4px;  top: 8px;      bottom: 8px;    width: 8px;   cursor: ew-resize;   }
.appmap-pip-resize-tl { left: -4px;   top: -4px;     width: 14px;    height: 14px; cursor: nwse-resize; }
.appmap-pip-resize-tr { right: -4px;  top: -4px;     width: 14px;    height: 14px; cursor: nesw-resize; }
.appmap-pip-resize-bl { left: -4px;   bottom: -4px;  width: 14px;    height: 14px; cursor: nesw-resize; }
.appmap-pip-resize-br { right: -4px;  bottom: -4px;  width: 14px;    height: 14px; cursor: nwse-resize; }

/* Toast — top-center inside the map host. Sits over the same band as the
   `.ol-mouse-position` readout; fades 5 s after the latest message. Default
   home for any AppMap-emitted notification (sync OK, future status hints).
   Mounted inside `.appmap-host`, so position is relative to the map area
   regardless of standalone vs. floating PiP. */
.appmap-host .appmap-toast {
    position: absolute;
    top: .5em;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(20, 24, 32, 0.92);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font: 13px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    opacity: 0;
    transition: opacity 200ms ease, transform 200ms ease;
}
.appmap-host .appmap-toast.appmap-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Mini "expand" button — sibling to the PiP, body-mounted so it stays
   visible when the PiP is `display:none`. Pinned to the same corner the
   floating PiP starts at (top-left), so the user always knows where it
   will pop back from. */
.appmap-pip-expand {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    color: #334155;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
    cursor: pointer;
    z-index: 9990;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 120ms ease, box-shadow 120ms ease;
}
.appmap-pip-expand:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.24);
}
/* When relocated into marzipano's #buttonContainer (or any other action
   bar) the button drops fixed-positioning + grows to action-button size
   so it sits inline with the surrounding buttons. White stroke via
   `currentColor` so the icon is visible over arbitrary panorama backgrounds. */
#buttonContainer .appmap-pip-expand {
    position: static;
    width: 50px;
    height: 50px;
    margin: 0;
    z-index: auto;
    box-shadow: none;
    border: none;
    background: transparent;
    color: #fff;
}
#buttonContainer .appmap-pip-expand svg {
    width: 34px;
    height: 34px;
}
#buttonContainer .appmap-pip-expand:hover {
    transform: none;
    box-shadow: none;
}
/* Pulsing ring while the user hasn't yet opened a tour map for the first
   time. Removed by JS on first click. Same affordance as video360's
   minimap-toggle-pulse and (legacy) marzipano #map-toggle. */
.appmap-pip-expand.appmap-toggle-pulse {
    animation: appmap-toggle-pulse 1.6s ease-in-out infinite;
}
#buttonContainer .appmap-pip-expand.appmap-toggle-pulse,
#potree_map_toggle.appmap-toggle-pulse {
    /* Inside the action bar there's no shadow baseline, so anchor the
       pulse on a flat box. Also reused by Potree's map-toggle button —
       Potree's #potree_map_toggle is a transparent <img>, same shape
       constraint applies. */
    animation-name: appmap-toggle-pulse-flat;
    border-radius: 4px;
}
@keyframes appmap-toggle-pulse-flat {
    0%   { box-shadow: 0 0 0 0 rgba(70, 130, 180, 0.55); }
    70%  { box-shadow: 0 0 0 14px rgba(70, 130, 180, 0); }
    100% { box-shadow: 0 0 0 0 rgba(70, 130, 180, 0); }
}
/* Bare class without the marzipano `#buttonContainer` parent / Potree
   `#potree_map_toggle` selector — needed so the bare class actually
   triggers the animation on Potree's button (the parent #buttonContainer
   selector won't match there). */
#potree_map_toggle.appmap-toggle-pulse {
    animation-duration: 1.6s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}
@keyframes appmap-toggle-pulse {
    0%   { box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18), 0 0 0 0 rgba(70, 130, 180, 0.55); }
    70%  { box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18), 0 0 0 14px rgba(70, 130, 180, 0); }
    100% { box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18), 0 0 0 0 rgba(70, 130, 180, 0); }
}

/* Local CRS mode — no external tiles, sitemap WebP forms the base. */
.appmap-crs-local .appmap-host {
    background: #fafafa;
}

/* Move FullScreen button under Zoom (top-left). Mirrors geotiff.css:23-27.
   The exact `top` is also set in JS (controls.positionFullscreen) after the
   map renders so it stays in sync if the .ol-touch modifier bumps button size. */
.appmap-host .ol-full-screen {
    left: .5em;
    right: unset;
    top: 4.5em;
}

/* Address-search control (top-left, under FullScreen). Collapsed = magnifier
   button alone, in the same OL button style as +/-/⛶. Expanded reveals an
   input row + dropdown panel. `top` is finalized in JS (positionFullscreen)
   so it tracks ol-touch's larger button size. The wrapper inherits OL's
   default `.ol-control` gray bg + 4px radius so the assembled control looks
   like a single Zoom-style pill. Font-size is NOT pinned here — buttons
   inherit body font like the rest of the OL controls, so the magnifier
   matches +/-/⛶ pixel-for-pixel. */
.appmap-host .appmap-search {
    left: .5em;
    right: unset;
    top: 7em;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

/* Panel groups input row + result list into a single column so the list
   sits directly under the input regardless of the magnifier's column. */
.appmap-host .appmap-search-panel {
    display: flex;
    flex-direction: column;
}
.appmap-host .appmap-search-collapsed .appmap-search-panel {
    display: none;
}

/* The row IS the visible field: white tile with 2px radius. Input is
   transparent inside it; the submit button sits flush at the right end
   so they read as a single embedded "send" affordance. */
.appmap-host .appmap-search-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    margin: 1px;
    border-radius: 2px;
    background: var(--ol-background-color);
    overflow: hidden;
}

/* Input is the field's text area — no own background/border, sized to
   match OL button height in `rem` so it stays visually flush with the
   surrounding +/-/⛶ controls. `.ol-touch` bumps height + font 1.5× to
   match OL's `.ol-touch .ol-control button { font-size: 1.5em }`. */
.appmap-host .appmap-search-input {
    margin: 0;
    height: 1.375rem;
    width: 200px;
    padding: 0 6px;
    border: none;
    background: transparent;
    color: var(--ol-foreground-color);
    font: 13px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
    outline: none;
}
.ol-touch .appmap-host .appmap-search-input {
    height: 2.0625rem;
    font-size: 1.21em;
}
.appmap-host .appmap-search-input::placeholder {
    color: var(--ol-subtle-foreground-color);
    font: inherit;
    opacity: 1;
}

/* Submit button lives inside the row — transparent by default, light
   hover tint. Override OL's `.ol-control button { background; outline
   on hover; margin: 1px }` so it doesn't render as a separate tile. */
.appmap-host .appmap-search-submit {
    margin: 0;
    height: 1.375em;
    width: 1.375em;
    background: transparent;
    border-radius: 0;
    color: var(--ol-subtle-foreground-color);
}
.appmap-host .appmap-search-submit:hover,
.appmap-host .appmap-search-submit:focus {
    background: rgba(0, 0, 0, 0.08);
    color: var(--ol-foreground-color);
    outline: none;
}

/* Loading shimmer — runs while the Nominatim request is in flight.
   Painted on the row so it covers both input + submit columns. */
.appmap-host .appmap-search-loading .appmap-search-row {
    background-image: linear-gradient(90deg,
        rgba(0, 60, 136, 0.05) 0%,
        rgba(0, 60, 136, 0.18) 50%,
        rgba(0, 60, 136, 0.05) 100%);
    background-size: 200% 100%;
    animation: appmap-search-shimmer 1.1s linear infinite;
}
@keyframes appmap-search-shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

/* Result dropdown — own white card under the row. Long display_name strings
   wrap onto multiple lines so the country/postcode tail stays readable.
   Width matches the input + submit row exactly so the dropdown sits flush
   under it. `overflow: hidden` on the list prevents the rounded corners
   from clipping awkwardly when scrolling. */
.appmap-host .appmap-search-list {
    margin: 4px 1px 1px 1px;
    width: calc(200px + 1.375em + 4px);
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--ol-background-color);
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    box-sizing: border-box;
    font: 12px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Override OL's `.ol-control button { width:1.375em; height:1.375em;
   line-height:.4em; margin:1px; }` — without these resets each result row
   would be a 1.375em square with text wrapped to one character per line.
   The row is a flex container so the leading pin/globe icon can sit on
   its own column without disturbing the text wrap. */
.appmap-host .appmap-search-result {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
    height: auto;
    margin: 0;
    line-height: 1.35;
    appearance: none;
    background: transparent;
    border: none;
    border-bottom: 1px solid #eee;
    border-radius: 0;
    text-align: left;
    padding: 6px 8px;
    color: var(--ol-foreground-color);
    cursor: pointer;
    font: inherit;
    box-sizing: border-box;
}
.appmap-host .appmap-search-result:last-child { border-bottom: none; }
.appmap-host .appmap-search-result:hover,
.appmap-host .appmap-search-result:focus {
    background: rgba(0, 0, 0, 0.06);
    outline: none;
}
.appmap-host .appmap-search-result-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    margin-top: 2px;
    color: var(--ol-subtle-foreground-color);
}
.appmap-host .appmap-search-result-text {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
    white-space: normal;
}
/* Local setup matches stand out with a faint accent bar so users can tell
   them apart from the Nominatim address rows below. */
.appmap-host .appmap-search-result-setup {
    border-left: 2px solid var(--ol-subtle-foreground-color);
    padding-left: 6px;
}
.appmap-host .appmap-search-result-setup .appmap-search-result-icon {
    color: var(--ol-foreground-color);
}

/* ---- LayerPanel (top-right, below MousePosition) ---- */

.appmap-host .appmap-layerpanel {
    top: 2.5em;
    right: .5em;
    background: transparent;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    font: 13px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    max-width: 240px;
}

/* OL's `.ol-control button` (specificity 0,1,1) sets width/height/font; we
   bump our specificity with `.appmap-host` so the toggle renders at full size. */
.appmap-host .appmap-layerpanel-toggle {
    appearance: none;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.10), 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, color 120ms ease;
    font-size: inherit;
    line-height: 1;
}

.appmap-host .appmap-layerpanel-toggle:hover {
    background: #f8fafc;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.14), 0 2px 4px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.appmap-host .appmap-layerpanel-toggle:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.10);
}

.appmap-host .appmap-layerpanel-toggle:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Active (panel open) — gray accent so the open state is visually distinct. */
.appmap-host .appmap-layerpanel:not(.appmap-layerpanel-collapsed) .appmap-layerpanel-toggle {
    background: #6c757d;
    color: #ffffff;
    border-color: transparent;
}

.appmap-host .appmap-layerpanel:not(.appmap-layerpanel-collapsed) .appmap-layerpanel-toggle:hover {
    background: #5a6268;
}

.appmap-host .appmap-layerpanel-toggle svg {
    width: 18px;
    height: 18px;
    display: block;
}

.appmap-layerpanel-content {
    background: rgba(255, 255, 255, 0.92);
    /* Explicit color — host pages (video360 with .pip-window { color: #fff })
       can leak white text into the panel and make it unreadable. */
    color: var(--ol-foreground-color);
    padding: 6px 10px;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    min-width: 140px;
}

.appmap-layerpanel-collapsed .appmap-layerpanel-content {
    display: none;
}

.appmap-layerpanel-section {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.appmap-layerpanel-header {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 3px;
    padding-left: 2px;
    user-select: none;
}

.appmap-layerpanel-separator {
    border-top: 1px solid #e5e7eb;
    margin: 6px 0;
}

/* Bootstrap-style outline-secondary button. */
.appmap-host .appmap-layerpanel-settings-link {
    display: block;
    text-align: center;
    padding: 5px 10px;
    border: 1px solid #6c757d;
    border-radius: 4px;
    background: transparent;
    color: #6c757d;
    text-decoration: none;
    transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.appmap-host .appmap-layerpanel-settings-link:hover {
    background: #6c757d;
    color: #ffffff;
    border-color: #6c757d;
}

.appmap-layerpanel label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    user-select: none;
}

.appmap-layerpanel label:hover {
    background: rgba(59, 130, 246, 0.08);
}

.appmap-layerpanel input[type="radio"],
.appmap-layerpanel input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
}

.appmap-layerpanel-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.appmap-layerpanel-floor-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appmap-layerpanel-floor-count {
    flex-shrink: 0;
    color: #6b7280;
    font-size: 11px;
    margin-left: 4px;
}

.appmap-layerpanel-bulk {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}

.appmap-host .appmap-layerpanel-bulk-btn {
    appearance: none;
    flex: 1 1 auto;
    padding: 3px 6px;
    margin: 0;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    background: #f9fafb;
    color: #1f2937;
    font: 11px system-ui, sans-serif;
    cursor: pointer;
    width: auto;
    height: auto;
    line-height: 1.4;
    transition: background 100ms ease;
}

.appmap-host .appmap-layerpanel-bulk-btn:hover {
    background: #f3f4f6;
}

/* ---- MousePosition (top-right, above LayerPanel) ---- */

/* Right offset clears the .ol-rotate-reset button slot — when the user
   rotates the map OL surfaces a reset button at top-right and we don't
   want the coords readout sitting on top of it. */
.appmap-host .ol-mouse-position {
    top: .5em;
    right: 2.75em;
    background: rgba(255, 255, 255, 0.85);
    padding: 2px 8px;
    border-radius: 3px;
    font: 12px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #111;
}

/* Pin the rotate-reset to the corner; mouse-position is offset left of it.
   Always visible (override OL's autoHide fade) so it doubles as a discoverable
   hint — hover surfaces the gesture tip. */
.appmap-host .ol-rotate {
    top: .3em;
    right: .3em;
}
.appmap-host .ol-rotate.ol-hidden {
    opacity: 1;
    visibility: visible;
}

/* ---- MeasureControl tooltray (bottom-center) — mirrors geotiff.css:66-110.
   Sits next to / below OpacitySlider when both are active.                  */

.appmap-host .appmap-measure-tooltray {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.10), 0 1px 2px rgba(15, 23, 42, 0.06);
}

.appmap-host .appmap-measure-btn {
    width: 34px;
    height: 34px;
    padding: 6px;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #334155;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 120ms ease, transform 80ms ease;
}

.appmap-host .appmap-measure-btn img {
    width: 20px;
    height: 20px;
    display: block;
    pointer-events: none;
    /* SVG sources are filled white — invert to black for visibility on
       white tooltray background. */
    filter: invert(1);
    transition: filter 120ms ease;
}

.appmap-host .appmap-measure-btn:hover {
    background: #f1f5f9;
}

.appmap-host .appmap-measure-btn:active {
    transform: translateY(1px);
}

.appmap-host .appmap-measure-btn.appmap-measure-pressed {
    background: #3b82f6;
}

.appmap-host .appmap-measure-btn.appmap-measure-pressed img {
    /* On the blue active background we want white icons — original colour. */
    filter: none;
}

/* "Clear all" button — render the SVG as a red mask instead of inverting it. */
.appmap-host .appmap-measure-clear img {
    display: none;
}
.appmap-host .appmap-measure-clear::before {
    content: '';
    width: 20px;
    height: 20px;
    background-color: #dc2626;
    -webkit-mask: url(/static/svg/del.svg) center / contain no-repeat;
            mask: url(/static/svg/del.svg) center / contain no-repeat;
    transition: background-color 120ms ease;
}
.appmap-host .appmap-measure-clear:hover::before {
    background-color: #b91c1c;
}

.appmap-host .appmap-measure-separator {
    width: 1px;
    height: 20px;
    background: rgba(0, 0, 0, 0.1);
    margin: 0 4px;
}

/* Measure tooltips (mirrors geotiff.css:112-167) */

.appmap-host .ol-tooltip {
    position: relative;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    color: white;
    padding: 4px 8px;
    font: 12px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    white-space: nowrap;
    pointer-events: none;
}

.appmap-host .ol-tooltip.hidden {
    display: none;
}

.appmap-host .ol-tooltip-measure {
    opacity: 1;
    font-weight: bold;
}

.appmap-host .ol-tooltip-static {
    background-color: #6366f1;
    border: 1px solid #4f46e5;
    color: white;
}

.appmap-host .ol-tooltip-measure::before,
.appmap-host .ol-tooltip-static::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
}

.appmap-host .ol-tooltip-measure::before { border-top-color: rgba(0, 0, 0, 0.7); }
.appmap-host .ol-tooltip-static::before  { border-top-color: #6366f1; }

.appmap-host .ol-tooltip-segment {
    font-size: 11px;
    font-weight: normal;
    background: rgba(0, 0, 0, 0.55);
    padding: 2px 5px;
}

.appmap-host .ol-tooltip-segment.ol-tooltip-static {
    background: rgba(79, 70, 229, 0.75);
    border: none;
}

.appmap-host .ol-tooltip-segment::before { display: none; }

/* ---- Setup hover tooltip (shows setup.name near cursor). */

.appmap-setup-tooltip {
    pointer-events: none;
    background: rgba(20, 24, 32, 0.85);
    color: #f0f4f8;
    padding: 3px 8px;
    border-radius: 4px;
    font: 12px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* ---- Right-click context menu (admin actions on a setup). */

.appmap-host .appmap-contextmenu {
    position: absolute;
    z-index: 2000;
    min-width: 200px;
    padding: 4px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.10);
    font: 13px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.appmap-host .appmap-contextmenu-item {
    appearance: none;
    display: block;
    width: 100%;
    padding: 6px 10px;
    margin: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #1f2937;
    text-align: left;
    cursor: pointer;
    font: inherit;
    line-height: 1.4;
    transition: background 100ms ease;
}

.appmap-host .appmap-contextmenu-item:hover {
    background: #f1f5f9;
}

/* ---- Opacity slider inside LayerPanel SITEMAPS section. */

.appmap-layerpanel-opacity-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 0 4px;
}

.appmap-layerpanel-opacity-label {
    font-size: 11px;
    color: #6b7280;
    flex-shrink: 0;
    user-select: none;
}

.appmap-host .appmap-layerpanel-opacity-slider {
    flex: 1 1 auto;
    width: auto;
    margin: 0;
    accent-color: #6c757d;
    cursor: pointer;
}

/* ---- ScaleLine: bottom-left default position. */

.appmap-host .ol-scale-line-inner {
    font: 11px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #1f2937;
}

/* ---- Consent overlay (geo mode only) ---- */

.appmap-consent-overlay {
    position: absolute;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(20, 24, 32, 0.92);
    color: #f0f4f8;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
}

.appmap-consent-inner {
    max-width: 560px;
    text-align: center;
}

.appmap-consent-text {
    margin-bottom: 20px;
    font-size: 14px;
    white-space: pre-line;
}

.appmap-consent-button {
    appearance: none;
    border: 0;
    border-radius: 4px;
    padding: 10px 28px;
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: #3b82f6;
    cursor: pointer;
    transition: background 120ms ease;
}

.appmap-consent-button:hover { background: #2563eb; }
.appmap-consent-button:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}
