@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

.test-map-page {
    --row-label-width: 64px;
    --place-size: 74px;
    --place-gap: 8px;
    --cd-line: #d8e3ef;
    --cd-bg: #f3f7fc;
    --cd-text: #111e31;
    --cd-muted: #5b6a7d;
    --cd-dark: #0f172a;
    max-width: 1240px;
    width: 100%;
    min-height: 0;
    margin: 16px auto 24px;
    padding: 22px 18px 34px;
    color: var(--cd-text);
    background: transparent;
    font-family: "Manrope", "Segoe UI", Tahoma, sans-serif;
}

.out-test-map {
    display: flex!important;
    flex: 1 0 auto!important;
    width: 100%!important;
    background: radial-gradient(120% 100% at 0% 0%, #f8fbff 0%, transparent 55%), radial-gradient(120% 100% at 100% 0%, #eef2f8 0%, transparent 55%), linear-gradient(165deg, #edf1f6 0%, #e3e9f1 100%)!important;
    overflow-x: hidden!important;
}

body.test-map-hide-site-footer .out-test-map {
    min-height: 100svh !important;
}

body.test-map-hide-site-footer .test-map-page--empty {
    min-height: calc(100svh - 32px);
}

.test-map-page--empty {
    min-height: calc(100vh - 104px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.test-map-page--empty .test-map-shell {
    width: 100%;
}

.test-map-page,
.test-map-page * {
    box-sizing: border-box;
    font-family: "Manrope", "Segoe UI", Tahoma, sans-serif;
}

/* Never render sections marked as hidden (prevents placeholder flash). */
.test-map-page [hidden] {
    display: none !important;
}

.test-map-hero {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
}

.test-map-hero__content {
    max-width: 1120px;
    margin: 0 auto;
}

.test-select-host {
    position: relative;
    width: 100%;
}

.test-select-native-hidden {
    display: none !important;
}

.test-map-picker .custom-select-wrapper {
    position: relative;
    width: 100%;
    z-index: 1;
}

.test-map-picker .custom-select-wrapper.open {
    z-index: 1400;
}

.test-map-picker .custom-select-trigger {
    min-height: 48px;
    border: 1px solid #c8d8ea;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
    color: #10233c;
    display: flex;
    align-items: center;
    padding: 0 42px 0 16px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    line-height: 1.2;
}

.test-map-picker .custom-select-trigger::after {
    content: "";
    position: absolute;
    right: 16px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #4f7090;
    border-bottom: 2px solid #4f7090;
    transform: translateY(-65%) rotate(45deg);
    transition: transform .18s ease;
}

.test-map-picker .custom-select-wrapper.open .custom-select-trigger::after {
    transform: translateY(-35%) rotate(-135deg);
}

.test-map-picker .custom-select-wrapper.open .custom-select-trigger {
    border-color: #5d98d7;
    box-shadow: 0 0 0 4px rgba(93, 152, 215, 0.16);
    outline: 2px solid transparent;
}

.test-map-picker .custom-select-wrapper.disabled .custom-select-trigger {
    background: #eef3f8;
    color: #69819a;
    cursor: not-allowed;
}

.test-map-picker .custom-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    border: 1px solid #c8d8ea;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 38px rgba(14, 41, 64, 0.18);
    max-height: 260px;
    overflow: auto;
    z-index: 1300;
}

.test-map-picker .custom-select-wrapper.open-up .custom-options {
    top: auto;
    bottom: calc(100% + 8px);
}

.test-map-picker .custom-option {
    font-size: 14px;
    color: #123d62;
    padding: 10px 14px;
    cursor: pointer;
}

.test-map-picker .custom-option:hover {
    background: #eef5fb;
}

.test-map-picker .custom-option.disabled {
    color: #8aa0b6;
    background: #fff;
    cursor: default;
}

.test-map-picker .custom-option.is-selected {
    background: #e1edf8;
}

.test-map-shell {
    width: 100%;
    margin: 0;
    padding: 0 !important;
    display: grid;
    gap: 14px;
    color: var(--cd-text);
}

.test-map-picker,
.test-quarter-card,
.test-map-hero {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border: 1px solid #d8e3ef;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.test-map-picker {
    padding: 0;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border: 1px solid #d8e3ef;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.test-map-hero {
    position: relative;
    display: block;
    min-height: 342px;
    padding: 30px;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(9, 28, 46, 0.9) 0%, rgba(12, 37, 61, 0.72) 38%, rgba(18, 52, 83, 0.26) 100%),
        url("/assets/images/interactive-map.png");
    background-size: cover;
    background-position: center;
    color: #f4f9ff;
}

.test-map-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(520px 240px at 12% 18%, rgba(120, 175, 237, 0.18), transparent 70%),
        linear-gradient(180deg, rgba(5, 18, 32, 0.04) 0%, rgba(5, 18, 32, 0.32) 100%);
}

.test-map-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(560px 260px at 86% 14%, rgba(97, 162, 231, 0.22), transparent 75%),
        linear-gradient(120deg, rgba(7, 23, 39, 0.08) 0%, rgba(7, 23, 39, 0.02) 100%);
}

.test-map-hero__content {
    position: relative;
    z-index: 1;
    max-width: 1120px;
    margin: 0 auto;
}

.test-map-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.test-map-hero h1 {
    margin: 14px 0 10px;
    font-size: clamp(34px, 4.6vw, 52px);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.test-map-hero p {
    margin: 0;
    max-width: 760px;
    color: rgba(239, 247, 255, 0.86);
    font-size: 16px;
    line-height: 1.6;
    font-weight: 700;
}

.test-map-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.test-map-hero__pill {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    max-width: 100%;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.1);
    color: #f4f9ff;
    font-size: 13px;
    font-weight: 700;
}

.test-map-picker__card {
    display: grid;
    gap: 0;
}

.test-map-picker__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 28px 28px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(100, 140, 190, 0.14);
    background: linear-gradient(180deg, rgba(235, 244, 255, 0.6) 0%, rgba(255, 255, 255, 0) 100%);
}

@media (min-width: 768px) {
    .test-map-picker__head {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 20px;
    }
}

.test-map-picker__icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    margin: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, #1a4a7a 0%, #2d6cb5 100%);
    color: #ffffff;
    box-shadow:
        0 4px 12px rgba(26, 74, 122, 0.25),
        0 1px 3px rgba(26, 74, 122, 0.15);
}

