/* Memorial Stones — Overhead Pathway Map viewer */

.ms-ohm {
    position: relative;
    width: 100%;
    min-height: 320px;
    background: #e8e4da;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.12);
    font-family: inherit;
    --ms-ohm-available: #2e9e5b;
    --ms-ohm-taken: #33bdcb;
    --ms-ohm-accent: #1d3557;
    --ms-ohm-inv: 1;
}

.ms-ohm:fullscreen,
:-webkit-full-screen .ms-ohm,
.ms-ohm--fullscreen {
    border-radius: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
}

/* CSS-based fullscreen (iOS / browsers without Fullscreen API) */
.ms-ohm--fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999 !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
}

.ms-ohm-stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
    touch-action: none;
    cursor: grab;
    outline: none;
}

.ms-ohm--panning .ms-ohm-stage { cursor: grabbing; }

.ms-ohm-stage:focus-visible {
    box-shadow: inset 0 0 0 3px rgba(51, 189, 203, 0.55);
}

.ms-ohm-world {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    will-change: transform;
}

.ms-ohm-image {
    display: block;
    width: 100%;
    height: 100%;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.ms-ohm-markers {
    position: absolute;
    inset: 0;
}

/* ---------------------------------------------------------------- markers */

.ms-ohm-marker {
    position: absolute;
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    transform: translate(-50%, -50%) scale(var(--ms-ohm-inv));
    transform-origin: center;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
            appearance: none;
}

.ms-ohm-marker::before {
    content: '';
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--ms-ohm-taken);
    border: 2px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
    transition: transform 0.15s ease;
}

.ms-ohm-marker.is-available::before { background: var(--ms-ohm-available); }

.ms-ohm-marker:hover::before,
.ms-ohm-marker:focus-visible::before { transform: scale(1.45); }

.ms-ohm-marker.is-selected::before {
    transform: scale(1.6);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.55), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.ms-ohm-marker.is-dimmed { opacity: 0.16; pointer-events: none; }

/* shrink dots when zoomed far out so the map stays readable */
.ms-ohm--far .ms-ohm-marker::before {
    width: 6px;
    height: 6px;
    border-width: 1px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.ms-ohm-marker-label {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 2px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(20, 28, 36, 0.82);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    white-space: nowrap;
    pointer-events: none;
    display: none;
}

.ms-ohm--labels .ms-ohm-marker-label { display: block; }

/* ---------------------------------------------------------------- beacon */

.ms-ohm-beacon {
    position: absolute;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border-radius: 50%;
    pointer-events: none;
    display: none;
    transform: scale(var(--ms-ohm-inv));
}

.ms-ohm-beacon.is-visible { display: block; }

.ms-ohm-beacon::before,
.ms-ohm-beacon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid #ffb703;
    animation: ms-ohm-pulse 1.6s ease-out infinite;
}

.ms-ohm-beacon::after { animation-delay: 0.8s; }

@keyframes ms-ohm-pulse {
    0%   { transform: scale(0.7); opacity: 1; }
    100% { transform: scale(4.2); opacity: 0; }
}

/* ---------------------------------------------------------------- top bar */

.ms-ohm-topbar {
    position: absolute;
    top: 34px;   /* clear of the 26px column ruler */
    left: 10px;
    right: 100px; /* clear of the toolbar + 40px row ruler */
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    z-index: 30;
    pointer-events: none;
}

.ms-ohm-topbar > * { pointer-events: auto; }

.ms-ohm-search { position: relative; flex: 0 1 300px; min-width: 200px; }

.ms-ohm-search-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    font-size: 14px;
    line-height: 1.3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
    box-sizing: border-box;
}

.ms-ohm-search-input:focus {
    outline: none;
    border-color: var(--ms-ohm-taken);
    box-shadow: 0 0 0 3px rgba(51, 189, 203, 0.25);
}

.ms-ohm-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    display: none;
    z-index: 40;
}

.ms-ohm-suggestions.is-visible { display: block; }

