/* ====================================================================
   THE PIN, CONFIRMED ON A MAP — the dialog of js/<hub>/map-pin.js
   (desktop slice E0, 2026-10-09; briefs/2026-10-09_desktop-build-rules-
   26-34.md §3; frames 31-d-map, 31-d-map-set and the map blocks of
   31-d-states in docs/design/pharmacy/screens/31/desktop/).

   BYTE-IDENTICAL in css/pharmacy/map-pin.css and css/exams/map-pin.css:
   each hub links only its own copy, after its app.css. Not under desktop/:
   the dialog also runs on the phone, where it takes the whole window. Its
   classes are its own (.vm-mp-*), so nothing here reaches a page's own
   markup. Literal values only; Inter and Space Grotesk; never a blue.

   Tiers: below 901 the whole window (the map grows to fill it, the acts
   at the foot over the safe area) · from 901 a centred dialog, 800 wide,
   radius 20, the map 400 tall in a 14 radius, the acts in a row at the
   foot (Cancel in teal words, then the solid "Put the pin here").
   Leaflet's own stylesheet (cdnjs, on demand) draws the tiles; the pin,
   its shadow, the chip, the controls and the attribution are drawn here,
   over the map (the map is its own stacking context).
   ==================================================================== */

.vm-mp-lock,
.vm-mp-lock body { overflow: hidden; }

.vm-mp-dim {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(15, 23, 42, .55);
}

.vm-mp {
    position: fixed;
    inset: 0;
    z-index: 1201;
    display: flex;
    flex-direction: column;
    background: #fff;
    font-family: 'Inter', -apple-system, sans-serif;
    color: #0f172a;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
}
.vm-mp button { font-family: inherit; cursor: pointer; border: 0; margin: 0; }
.vm-mp button:disabled { cursor: default; }

/* -- The head ----------------------------------------------------------- */
.vm-mp-head {
    flex-shrink: 0;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 12px;
}
.vm-mp-title {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.4px;
    line-height: 1.2;
    color: #0f172a;
}
.vm-mp-title:focus { outline: none; }
.vm-mp-sub { margin: 4px 0 0; font-size: 13.5px; line-height: 1.45; color: #475569; }

/* -- The map ------------------------------------------------------------ */
.vm-mp-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.vm-mp-map {
    position: relative;
    flex: 1 1 auto;
    min-height: 240px;
    overflow: hidden;
    background: #e5e3df;
}
.vm-mp-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: #e5e3df;
}
.vm-mp-canvas:focus-visible { outline: 2px solid #0f6d5c; outline-offset: -2px; }

/* The centre pin: its tip on the map's centre, the value. */
.vm-mp-shadow {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    width: 14px;
    height: 8px;
    margin: -4px 0 0 -7px;
    border-radius: 999px;
    background: rgba(2, 12, 27, .35);
    pointer-events: none;
}
.vm-mp-pin {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    width: 34px;
    height: 44px;
    margin: -44px 0 0 -17px;
    display: flex;
    justify-content: center;
    color: #0f6d5c;
    filter: drop-shadow(0 3px 4px rgba(2, 12, 27, .35));
    pointer-events: none;
}
.vm-mp-pin i { font-size: 44px; line-height: 44px; }
.vm-mp-pin-dot {
    position: absolute;
    top: 10px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #fff;
}

/* The reading's line, top left. */
.vm-mp-chip {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 3;
    max-width: calc(100% - 84px);
    margin: 0;
    padding: 10px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(2, 12, 27, .16);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.45;
    color: #0f172a;
    text-wrap: pretty;
    font-variant-numeric: tabular-nums;
}
.vm-mp-chip[hidden] { display: none; }
.vm-mp-chip i { flex-shrink: 0; margin-top: 3px; color: #0f6d5c; }

/* Zoom and Use my location, top right. */
.vm-mp-ctrls {
    position: absolute;
    right: 12px;
    top: 12px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.vm-mp-ctrlbox {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(2, 12, 27, .16);
}
.vm-mp-ctrl {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #0f172a;
}
.vm-mp-ctrl i { font-size: 14px; }
.vm-mp-ctrl:disabled { color: #94a3b8; }
.vm-mp-ctrl:focus-visible { outline: 2px solid #0f6d5c; outline-offset: -2px; }
.vm-mp-hair { height: 1px; background: #e2e8f0; }

.vm-mp-osm {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 3;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    font-size: 11px;
    line-height: 1.5;
    color: #334155;
    text-decoration: none;
}
.vm-mp-osm-t { padding: 2px 8px; background: rgba(255, 255, 255, .85); }
.vm-mp-osm:focus-visible { outline: 2px solid #0f6d5c; outline-offset: -2px; }

/* Her landmark, the thing to look for. */
.vm-mp-landmark {
    flex-shrink: 0;
    margin: 0;
    padding: 12px 16px 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.45;
    color: #334155;
    overflow-wrap: anywhere;
}
.vm-mp-landmark i { flex-shrink: 0; margin-top: 3px; color: #0f6d5c; }
.vm-mp-landmark-t { font-weight: 600; color: #0f172a; }

/* -- The foot: the line, then Cancel | Put the pin here ------------------ */
.vm-mp-foot {
    flex-shrink: 0;
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px 12px;
}
.vm-mp-say {
    flex: 1 0 100%;
    min-width: 0;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    color: #0f172a;
}
.vm-mp-say:empty { display: none; }
.vm-mp-say.is-ready { font-weight: 400; color: #475569; }
.vm-mp-cancel,
.vm-mp-put {
    min-height: 48px;
    border-radius: 999px;
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}
.vm-mp-cancel { padding: 0 18px; background: transparent; color: #0f6d5c; }
.vm-mp-put { padding: 0 24px; background: #0f6d5c; color: #fff; }
.vm-mp-put:disabled { background: #e2e8f0; color: #64748b; }
.vm-mp-cancel:focus-visible,
.vm-mp-put:focus-visible { outline: 2px solid #0f6d5c; outline-offset: 2px; }

@media (hover: hover) {
    .vm-mp-ctrl:not(:disabled):hover { background: #f8fafc; }
    .vm-mp-cancel:hover { background: #e3f4f0; }
    .vm-mp-put:not(:disabled):hover { background: #0c5b4c; }
    .vm-mp-osm:hover { color: #0f172a; }
}

/* -- From 901: the centred dialog ---------------------------------------- */
@media (min-width: 901px) {
    .vm-mp {
        inset: auto;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 800px;
        max-width: calc(100vw - 48px);
        max-height: calc(100vh - 48px);
        overflow: hidden;
        border-radius: 20px;
        box-shadow: 0 24px 64px rgba(2, 12, 27, .35);
    }
    .vm-mp-head { padding: 20px 24px 14px; }
    .vm-mp-title { font-size: 20px; }
    .vm-mp-sub { font-size: 14px; }
    .vm-mp-body { flex: 0 1 auto; padding: 0 24px; }
    .vm-mp-map {
        flex: 0 0 auto;
        height: min(400px, calc(100vh - 300px));
        min-height: 240px;
        border-radius: 14px;
    }
    .vm-mp-chip,
    .vm-mp-ctrls { top: 14px; }
    .vm-mp-chip { left: 14px; max-width: min(440px, calc(100% - 90px)); font-size: 14px; }
    .vm-mp-ctrls { right: 14px; }
    .vm-mp-landmark { padding: 12px 0 0; }
    .vm-mp-foot {
        padding: 16px 24px 20px;
        flex-wrap: nowrap;
    }
    .vm-mp-say { flex: 1 1 auto; }
    .vm-mp-say:empty { display: block; }
}