.test-map-picker__head-content {
    flex: 1;
    min-width: 0;
}

.test-map-picker__head h2 {
    margin: 0 0 6px;
    font-size: clamp(22px, 2.6vw, 28px);
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: #0d2239;
}

.test-map-picker__head p {
    margin: 0;
    color: #5a7899;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 600;
    max-width: 640px;
}

/* ── Steps container ───────────────────── */
.test-map-picker__steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px 28px;
}

@media (min-width: 960px) {
    .test-map-picker__steps {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
        align-items: end;
        gap: 16px;
        padding: 28px;
    }
}

/* ── Single step ───────────────────── */
.test-map-picker__step {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid transparent;
    background: transparent;
    transition: background 0.25s ease, border-color 0.25s ease, opacity 0.25s ease, box-shadow 0.25s ease;
}

@media (min-width: 960px) {
    .test-map-picker__step {
        padding: 16px;
    }
}

.test-map-picker__step[data-state="active"] {
    background: linear-gradient(180deg, rgba(232, 243, 255, 0.7) 0%, rgba(220, 236, 255, 0.45) 100%);
    border-color: rgba(45, 108, 181, 0.2);
    box-shadow: 0 2px 8px rgba(26, 74, 122, 0.06);
}

.test-map-picker__step[data-state="completed"] {
    background: rgba(240, 248, 240, 0.5);
    border-color: rgba(60, 160, 80, 0.15);
}

.test-map-picker__step[data-state="waiting"] {
    opacity: 0.55;
}

.test-map-picker__step-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.test-map-picker__step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    background: #e4edf7;
    color: #5a7899;
}

.test-map-picker__step[data-state="active"] .test-map-picker__step-num {
    background: linear-gradient(135deg, #1a4a7a 0%, #2d6cb5 100%);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(26, 74, 122, 0.3);
}

.test-map-picker__step[data-state="completed"] .test-map-picker__step-num {
    background: linear-gradient(135deg, #27864a 0%, #3aad5f 100%);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(39, 134, 74, 0.25);
}

.test-map-picker__step-title {
    font-size: 15px;
    font-weight: 800;
    color: #1a3a5c;
    letter-spacing: -0.01em;
}

.test-map-picker__step[data-state="waiting"] .test-map-picker__step-title {
    color: #7a95af;
}

.test-map-picker__step-body {
    padding-left: 42px;
}

@media (min-width: 960px) {
    .test-map-picker__step-body {
        padding-left: 0;
    }
}

/* ── Step connector arrow ───────────────────── */
.test-map-picker__step-connector {
    display: none;
}

/* ── Actions / Button ───────────────────── */
.test-map-picker__actions {
    display: flex;
    justify-content: center;
    padding: 10px 0 0;
}

@media (min-width: 960px) {
    .test-map-picker__actions {
        padding: 0 0 16px;
    }
}

.test-map-picker__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    padding: 0 24px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #1a4a7a 0%, #2d6cb5 100%);
    color: #ffffff;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow:
        0 4px 12px rgba(26, 74, 122, 0.2),
        0 16px 32px rgba(19, 57, 94, 0.15);
}

.test-map-picker__submit svg {
    flex-shrink: 0;
    opacity: 0.85;
}

.test-map-picker__submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow:
        0 6px 16px rgba(26, 74, 122, 0.25),
        0 20px 40px rgba(19, 57, 94, 0.18);
}

.test-map-picker__submit:active:not(:disabled) {
    transform: translateY(0);
}

.test-map-picker__submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.test-map-hidden-select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.test-map-select {
    width: 100%;
    min-height: 48px;
    border-radius: 16px;
    border: 1px solid #c8d8ea;
    background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
    padding: 0 16px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    color: #10233c;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.test-map-select:focus {
    border-color: #5d98d7;
    box-shadow: 0 0 0 4px rgba(93, 152, 215, 0.16);
}

.test-map-select:disabled {
    background: #eef3f8;
    color: #69819a;
    cursor: not-allowed;
}

.test-map-cemetery-card {
    --cem-card-media-width: 320px;
    --cem-card-media-size: 320px;
    padding: 14px;
    display: grid;
    grid-template-columns: var(--cem-card-media-width) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border: 1px solid var(--cd-line);
    border-radius: 20px;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.test-map-cemetery-card__media-host {
    position: relative;
    width: var(--cem-card-media-width);
    height: var(--cem-card-media-size);
    min-height: var(--cem-card-media-size);
    max-height: var(--cem-card-media-size);
    flex: 0 0 var(--cem-card-media-size);
    max-width: none;
    margin: 0 auto 0 0;
}

.test-map-cemetery-card__media-host .cemdet-media {
    height: 100%;
    min-height: var(--cem-card-media-size);
    border-radius: 14px;
    border: 1px solid #d5e0ed;
    background: linear-gradient(180deg, #f1f6fc 0%, #e7eef7 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.test-map-cemetery-card__body {
    min-width: 0;
    display: grid;
    align-content: start;
    min-height: 0;
}

.test-map-cemetery-card__eyebrow {
    display: inline-flex;
    align-items: center;
    margin-bottom: 10px;
    color: #6b7d95;
    font-size: 12px;
    font-weight: 700;
}

.test-map-cemetery-card__main {
    min-width: 0;
    margin-bottom: 12px;
}

.test-map-cemetery-card__main h2 {
    margin: 0;
    color: #0d2239;
    font-size: clamp(28px, 2.8vw, 38px);
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.test-map-cemetery-card__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.test-map-cemetery-card__chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid #d5e0ed;
    background: #eef4fb;
    color: #274566;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
}

.test-map-cemetery-card__facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.test-map-cemetery-card__fact {
    background: var(--cd-bg);
    border: 1px solid #dce7f3;
    border-radius: 12px;
    padding: 11px 12px;
    min-width: 0;
}

.test-map-cemetery-card__fact span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #7387a1;
    margin-bottom: 4px;
}

.test-map-cemetery-card__fact strong {
    display: block;
    color: #0f2138;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 700;
    word-break: break-word;
}

.test-map-cemetery-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
}

.test-map-cemetery-card__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    text-decoration: none;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.test-map-cemetery-card__action:hover {
    transform: translateY(-1px);
}