.ms-ohm-suggestion {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.ms-ohm-suggestion:last-child { border-bottom: none; }
.ms-ohm-suggestion:hover, .ms-ohm-suggestion:focus { background: #eef7f8; }
.ms-ohm-suggestion strong { color: var(--ms-ohm-accent); margin-right: 6px; }
.ms-ohm-suggestion span { color: #444; }
.ms-ohm-suggestion em {
    float: right;
    font-style: normal;
    font-size: 11px;
    font-weight: 700;
    color: var(--ms-ohm-available);
}

.ms-ohm-locate {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.ms-ohm-locate select {
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    padding: 5px 4px;
    max-width: 86px;
}

.ms-ohm-locate-go {
    border: none;
    border-radius: 6px;
    background: var(--ms-ohm-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 12px;
    cursor: pointer;
}

.ms-ohm-locate-go:hover { filter: brightness(1.18); }

.ms-ohm-filter {
    display: flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.ms-ohm-filter-btn {
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 13px;
    padding: 5px 10px;
    cursor: pointer;
    color: #333;
}

.ms-ohm-filter-btn.is-active {
    background: var(--ms-ohm-accent);
    color: #fff;
    font-weight: 600;
}

/* --------------------------------------------------------------- toolbar */

.ms-ohm-toolbar {
    position: absolute;
    top: 34px;   /* clear of the column ruler */
    right: 50px; /* clear of the 40px row ruler */
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 30;
}

.ms-ohm-tool {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
    font-size: 19px;
    line-height: 1;
    color: #2b2b2b;
    cursor: pointer;
}

.ms-ohm-tool:hover { background: #fff; color: var(--ms-ohm-accent); }
.ms-ohm-tool.is-active { background: var(--ms-ohm-accent); color: #fff; }
.ms-ohm-tool.is-active:hover { filter: brightness(1.15); }

/* ---------------------------------------------------------------- legend */

.ms-ohm-legend {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 30;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12.5px;
    color: #222;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.ms-ohm-legend-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    margin: 0 4px 0 10px;
    vertical-align: -1px;
    border: 1.5px solid #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.ms-ohm-legend-dot:first-child { margin-left: 0; }
.ms-ohm-legend-dot.is-available { background: var(--ms-ohm-available); }
.ms-ohm-legend-dot.is-taken { background: var(--ms-ohm-taken); }

/* --------------------------------------------------------------- minimap */

.ms-ohm-minimap {
    position: absolute;
    right: 50px; /* clear of the 40px row ruler */
    bottom: 10px;
    width: 170px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.9);
    z-index: 30;
    cursor: crosshair;
    line-height: 0;
    touch-action: none;
}

.ms-ohm-minimap-img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
}

.ms-ohm-minimap-vp {
    position: absolute;
    border: 2px solid #ffb703;
    background: rgba(255, 183, 3, 0.18);
    pointer-events: none;
    box-sizing: border-box;
}

/* ----------------------------------------------------------------- popup */

.ms-ohm-popup {
    position: absolute;
    z-index: 50;
    width: 270px;
    max-width: calc(100% - 28px);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.3);
    padding: 14px;
    transform: translateX(-50%);
    display: none;
    box-sizing: border-box;
}

.ms-ohm-popup.is-visible { display: block; }

.ms-ohm-popup::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%) rotate(45deg);
    width: 16px;
    height: 16px;
    background: #fff;
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.08);
}

.ms-ohm-popup.is-below::after {
    bottom: auto;
    top: -8px;
    box-shadow: -2px -2px 6px rgba(0, 0, 0, 0.06);
}

.ms-ohm-popup.is-free::after { display: none; }

.ms-ohm-popup-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.ms-ohm-popup-code {
    font-size: 19px;
    font-weight: 800;
    color: var(--ms-ohm-accent);
    letter-spacing: 0.5px;
}

.ms-ohm-popup-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
    padding: 2px 9px;
    color: #fff;
}

.ms-ohm-popup-badge.is-available { background: var(--ms-ohm-available); }
.ms-ohm-popup-badge.is-taken { background: var(--ms-ohm-taken); }

.ms-ohm-popup-close {
    margin-left: auto;
    border: none;
    background: none;
    font-size: 22px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0 2px;
}

.ms-ohm-popup-close:hover { color: #000; }

.ms-ohm-popup-name {
    font-weight: 700;
    font-size: 14.5px;
    color: #1b1b1b;
    margin-bottom: 4px;
}

.ms-ohm-popup-engraving {
    white-space: pre-line;
    font-size: 12.5px;
    color: #4a4a4a;
    background: #f6f5f1;
    border-left: 3px solid var(--ms-ohm-taken);
    border-radius: 0 6px 6px 0;
    padding: 7px 10px;
    margin-bottom: 8px;
    max-height: 110px;
    overflow: auto;
}

.ms-ohm-popup-photo img {
    width: 100%;
    border-radius: 6px;
    margin-bottom: 8px;
    display: block;
}

.ms-ohm-popup-loc {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.ms-ohm-popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ms-ohm-btn {
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 6px;
    background: #fff;
    color: #222 !important;
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 10px;
    cursor: pointer;
    text-decoration: none !important;
    line-height: 1.2;
}

.ms-ohm-btn:hover { border-color: var(--ms-ohm-accent); color: var(--ms-ohm-accent) !important; }

.ms-ohm-btn.is-primary {
    background: var(--ms-ohm-available);
    border-color: var(--ms-ohm-available);
    color: #fff !important;
}

.ms-ohm-btn.is-primary:hover { filter: brightness(1.1); }

.ms-ohm-popup-nearby {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: #555;
}

.ms-ohm-chip {
    border: 1px solid var(--ms-ohm-available);
    color: var(--ms-ohm-available);
    background: #fff;
    border-radius: 14px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 9px;
    margin: 0 3px;
    cursor: pointer;
}

.ms-ohm-chip:hover {
    background: var(--ms-ohm-available);
    color: #fff;
}

/* ----------------------------------------------------------------- toast */

.ms-ohm-toast {
    position: absolute;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%) translateY(10px);
    background: rgba(20, 28, 36, 0.92);
    color: #fff;
    font-size: 13px;
    border-radius: 8px;
    padding: 9px 16px;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    z-index: 60;
    white-space: nowrap;
}

.ms-ohm-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ----------------------------------------------------------- small screens */

@media (max-width: 640px) {
    .ms-ohm-topbar { right: 90px; }
    .ms-ohm-locate select { max-width: 70px; }
    .ms-ohm-minimap { width: 120px; right: 44px; }
    .ms-ohm-legend { font-size: 11px; padding: 5px 9px; max-width: 46%; }
    .ms-ohm-popup { width: 240px; }
    .ms-ohm-tool { width: 36px; height: 36px; }
    .ms-ohm-toolbar { right: 44px; }
    .ms-ohm-ruler-rows { width: 34px; }
    .ms-ohm-ruler-cols { right: 34px; height: 22px; }
    .ms-ohm-ruler-label { font-size: 10px; }
}

/* --------------------------------------------------------------- rulers */

.ms-ohm-ruler {
    position: absolute;
    z-index: 20; /* above map/markers, below controls (30) — controls are laid out clear of the rulers */
    pointer-events: none;
    overflow: hidden;
}

/* Row labels — right side, full height */
.ms-ohm-ruler-rows {
    top: 0;
    right: 0;
    bottom: 0;
    width: 40px;
    background: rgba(255, 255, 255, 0.92);
    border-left: 1px solid rgba(0, 0, 0, 0.14);
    box-shadow: -2px 0 6px rgba(0, 0, 0, 0.07);
}

/* Column labels — top edge, full width minus row ruler corner */
.ms-ohm-ruler-cols {
    top: 0;
    left: 0;
    right: 40px;
    height: 26px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(0, 0, 0, 0.14);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
}

.ms-ohm-ruler-label {
    position: absolute;
    font-size: 11px;
    font-weight: 700;
    color: #1d3557;
    line-height: 1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Row label: centered in the bar, centered vertically on the row Y */
.ms-ohm-ruler-rows .ms-ohm-ruler-label {
    left: 0;
    right: 0;
    text-align: center;
    transform: translateY(-50%);
}

/* Col label: centered horizontally on the column X, centered vertically in bar */
.ms-ohm-ruler-cols .ms-ohm-ruler-label {
    top: 50%;
    transform: translate(-50%, -50%);
}

/* loading shimmer until image is ready */
.ms-ohm:not(.ms-ohm--ready) .ms-ohm-stage::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, #e8e4da 30%, #f4f1ea 50%, #e8e4da 70%);
    background-size: 200% 100%;
    animation: ms-ohm-shimmer 1.4s linear infinite;
}

@keyframes ms-ohm-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
