body.map-page {
    background: #f5f7f4;
    color: #243029;
    font-family: "Helvetica Neue", Arial, sans-serif;
}

.map-page a {
    color: #2f6846;
}

.map-page-shell {
    width: min(1480px, calc(100% - 30px));
    margin: 0 auto;
    padding: 24px 0 42px;
}

.map-page-header {
    margin-bottom: 18px;
}

.map-page-title {
    margin: 0 0 4px;
    font-size: 30px;
    font-weight: 700;
    color: #1f2b24;
}

.map-page-subtitle {
    color: #68766d;
    font-size: 15px;
}

.map-section {
    background: #fff;
    border: 1px solid #dde5dc;
    border-radius: 6px;
    box-shadow: 0 10px 28px rgba(35, 48, 40, 0.08);
    margin-bottom: 22px;
    padding: 18px;
}

.map-section-title {
    margin: 0 0 14px;
    font-size: 20px;
    font-weight: 700;
    color: #243029;
}

.map-panel {
    overflow: hidden;
}

.map-stage {
    position: relative;
    width: 100%;
    height: 640px;
    min-height: 520px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #eef2ec;
    border: 1px solid #cbd7ca;
    border-radius: 6px;
}

.map-stage-empty {
    color: #68766d;
    font-size: 15px;
}

.public-map-stage {
    display: block;
}

.public-map-viewport {
    position: absolute;
    inset: 0;
    overflow: hidden;
    touch-action: none;
    cursor: grab;
}

.public-map-viewport.is-dragging {
    cursor: grabbing;
}

.public-map-content {
    position: absolute;
    left: 0;
    top: 0;
    width: auto;
    height: auto;
    transform-origin: 0 0;
    will-change: transform;
}

.public-map-content img {
    display: block;
    width: auto;
    height: auto;
    max-width: none;
    user-select: none;
    -webkit-user-drag: none;
}

.public-map-overlay {
    position: absolute;
    left: 0;
    top: 0;
    max-width: none;
    overflow: visible;
}

.public-map-grave {
    fill: rgba(47, 97, 65, 0);
    stroke: rgba(47, 97, 65, 0);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
    cursor: pointer;
    transition: fill 120ms ease, stroke 120ms ease;
}

.public-map-grave.public-map-grave-dynamic {
    fill: var(--grave-color, #9aa39d);
    fill-opacity: 0.58;
    stroke: rgba(44, 57, 48, 0.72);
    stroke-width: 1.5;
}

.public-map-grave.public-map-grave-dynamic:hover,
.public-map-grave.public-map-grave-dynamic.is-active {
    fill: var(--grave-color, #9aa39d);
    fill-opacity: 0.78;
}

.public-map-grave-label {
    fill: #17251c;
    font: 600 12px Arial, sans-serif;
    letter-spacing: 0;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

.public-map-grave:hover,
.public-map-grave.is-active {
    fill: rgba(47, 97, 65, 0.18);
    stroke: rgba(47, 97, 65, 0.8);
}

.public-map-grave.is-search-highlight {
    fill: rgba(211, 47, 47, 0.22);
    stroke: rgba(211, 47, 47, 0.95);
    stroke-width: 4;
}

.public-map-toolbar {
    position: absolute;
    right: 14px;
    top: 14px;
    z-index: 20;
    display: flex;
    gap: 6px;
    padding: 6px;
    background: rgba(31, 41, 35, 0.58);
    border-radius: 6px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}

.public-map-toolbar button {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 4px;
    color: #415447;
    background: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.public-map-toolbar button[data-map-action="reset"] {
    font-size: 12px;
    font-weight: 600;
}

.map-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.map-toolbar .btn {
    white-space: normal;
}

#mapwrapper {
    width: 100%;
    height: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#main_map {
    position: relative;
    cursor: move;
    z-index: 1;
    margin: 0 auto;
    overflow: hidden;
}

#canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 127;
    display: none;
    cursor: crosshair;
    background-color: #fff;
    opacity: 0.5;
}

.map-control {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 124px;
    height: 78px;
    z-index: 120;
    background: rgba(60, 60, 60, 0.55);
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
    display: block !important;
    pointer-events: auto;
}

.map-control a {
    position: absolute;
    display: block;
    width: 28px;
    height: 28px;
    overflow: hidden;
    color: transparent;
    font-size: 0;
    line-height: 28px;
    text-align: center;
    text-indent: 0;
    background: #fff;
    border: 1px solid #b8c6b7;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    opacity: 1 !important;
    pointer-events: auto;
}

.map-control a:hover {
    background: #eaf2ea;
}

.map-control a span {
    display: block;
    color: #6e7780;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 26px;
    text-align: center;
    text-shadow: 0 1px 0 #fff;
}

.map-control a.up span,
.map-control a.down span {
    font-size: 15px;
}

.map-control a.zoom { left: 8px; top: 8px; }
.map-control a.back { left: 8px; top: 42px; }
.map-control a.left { left: 50px; top: 25px; }
.map-control a.right { left: 88px; top: 25px; }
.map-control a.up { left: 69px; top: 8px; }
.map-control a.down { left: 69px; top: 42px; }

#select-grave,
#confirm-grave,
#cancel-grave,
#saving {
    display: none !important;
}

.search-panel .form-control {
    height: 42px;
}

.search-result {
    margin-top: 16px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.info-card {
    background: #fff;
    border: 1px solid #dde5dc;
    border-radius: 6px;
    padding: 18px;
    min-height: 160px;
}

.info-card-title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
}

.action-list .btn {
    margin-bottom: 8px;
    text-align: left;
}

.notice-board {
    margin-top: 18px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.gallery-item {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 6px;
    background: #e8eee7;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.gallery-item:hover img {
    transform: scale(1.03);
}

div#small-info {
    position: absolute;
    display: none;
    z-index: 3000;
    width: 270px;
    padding: 12px;
    background: #fff;
    border: 1px solid #c9d6c8;
    border-radius: 6px;
    box-shadow: 0 18px 35px rgba(29, 42, 34, 0.20);
    pointer-events: auto;
}

.grave-preview-title {
    color: #6b766d;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
}

.grave-preview-number {
    margin-bottom: 10px;
    color: #1f2b24;
    font-size: 20px;
    font-weight: 700;
}

.grave-preview-photo {
    display: block;
    margin-bottom: 10px;
}

.grave-preview-photo img {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 4px;
}

.grave-preview-loading,
.modal-loading {
    padding: 16px;
    color: #68766d;
    text-align: center;
}

.green {
    color: #15803d;
}

.brown {
    color: #7c4a26;
}

#graveDetailModal .modal-content {
    overflow: hidden;
    border-radius: 8px;
}