.test-map-cemetery-card__action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.test-map-cemetery-card__action--dark {
    background: #172036;
    color: #fff;
    border-color: #172036;
}

.test-map-cemetery-card__action--light {
    background: #fff;
    color: #123057;
    border-color: #c9d7e8;
}

.test-map-cemetery-card__action--ghost {
    background: #f1f6fd;
    color: #1f3c65;
    border-color: #cfdced;
}

.test-map-cemetery-card__action.is-disabled {
    opacity: 0.58;
    cursor: default;
    pointer-events: none;
    box-shadow: none;
}

.cemdet-media {
    position: relative;
    overflow: hidden;
    min-height: 260px;
}

.cemdet-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cemdet-media-image[data-gallery-image] {
    cursor: pointer;
}

.cemdet-media-image[data-gallery-image]:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: -3px;
}

.cemdet-media-zoom {
    position: absolute;
    left: 12px;
    bottom: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    width: 40px;
    height: 40px;
    padding: 0 11px;
    box-sizing: border-box;
    border-radius: 999px;
    background: rgba(15, 33, 56, 0.76);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    backdrop-filter: blur(10px);
    pointer-events: none;
    box-shadow: 0 10px 24px rgba(15, 33, 56, 0.2);
    overflow: hidden;
    white-space: nowrap;
    transition: width 0.22s ease, padding 0.22s ease, background-color 0.22s ease;
}

.cemdet-media-zoom svg {
    display: block;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
}

.cemdet-media-zoom-text {
    display: inline-block;
    width: 0;
    margin-left: 0;
    overflow: hidden;
    flex: 0 0 auto;
    opacity: 0;
    transition: width 0.22s ease, margin-left 0.22s ease, opacity 0.18s ease;
}

.cemdet-media:hover .cemdet-media-zoom,
.cemdet-media:focus-within .cemdet-media-zoom {
    width: 132px;
    padding: 0 14px 0 11px;
    background: rgba(15, 33, 56, 0.84);
}

.cemdet-media:hover .cemdet-media-zoom-text,
.cemdet-media:focus-within .cemdet-media-zoom-text {
    width: 70px;
    margin-left: 8px;
    opacity: 1;
}

.cemdet-media--empty .cemdet-media-note {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 10px;
    background: linear-gradient(180deg, rgba(235, 243, 254, 0.45) 0%, rgba(229, 237, 247, 0.96) 100%);
    border-top: 1px solid rgba(193, 206, 223, 0.95);
    color: #56677f;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-align: center;
    text-transform: uppercase;
}

html.grvdet-modal-open,
body.grvdet-modal-open {
    overflow: hidden;
}

.grvdet-close-btn {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    border: 1px solid rgba(214, 226, 239, 0.9);
    background: rgba(255, 255, 255, 0.92);
    color: #3b536c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.grvdet-close-btn:hover {
    background: #f3f7fb;
    border-color: #c6d6e8;
    transform: translateY(-1px);
}

.grvdet-photo-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.grvdet-photo-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.grvdet-photo-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 18, 31, 0.82);
    backdrop-filter: blur(8px);
}

.grvdet-photo-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(1120px, 100%);
}

.grvdet-photo-modal__layout {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
}

.grvdet-photo-modal.is-single .grvdet-photo-modal__layout {
    grid-template-columns: 1fr;
}

.grvdet-photo-modal.is-single .grvdet-photo-modal__thumbs {
    display: none;
}

.grvdet-photo-modal__thumbs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(15, 23, 36, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    align-self: flex-start;
    height: fit-content;
    max-height: calc(100vh - 80px);
    overflow: auto;
}

.grvdet-photo-modal__thumb {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    overflow: hidden;
    padding: 0;
    background: transparent;
    cursor: pointer;
    opacity: 0.7;
    transition: transform 0.15s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.grvdet-photo-modal__thumb img {
    display: block;
    width: 100%;
    height: 78px;
    object-fit: cover;
}

.grvdet-photo-modal__thumb:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.grvdet-photo-modal__thumb.is-active {
    border-color: #8fb4e6;
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(143, 180, 230, 0.45);
}

.grvdet-photo-modal__stage {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    background: #0b1220;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.grvdet-photo-modal__frame {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background: #0b1220;
    pointer-events: none;
}

.grvdet-photo-modal__frame::before {
    content: "";
    position: absolute;
    inset: -12%;
    background-image: var(--modal-photo);
    background-size: cover;
    background-position: center;
    filter: blur(26px);
    transform: scale(1.12);
    opacity: 0.9;
}

.grvdet-photo-modal__frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(8, 14, 22, 0.25);
}

.grvdet-photo-modal__image {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    max-height: calc(100vh - 84px);
    object-fit: contain;
    background: transparent;
}

.grvdet-photo-modal__nav {
    position: absolute;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-top: -24px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    color: #eef5ff;
    cursor: pointer;
    font-size: 22px;
    transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s ease;
    backdrop-filter: blur(6px);
    z-index: 3;
}

.grvdet-photo-modal__nav:hover:not(:disabled) {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.2);
}

.grvdet-photo-modal__nav:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.grvdet-photo-modal__nav--prev {
    left: 14px;
}

.grvdet-photo-modal__nav--next {
    right: 14px;
}

.grvdet-photo-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}

.test-map-summary {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.test-map-summary__change {
    flex: 0 0 auto;
    align-self: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(102, 137, 176, 0.3);
    background: linear-gradient(180deg, #ffffff 0%, #f0f6fd 100%);
    color: #1f446b;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.test-map-summary__change:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(16, 45, 78, 0.14);
}

.test-map-summary__item {
    border-radius: 14px;
    border: 1px solid #d8e3ef;
    background: #ffffff;
    padding: 12px 13px;
    min-width: 0;
    box-sizing: border-box;
}

.test-map-summary__label {
    display: block;
    color: #72869f;
    font-size: 12px;
    margin-bottom: 6px;
    font-weight: 500;
}

.test-map-summary__item strong {
    font-size: 24px;
    letter-spacing: -0.01em;
    line-height: 1;
    font-weight: 700;
}

.test-quarter-card {
    padding: 22px;
    display: grid;
    gap: 14px;
    min-width: 0;
}

.test-quarter-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.test-quarter-card__aside {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.test-map-section-label {
    display: inline-flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #446a91;
}

.test-quarter-card h2 {
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: #0d2239;
    font-size: clamp(22px, 2.1vw, 28px);
}

.test-map-note {
    margin: 8px 0 0;
    max-width: 680px;
    color: #5d7592;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 700;
}

.test-quarter-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.test-place-popover-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid rgba(135, 160, 188, 0.24);
    background: #f5f9fd;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.test-place-popover-switch__button {
    min-height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #54708f;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.test-place-popover-switch__button:hover {
    color: #173a61;
}

.test-place-popover-switch__button.is-active {
    background: linear-gradient(180deg, #2d68d5 0%, #1f52ba 100%);
    color: #ffffff;
    box-shadow: 0 10px 18px rgba(31, 82, 186, 0.22);
}

.test-quarter-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    background: #f5f9fd;
    border: 1px solid rgba(135, 160, 188, 0.24);
    font-size: 13px;
    font-weight: 700;
    color: #294566;
}

.test-quarter-legend__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.test-quarter-legend__dot--empty {
    background: #d9e3ef;
}

.test-quarter-legend__dot--occupied {
    background: linear-gradient(180deg, #3f77b7 0%, #214f87 100%);
}

.test-quarter-frame {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border-radius: 20px;
    border: 2px solid #7fa4cb;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(240, 246, 255, 0.95) 100%);
}

.test-quarter-frame.is-single {
    width: 100%;
    max-width: 100%;
    justify-self: start;
    box-sizing: border-box;
}

.test-quarter-frame__caption {
    position: absolute;
    top: -14px;
    left: 22px;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: #12385f;
    color: #edf5ff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.test-quarter-grid {
    display: grid;
    gap: 12px;
    min-height: 80px;
    width: max-content;
    max-width: 100%;
    margin: 0;
}

.test-grid-head {
    display: grid;
    grid-template-columns: var(--row-label-width) max-content;
    gap: 10px;
    align-items: end;
    width: max-content;
}

.test-quarter-grid[data-place-direction="left"] .test-grid-head {
    grid-template-columns: max-content var(--row-label-width);
}

.test-grid-head__corner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    border-radius: 12px;
    background: #edf4fb;
    color: #4b6a8c;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.test-grid-head__places {
    display: grid;
    grid-template-columns: repeat(var(--places-per-row, 1), minmax(var(--place-size), var(--place-size)));
    gap: var(--place-gap);
}

.test-grid-head__place {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 4px;
    border-radius: 12px;
    border: 1px solid rgba(169, 188, 211, 0.7);
    background: linear-gradient(180deg, #ffffff 0%, #f3f8ff 100%);
    color: #4e6d8f;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
}

.test-quarter-map {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 148px;
    gap: 10px;
    min-height: 148px;
    width: max-content;
}

.test-quarter-map.is-single {
    min-height: auto;
}

.test-quarter-map-scroller {
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    padding: 20px;
    scrollbar-width: thin;
}

.test-map-empty {
    width: 100%;
    display: grid;
    place-items: center;
    padding: 24px;
    border-radius: 22px;
    border: 1px dashed #b8cade;
    background: linear-gradient(180deg, #fbfdff 0%, #eef4fb 100%);
    color: #5f7895;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
}

.test-map-state {
    width: 100%;
}

.test-map-state__panel {
    position: relative;
    overflow: hidden;
    width: 100%;
    margin: 0;
    background:
        radial-gradient(150px 150px at 16% 18%, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0) 74%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(245, 249, 255, 0.98) 100%);
    border: 1px solid var(--cd-line);
    border-radius: 24px;
    box-shadow: 0 20px 46px rgba(15, 23, 42, 0.10);
    padding: clamp(28px, 5vw, 44px);
    text-align: left;
    display: block;
}

.test-map-state__layout {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px 28px;
    width: 100%;
}

.test-map-state__copy {
    flex: 1 1 280px;
    min-width: 0;
    display: grid;
    gap: 14px;
    justify-items: start;
}

.test-map-state__aside {
    flex: 0 0 auto;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.test-map-state__panel::before,
.test-map-state__panel::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.test-map-state__panel::before {
    width: 220px;
    height: 220px;
    top: -118px;
    right: -86px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.14) 0%, rgba(37, 99, 235, 0) 72%);
}

.test-map-state__panel::after {
    width: 180px;
    height: 180px;
    bottom: -88px;
    left: -56px;
    background: radial-gradient(circle, rgba(15, 23, 42, 0.10) 0%, rgba(15, 23, 42, 0) 74%);
}

.test-map-state__panel > * {
    position: relative;
    z-index: 1;
}

.test-map-state__panel h1 {
    margin: 0;
    font-size: clamp(24px, 3.2vw, 32px);
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--cd-text);
}

.test-map-state__panel p {
    margin: 0;
    max-width: 780px;
    color: var(--cd-muted);
    font-size: 15px;
    line-height: 1.55;
}

.test-map-state__panel:not(.is-not-found) {
    border-radius: 18px;
    border: 1px solid #cbdcf0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 248, 255, 0.98) 100%),
        linear-gradient(120deg, rgba(74, 138, 219, 0.1) 0%, rgba(74, 138, 219, 0) 55%);
    box-shadow: 0 14px 30px rgba(15, 33, 56, 0.08);
    padding: clamp(20px, 3.4vw, 30px);
}

.test-map-state__panel:not(.is-not-found)::before {
    width: 140px;
    height: 140px;
    top: -56px;
    right: -46px;
    background: radial-gradient(circle, rgba(50, 112, 196, 0.2) 0%, rgba(50, 112, 196, 0) 74%);
}

.test-map-state__panel:not(.is-not-found)::after {
    width: 120px;
    height: 120px;
    bottom: -54px;
    left: -32px;
    background: radial-gradient(circle, rgba(20, 54, 94, 0.1) 0%, rgba(20, 54, 94, 0) 76%);
}

/* «Не знайдено»: як .cemdet-empty на cemetery.php — плоска сітка, той самий max-width і типографіка */
.test-map-state__panel.is-not-found {
    display: grid;
    width: min(100%, 700px);
    margin: 0 auto;
    text-align: center;
    gap: 14px;
    justify-items: center;
}

.test-map-state__panel.is-not-found .test-map-state__layout,
.test-map-state__panel.is-not-found .test-map-state__copy {
    display: contents;
}

.test-map-state__panel.is-not-found .test-map-state__aside {
    display: none !important;
}

.test-map-state__panel.is-not-found h1 {
    font-size: clamp(28px, 4vw, 34px);
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--cd-text);
}