#graveDetailModal .modal-body {
    padding: 0;
    overflow: auto;
}

.grave-detail {
    color: #243027;
}

.grave-detail-hero {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
    background: #f7faf7;
    border-bottom: 1px solid #e3e8e4;
}

.grave-detail-photo {
    display: block;
    width: 190px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #e6ece7;
    border: 1px solid #d8e1da;
    border-radius: 6px;
}

.grave-detail-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.grave-detail-photo-empty {
    display: grid;
    place-items: center;
    color: #68766d;
    font-size: 13px;
}

.grave-detail-meta {
    min-width: 0;
    align-self: center;
}

.grave-detail-kicker {
    margin-bottom: 5px;
    color: #5d6f62;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.grave-detail-meta h3 {
    margin: 0;
    font-size: 24px;
    line-height: 1.18;
}

.grave-detail-subtitle {
    margin-top: 8px;
    color: #607066;
    font-size: 14px;
}

.grave-detail-section {
    padding: 18px;
}

.grave-detail-section-title {
    margin-bottom: 10px;
    color: #45574b;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.grave-detail-list {
    display: grid;
    gap: 8px;
}

.grave-detail-person {
    display: grid;
    grid-template-columns: minmax(180px, 1.2fr) minmax(230px, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e1e7e2;
    border-radius: 6px;
}

.grave-detail-person-location {
    grid-column: 1 / -1;
    width: max-content;
    max-width: 100%;
    padding: 3px 7px;
    color: #2f6141;
    background: #edf5ef;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.grave-detail-person-name {
    min-width: 0;
    font-size: 16px;
    font-weight: 700;
}

.grave-detail-person-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.grave-detail-person-dates span {
    display: block;
    margin-bottom: 2px;
    color: #6b776e;
    font-size: 12px;
}

.grave-detail-person-dates strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.grave-detail-empty {
    margin: 18px;
    padding: 14px;
    color: #69521a;
    background: #fff8df;
    border: 1px solid #ead99c;
    border-radius: 6px;
}

.grave-modal-summary {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}

.grave-modal-photo img {
    width: 220px;
    max-width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #dde5dc;
    box-shadow: 0 10px 22px rgba(20, 34, 24, 0.15);
}

.grave-modal-photo-link {
    display: inline-block;
    cursor: zoom-in;
}

.grave-photo-modal .modal-body {
    text-align: center;
    background: #f7f9f6;
}

.grave-photo-modal .modal-body img {
    max-width: 100%;
    max-height: 78vh;
    border-radius: 6px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

.grave-modal-label {
    color: #6b766d;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
}

.grave-modal-number {
    font-size: 20px;
    font-weight: 700;
}

.grave-modal-table-wrap {
    border: 1px solid #e1e6e0;
    border-radius: 6px;
}

.grave-modal-table {
    margin-bottom: 0;
}

.grave-modal-table > thead > tr > th {
    border-bottom: 1px solid #dce5dc;
    background: #f6f8f5;
}

@media (max-width: 991px) {
    .map-stage {
        height: 560px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .map-page-shell {
        width: calc(100% - 20px);
        padding-top: 14px;
    }

    .map-section {
        padding: 12px;
    }

    .map-stage {
        height: 440px;
        min-height: 440px;
    }

    .map-page-title {
        font-size: 24px;
    }

    .grave-modal-summary {
        align-items: flex-start;
    }

    .grave-detail-hero {
        grid-template-columns: 1fr;
    }

    .grave-detail-photo {
        width: 100%;
    }

    .grave-detail-person {
        grid-template-columns: 1fr;
    }

    .grave-detail-person-dates {
        grid-template-columns: 1fr 1fr;
    }
}