.test-map-state__panel.is-not-found p {
    max-width: 540px;
    font-size: 16px;
    line-height: 1.65;
}

.test-map-state__panel.is-not-found h1,
.test-map-state__panel.is-not-found p,
.test-map-state__panel.is-not-found .test-map-state__actions {
    position: relative;
    z-index: 1;
}

.test-map-state__actions {
    width: 100%;
    margin-top: 4px;
}

.cemdet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cemdet-empty-actions {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
}

.cemdet-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}

.cemdet-btn:hover {
    transform: translateY(-1px);
}

.cemdet-btn--dark {
    background: var(--cd-dark);
    color: #fff;
    border-color: var(--cd-dark);
}

.cemdet-btn--light {
    background: #fff;
    color: #123057;
    border-color: #c9d7e8;
}

.test-map-state__action {
    min-height: 40px;
}

.test-quarter-tile {
    position: relative;
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(129, 155, 186, 0.24);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f3f8ff 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    aspect-ratio: 1 / 1;
    text-align: left;
    color: #0f2640;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.test-quarter-tile:hover {
    transform: translateY(-2px);
    border-color: rgba(57, 102, 160, 0.42);
    box-shadow: 0 14px 26px rgba(24, 55, 92, 0.12);
}

.test-quarter-tile:focus-visible {
    outline: 3px solid rgba(49, 105, 175, 0.34);
    outline-offset: 2px;
}

.test-quarter-tile.is-selected {
    border-color: rgba(35, 86, 143, 0.62);
    background: linear-gradient(180deg, #eaf4ff 0%, #d9ebff 100%);
    box-shadow: 0 18px 32px rgba(28, 69, 115, 0.16);
}

.test-quarter-tile__marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    width: fit-content;
    padding: 0 10px;
    border-radius: 999px;
    background: #eff5fb;
    color: #32577f;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.test-quarter-tile.is-selected .test-quarter-tile__marker {
    background: #163a62;
    color: #eef6ff;
}

.test-quarter-tile__title {
    font-size: clamp(18px, 1.6vw, 24px);
    line-height: 1;
    letter-spacing: -0.04em;
}

.test-quarter-tile__meta {
    color: #557391;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.test-quarter-tile__progress {
    display: block;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #dce7f3;
    overflow: hidden;
}

.test-quarter-tile__progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #548fd1 0%, #1f4f86 100%);
}

.test-quarter-tile__stats {
    margin-top: auto;
    display: grid;
    gap: 4px;
    font-size: 12px;
    font-weight: 800;
    color: #244668;
}

.test-quarter-grid-scroller {
    display: flex;
    justify-content: flex-start;
    overflow: auto;
    padding: 20px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.96) rgba(201, 216, 233, 0.45);
    touch-action: pan-x pan-y;
}

.test-quarter-grid-scroller[data-place-direction="left"] {
    justify-content: flex-end;
}

.test-quarter-grid-scroller::-webkit-scrollbar {
    height: 10px;
}

.test-quarter-grid-scroller::-webkit-scrollbar-track {
    background: rgba(204, 220, 237, 0.55);
    border-radius: 999px;
}

.test-quarter-grid-scroller::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 999px;
    border: 2px solid rgba(204, 220, 237, 0.55);
}

.test-quarter-grid-scroller::-webkit-scrollbar-thumb:hover {
    background: #ffffff;
}

.test-row {
    display: grid;
    grid-template-columns: var(--row-label-width) max-content;
    gap: 10px;
    align-items: stretch;
    width: max-content;
}

.test-quarter-grid[data-place-direction="left"] .test-row {
    grid-template-columns: max-content var(--row-label-width);
}

.test-row__label {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid #aac2dd;
    background: linear-gradient(180deg, #f8fbff 0%, #eaf2fb 100%);
    color: #45698f;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    min-height: 40px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
    text-transform: uppercase;
}

.test-row__places {
    display: grid;
    grid-template-columns: repeat(var(--places-per-row, 1), minmax(var(--place-size), var(--place-size)));
    gap: var(--place-gap);
    width: max-content;
}

.test-place {
    position: relative;
    appearance: none;
    aspect-ratio: 1 / 1;
    min-height: var(--place-size);
    padding: 0;
    border-radius: 12px;
    box-sizing: border-box;
    border: 1px dashed #a1bcd7;
    background: linear-gradient(180deg, #fbfdff 0%, #eef4fb 100%);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    font: inherit;
    overflow: visible;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.test-place--occupied {
    border-style: solid;
    border-color: rgba(36, 84, 136, 0.24);
    background: linear-gradient(180deg, #eef5ff 0%, #dfeaf8 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.test-place--interactive {
    cursor: pointer;
}

.test-place--with-photo {
    background-image:
        linear-gradient(180deg, rgba(7, 18, 32, 0.02) 0%, rgba(7, 18, 32, 0.14) 50%, rgba(7, 18, 32, 0.8) 100%),
        var(--place-photo);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-color: rgba(24, 61, 102, 0.3);
}

.test-place--with-photo .test-place__body,
.test-place__count {
    position: relative;
    z-index: 1;
}

.test-place--with-photo .test-place__person,
.test-place--with-photo .test-place__years {
    color: #f7fbff;
    text-shadow: 0 1px 3px rgba(10, 21, 35, 0.55);
}

.test-place--occupied:not(.test-place--with-photo) .test-place__body {
    min-height: 100%;
    justify-content: flex-end;
}

a.test-place--occupied:hover,
.test-place--interactive:hover {
    transform: translateY(-2px);
    border-color: rgba(30, 76, 124, 0.38);
    box-shadow: 0 12px 22px rgba(19, 48, 81, 0.14);
    z-index: 50;
}

a.test-place--occupied:focus-visible,
.test-place--interactive:focus-visible {
    outline: 3px solid rgba(49, 105, 175, 0.34);
    outline-offset: 2px;
    z-index: 50;
}

.test-place--interactive.is-active {
    transform: translateY(-2px);
    border-color: rgba(29, 80, 133, 0.54);
    box-shadow: 0 18px 32px rgba(20, 52, 86, 0.18);
    z-index: 60;
}

.test-place--flash {
    animation: testPlaceFlashPulse 2.6s ease-out;
    border-color: rgba(37, 105, 181, 0.78) !important;
    box-shadow: 0 0 0 3px rgba(72, 144, 231, 0.34), 0 14px 26px rgba(23, 72, 130, 0.24) !important;
    z-index: 70;
}

@keyframes testPlaceFlashPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(72, 144, 231, 0.50), 0 8px 18px rgba(23, 72, 130, 0.20);
    }
    22% {
        transform: scale(1.02);
        box-shadow: 0 0 0 8px rgba(72, 144, 231, 0.22), 0 16px 28px rgba(23, 72, 130, 0.28);
    }
    55% {
        transform: scale(1.01);
        box-shadow: 0 0 0 6px rgba(72, 144, 231, 0.14), 0 12px 22px rgba(23, 72, 130, 0.22);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(72, 144, 231, 0), 0 0 0 rgba(23, 72, 130, 0);
    }
}

.test-place__icon {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 8px;
}

.test-place__icon svg {
    width: 26px;
    height: 26px;
    stroke: #9fb3c9;
    stroke-width: 2.25;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.test-place__body {
    position: relative;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 2px;
    width: 100%;
    min-height: 28px;
    padding: 6px 7px 7px;
    box-sizing: border-box;
    text-align: left;
}

.test-place--empty .test-place__body {
    min-height: 100%;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 0;
    padding: 0;
}

.test-place--empty .test-place__icon {
    flex: 0 0 auto;
    padding-top: 0;
}

.test-place--empty .test-place__icon svg {
    width: 18px;
    height: 18px;
    stroke: #93a9bf;
    stroke-width: 1.9;
}

.test-place__vacant {
    color: #607a95;
    font-size: 10px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.test-place__empty-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 11px;
}

.test-place__body[data-tooltip]::after,
.test-place__body[data-tooltip]::before {
    position: absolute;
    left: 50%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
    z-index: 11000;
}

.test-place__body[data-tooltip]::after {
    content: attr(data-tooltip);
    bottom: calc(100% + 10px);
    transform: translate(-50%, 4px);
    white-space: nowrap;
    background: #0f3559;
    color: #ffffff;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 7px 8px;
    box-shadow: 0 8px 16px rgba(12, 43, 70, 0.26);
}

.test-place__body[data-tooltip]::before {
    content: "";
    bottom: calc(100% + 4px);
    transform: translate(-50%, 4px);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #0f3559;
}

.test-place:is(:hover, :focus-visible, .is-active) .test-place__body[data-tooltip]::after,
.test-place:is(:hover, :focus-visible, .is-active) .test-place__body[data-tooltip]::before {
    opacity: 1;
    transform: translate(-50%, 0);
}

body.test-map-floating-tooltip-ready .test-place__body[data-tooltip]::after,
body.test-map-floating-tooltip-ready .test-place__body[data-tooltip]::before {
    display: none;
}

.test-place--with-photo .test-place__body {
    padding-top: 18px;
}

.test-place__meta {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5c7897;
}

.test-place__state,
.test-place__years {
    font-size: 9px;
    line-height: 1.25;
}

.test-place__state {
    color: #6b8097;
    font-weight: 700;
    padding: 0 7px 7px;
    text-align: center;
}

.test-place__person {
    width: 100%;
    font-size: 10px;
    line-height: 1.15;
    font-weight: 800;
    color: #0f2640;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.test-place__person--empty {
    color: #244668;
}

.test-place__years {
    color: #335777;
    font-weight: 700;
    font-size: 8px;
    line-height: 1.1;
}

.test-place__hint {
    color: #4e6f90;
    font-weight: 700;
    font-size: 8px;
    line-height: 1.2;
}

.test-place__years:empty,
.test-place__hint:empty {
    display: none;
}

.test-place__count {
    position: absolute;
    top: 6px;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(18, 56, 95, 0.92);
    color: #eef6ff;
    font-size: 8px;
    font-weight: 800;
    box-shadow: 0 10px 18px rgba(17, 45, 76, 0.18);
}

.test-quarter-legend__dot--selected {
    background: linear-gradient(180deg, #163a62 0%, #2f659f 100%);
}

.test-place-popover {
    position: fixed;
    inset: 0;
    z-index: 10040;
    pointer-events: none;
}

.test-place-popover::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(14, 29, 48, 0.28);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.test-place-popover[hidden] {
    display: none !important;
}

.test-place-popover__panel {
    position: fixed;
    width: min(430px, calc(100vw - 24px));
    pointer-events: auto;
    padding: 0;
    border-radius: 20px;
    border: 1px solid #d8e3ef;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    box-shadow: 0 20px 46px rgba(15, 23, 42, 0.14);
    display: grid;
    align-content: start;
    font-family: "Manrope", "Segoe UI", Tahoma, sans-serif;
    overflow: hidden;
}

.test-place-popover[data-mode="desktop"]::before {
    opacity: 0;
}

.test-place-popover[data-mode="mobile"] {
    pointer-events: auto;
}

.test-place-popover[data-mode="mobile"]::before {
    opacity: 1;
    pointer-events: auto;
}

.test-place-popover[data-mode="mobile"] .test-place-popover__panel {
    width: 100%;
    max-height: min(90vh, 760px);
    border-radius: 20px 20px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: 30px;
}

.test-place-tooltip {
    position: fixed;
    left: 0;
    top: 0;
    display: block;
    max-width: min(320px, calc(100vw - 24px));
    padding: 8px 10px;
    border-radius: 10px;
    background: #0f3559;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    word-break: break-word;
    box-shadow: 0 14px 30px rgba(12, 43, 70, 0.28);
    pointer-events: none;
    z-index: 11050;
}

.test-place-tooltip[hidden] {
    display: none !important;
}

.test-place-tooltip::after {
    content: "";
    position: absolute;
    left: var(--tooltip-arrow-left, 50%);
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
}

.test-place-tooltip[data-side="top"]::after {
    top: 100%;
    border-top: 7px solid #0f3559;
}

.test-place-tooltip[data-side="bottom"]::after {
    bottom: 100%;
    border-bottom: 7px solid #0f3559;
}

.test-place-popover[data-mode="mobile"] .test-place-popover__panel::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 42px;
    height: 5px;
    border-radius: 999px;
    background: rgba(76, 102, 132, 0.38);
}

.test-place-popover__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 10px;
    border: 1px solid #d3e2f1;
    background: #f8fbff;
    color: #1a3e6a;
    font: inherit;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.16s ease, transform 0.16s ease;
}

.test-place-popover__close:hover {
    background: #f3f7fb;
    border-color: #c6d6e8;
    transform: translateY(-1px);
}

.test-place-popover__content {
    display: grid;
    gap: 0;
}

/* Keep custom date pickers above any modal/popover layers */
.ui-datepicker,
.datepicker,
.datepicker-dropdown,
.datepicker .calendar.popup,
.flatpickr-calendar,
.xdsoft_datetimepicker,
.pika-single,
[data-datepicker-popup] {
    z-index: 999999 !important;
}

.test-place-popover__heading {
    display: grid;
    gap: 5px;
    padding: 18px 56px 14px 18px;
    border-bottom: 1px solid #e1ebf5;
    background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
}

.test-place-popover__heading strong {
    font-size: 17px;
    line-height: 1.2;
    color: #111e31;
    font-weight: 800;
}

.test-place-popover__heading span {
    color: #5b6a7d;
    font-size: 12px;
    font-weight: 700;
}

.test-place-popover__list {
    display: grid;
    gap: 8px;
}

.test-place-popover__body {
    display: grid;
    gap: 12px;
    padding: 16px 16px 16px;
    background: linear-gradient(180deg, #fbfdff 0%, #f4f8fe 100%);
    max-height: min(62vh, 460px);
    overflow: auto;
}

.test-place-popover__link,
.test-place-popover__action {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
    font-family: "Manrope", "Segoe UI", Tahoma, sans-serif;
}

.test-place-popover__link {
    background: #ffffff;
    border: 1px solid #d9e3ef;
    color: #1f3c65;
}

.test-place-popover__action {
    justify-content: center;
    border: 1px solid #0f172a;
    background: #0f172a;
    color: #ffffff;
}

body.test-popover-open {
    overflow: hidden;
}

.test-place-popover__link:hover,
.test-place-popover__action:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

.test-place-popover__action:hover {
    background: #111827;
    border-color: #111827;
}

.test-place-popover__text {
    margin: 0;
    color: #5b6a7d;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 700;
    padding: 0 2px;
}

.test-place-popover__thumb {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(132, 162, 195, 0.3);
    background: linear-gradient(180deg, #ffffff 0%, #eef4fb 100%);
    object-fit: cover;
    flex: 0 0 auto;
    display: block;
    margin-right: 10px;
}

.test-place-popover__link-text {
    min-width: 0;
    flex: 1 1 auto;
}

html.test-map-search-modal-open,
body.test-map-search-modal-open {
    overflow: hidden;
}

.test-map-search-modal {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    font-family: "Manrope", "Segoe UI", Tahoma, sans-serif !important;
}

.test-map-search-modal * {
    font-family: "Manrope", "Segoe UI", Tahoma, sans-serif !important;
}

.test-map-search-modal[hidden] {
    display: none !important;
}

.test-map-search-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.32);
    backdrop-filter: blur(10px);
}

.test-map-search-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    max-height: min(88vh, 760px);
    border-radius: 24px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    background: #ffffff;
    box-shadow: 0 20px 46px rgba(15, 23, 42, 0.18);
    overflow: visible;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
}

.test-map-search-modal__close {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 14px;
    background: #ffffff;
    color: #46566c;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.test-map-search-modal__close:hover {
    color: #102033;
    background: #ffffff;
}

.test-map-search-modal__close:focus-visible {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb, 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.test-map-search-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(17, 24, 39, 0.06);
    background: #ffffff;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}

.test-map-search-modal__titlebox {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.test-map-search-modal__icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(180deg, #e9f2ff 0%, #dceaff 100%);
    color: #1560ef;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
}

.test-map-search-modal__icon svg {
    display: block;
}

.test-map-search-modal__heading {
    min-width: 0;
    flex: 1 1 auto;
}

.test-map-search-modal__heading h2 {
    margin: 0 0 6px;
    font-size: 17px;
    line-height: 1.2;
    color: #102033;
    font-weight: 700;
}

.test-map-search-modal__heading p {
    margin: 4px 0 0;
    color: #68758a;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 500;
}

.test-map-search-modal__mode {
    display: flex;
    gap: 10px;
    padding: 12px 16px 10px;
    border-bottom: 1px solid rgba(17, 24, 39, 0.06);
    background: #ffffff;
}

.test-map-search-modal__mode-btn {
    min-height: 42px;
    border: 1px solid #d7e3f1;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    color: #13283e;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    padding: 0 14px;
    cursor: pointer;
    flex: 1 1 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.test-map-search-modal__mode-btn.is-active {
    border-color: rgba(21, 87, 214, 0.36);
    background: linear-gradient(180deg, #eef5ff 0%, #dfeaff 100%);
    box-shadow: 0 10px 24px rgba(21, 87, 214, 0.08);
    color: #1e3a8a;
}

.test-map-search-modal__mode-btn:focus-visible {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb, 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.test-map-search-modal__mode-btn:hover {
    border-color: #bfd5ee;
    background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
}

.test-map-search-modal__mode-btn.is-active:hover {
    border-color: rgba(21, 87, 214, 0.42);
    background: linear-gradient(180deg, #e9f2ff 0%, #d8e8ff 100%);
}

.test-map-search-modal__form[hidden] {
    display: none !important;
}

.test-map-search-modal__form {
    display: grid;
    gap: 12px;
    overflow: visible;
    padding: 14px 16px 16px;
    background: #ffffff;
}

.test-map-search-modal__form[data-search-form="hierarchy"]:not([hidden]),
.test-map-search-modal__form[data-search-form="name"]:not([hidden]) {
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

.test-map-search-modal__field {
    display: grid;
    gap: 8px;
}

.test-map-search-modal__field span {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5d6b80;
}

.test-map-search-modal__field select,
.test-map-search-modal__field input {
    min-height: 52px;
    padding: 12px 14px;
    box-sizing: border-box;
    border-radius: 16px;
    border: 1px solid #d7e3f1;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    color: #0f172a;
    font-size: 15px;
}

.test-map-search-modal__select-host {
    position: relative;
}

.test-map-search-modal__select-host > select {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.test-map-search-modal__custom-select {
    position: relative;
    width: 100%;
}

.test-map-search-modal__custom-select .custom-select-trigger {
    min-height: 52px;
    border: 1px solid #d7e3f1;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    color: #0f172a;
    display: flex;
    align-items: center;
    padding: 0 42px 0 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    line-height: 1.25;
}

.test-map-search-modal__custom-select .custom-select-trigger::after {
    content: "";
    position: absolute;
    right: 16px;
    top: 50%;
    width: 9px;
    height: 9px;
    border-right: 2px solid #6b7280;
    border-bottom: 2px solid #6b7280;
    transform: translateY(-62%) rotate(45deg);
    transition: transform 0.18s ease;
}

.test-map-search-modal__custom-select.open .custom-select-trigger::after {
    transform: translateY(-38%) rotate(-135deg);
}

.test-map-search-modal__custom-select.open .custom-select-trigger,
.test-map-search-modal__custom-select .custom-select-trigger:focus-visible {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb, 0 0 0 4px rgba(37, 99, 235, 0.18);
    outline: none;
}

.test-map-search-modal__custom-select.disabled .custom-select-trigger {
    color: #94a3b8;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    cursor: not-allowed;
}

.test-map-search-modal__custom-select .custom-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    border: 1px solid #d7e3f1;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
    max-height: min(44vh, 280px);
    overflow: auto;
    z-index: 12050;
}

.test-map-search-modal__custom-select.open .custom-options {
    display: flex;
}

.test-map-search-modal__custom-select.open-up .custom-options {
    top: auto;
    bottom: calc(100% + 8px);
}

.test-map-search-modal__custom-select .custom-option {
    font-size: 14px;
    color: #123d62;
    padding: 10px 14px;
    cursor: pointer;
}

.test-map-search-modal__custom-select .custom-option:hover {
    background: #eef5fb;
}

.test-map-search-modal__custom-select .custom-option.disabled {
    color: #8aa0b6;
    cursor: default;
}

.test-map-search-modal__custom-select .custom-option.is-selected {
    background: #e1edf8;
}

.test-map-search-modal__field select:focus,
.test-map-search-modal__field input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb, 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.test-map-search-modal__submit {
    min-height: 48px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 800;
    border: 1px solid transparent;
    background: linear-gradient(180deg, #2a76ff 0%, #1557d6 100%);
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(21, 87, 214, 0.2);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.12s ease;
}

.test-map-search-modal__submit:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg, #327cff 0%, #1b5fdd 100%);
    border-color: rgba(110, 174, 255, 0.3);
    box-shadow: 0 18px 30px rgba(21, 87, 214, 0.24);
}

.test-map-search-modal__submit:focus-visible {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb, 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.test-map-search-modal__field input:focus-visible {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb, 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.test-map-search-modal__results {
    max-height: min(44vh, 280px);
    overflow: auto;
    display: grid;
    gap: 8px;
    padding-top: 2px;
}

.test-map-search-modal__result-item {
    text-align: left;
    border: 1px solid #d7e3f1;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    padding: 12px 14px;
    cursor: pointer;
    display: grid;
    gap: 3px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.test-map-search-modal__result-item:hover {
    border-color: #bfd5ee;
    background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
}

.test-map-search-modal__result-item:focus-visible {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb, 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.test-map-search-modal__result-item strong {
    color: #0f172a;
    font-size: 15px;
}

.test-map-search-modal__result-item span {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.test-map-search-modal__results-empty {
    border: 1px dashed #d2e0ef;
    border-radius: 16px;
    padding: 12px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    background: #f8fbff;
}

@media (max-width: 1100px) {
    .test-map-hero {
        min-height: 220px;
        padding: 24px;
    }
}

@media (max-width: 900px) {
    .test-map-page {
        --place-size: 72px;
        --place-gap: 7px;
        padding-inline: 10px;
        margin: 0 auto;
    }

    .test-map-picker,
    .test-quarter-card {
        padding: 16px;
    }

    .test-map-cemetery-card {
        --cem-card-media-width: min(100%, 320px);
        --cem-card-media-size: 320px;
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .test-map-cemetery-card__media-host {
        width: 100%!important;
        margin: 0 auto;
    }

    .test-map-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #summary-places-item {
        display: none;
    }

    .test-map-picker__card,
    .test-quarter-card__header {
        display: grid;
        grid-template-columns: 1fr;
    }

    .test-map-picker__filters {
        grid-template-columns: 1fr;
    }

    .test-quarter-legend {
        justify-content: flex-start;
    }

    .test-quarter-card__aside {
        justify-content: flex-start;
    }

    .test-place-popover-switch {
        display: none;
    }

    .test-quarter-map { grid-auto-columns: 136px; }

    .test-place__body[data-tooltip]::after,
    .test-place__body[data-tooltip]::before {
        display: none;
    }

    a.test-place--occupied:hover,
    .test-place--interactive:hover,
    .test-place--interactive.is-active {
        transform: none;
        box-shadow: none;
    }
}

@media (max-width: 640px) {
    .test-map-shell {
        margin-top: 10px;
    }

    .test-map-page--empty {
        min-height: calc(100vh - 120px);
    }

    .test-map-cemetery-card {
        --cem-card-media-width: min(100%, 280px);
        --cem-card-media-size: 280px;
        padding: 14px;
    }

    .test-map-cemetery-card__main h2 {
        font-size: 26px;
    }

    .test-map-cemetery-card__facts {
        grid-template-columns: 1fr;
    }

    .test-map-cemetery-card__action {
        width: 100%;
        white-space: normal;
    }

    .test-map-state__actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .test-map-state__action {
        width: 100%;
    }

    .test-map-state__aside {
        width: 100%;
        justify-content: stretch;
    }

    .grvdet-photo-modal {
        padding: 12px;
    }

    .grvdet-photo-modal__layout {
        grid-template-columns: 1fr;
    }

    .grvdet-photo-modal__thumbs {
        flex-direction: row;
        max-height: none;
        max-width: 100%;
    }

    .test-map-picker__submit {
        width: 100%;
        justify-content: center;
    }

    .test-map-hero {
        padding: 18px;
    }

    .test-map-hero h1 {
        font-size: 28px;
    }



    .test-quarter-map { grid-auto-columns: 120px; }

    .test-map-search-modal {
        padding: 0;
        align-items: flex-end;
    }

    .test-map-search-modal__dialog {
        width: 100%;
        border-radius: 24px 24px 0 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        max-height: 88vh;
        overflow: visible;
    }

}
