:is(.necrovill-map,.dungeon-workbench-map) {
    --necro-line: #544934;
    --necro-muted: #c0b69f;
    --necro-gold: #f2d097;
}
:is(.necrovill-map,.dungeon-workbench-map) .dg-map-form {
    display: flex;
    align-items: end;
    gap: 10px;
    margin-bottom: 8px;
}
:is(.necrovill-map,.dungeon-workbench-map) .dg-map-form label {
    flex: 1 1 12rem;
    max-width: initial;
}
:is(.necrovill-map,.dungeon-workbench-map) .dg-map-form [data-map-levels] { flex: 0 1 8.5rem; }
:is(.necrovill-map,.dungeon-workbench-map) .dg-map-form .necro-map-places { flex: 1.35 1 15rem; }
:is(.necrovill-map,.dungeon-workbench-map) .dg-map-form [data-map-prev],
:is(.necrovill-map,.dungeon-workbench-map) .dg-map-form [data-map-next] { display: none; }
:is(.necrovill-map,.dungeon-workbench-map) .dg-map-form label[hidden] { display: none; }
:is(.necrovill-map,.dungeon-workbench-map) select {
    box-sizing: border-box;
    color: #f2e4c9;
    background: #101c17;
    border: 1px solid #796749;
    border-radius: 5px;
    padding: 7px 8px;
    font-size: 1rem;
}
:is(.necrovill-map,.dungeon-workbench-map) .dg-map-search-toggle > summary {
    min-height: 38px;
    padding-inline: 0;
    color: var(--necro-gold);
    background: transparent;
    border: 0;
    text-decoration: underline;
    text-underline-offset: .2em;
}
:is(.necrovill-map,.dungeon-workbench-map) .dg-map-search-toggle[open] {
    border-bottom: 1px solid var(--necro-line);
    margin-bottom: 12px;
    padding-bottom: 10px;
}
:is(.necrovill-map,.dungeon-workbench-map) [data-dungeon-map]:not([hidden]) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 12px;
    min-width: 0;
}
:is(.necrovill-map,.dungeon-workbench-map) [data-map-status] {
    color: #f0dfbd;
    font-weight: 650;
    font-size: 1rem;
    margin: 0;
}
:is(.necrovill-map,.dungeon-workbench-map) .dg-map-layout {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1.5fr) minmax(245px, 1fr);
    gap: 14px;
}
:is(.necrovill-map,.dungeon-workbench-map) .dg-map-zoom {
    justify-content: end;
    margin: 0;
}
:is(.necrovill-map,.dungeon-workbench-map) .dg-map-zoom button { border-radius: 4px; }
:is(.necrovill-map,.dungeon-workbench-map) .necro-map-open-card { display: none; }
:is(.necrovill-map,.dungeon-workbench-map) .dg-map-scroll {
    background: #0c1512;
    border: 1px solid #756348;
    border-radius: 6px;
    max-height: min(59vh, 590px);
    scrollbar-color: #716448 #101914;
}
:is(.necrovill-map,.dungeon-workbench-map) .dg-map-grid { margin-inline: auto; }
:is(.necrovill-map,.dungeon-workbench-map) .necro-map-level-row { position: relative; }
:is(.necrovill-map,.dungeon-workbench-map) .necro-map-level-marker {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    pointer-events: none;
    font-size: 12px;
    letter-spacing: .05em;
    color: #e3cda5;
}
:is(.necrovill-map,.dungeon-workbench-map) .necro-map-level-marker::before,
:is(.necrovill-map,.dungeon-workbench-map) .necro-map-level-marker::after {
    content: '';
    width: 18%;
    height: 1px;
    background: #685b42;
}
:is(.necrovill-map,.dungeon-workbench-map) .dg-map-grid--overview .necro-map-level-marker { display: none; }
:is(.necrovill-map,.dungeon-workbench-map) .dg-cell-coord { font-size: 10px; }
:is(.necrovill-map,.dungeon-workbench-map) .dg-cell[aria-pressed="true"] {
    color: #fff8dd;
    background: #445f48;
    outline: 3px solid #ffdb82;
    outline-offset: -3px;
    z-index: 3;
}
:is(.necrovill-map,.dungeon-workbench-map) .dg-cell[aria-pressed="true"] .dg-cell-symbol { color: inherit; }
:is(.necrovill-map,.dungeon-workbench-map) .dg-map-info {
    border-top: 3px solid #ae915e;
    border-radius: 6px;
    overflow-wrap: anywhere;
    background: #111d17;
    scroll-margin-top: 24px;
}
:is(.necrovill-map,.dungeon-workbench-map) .dg-map-info h3 {
    color: #f8e1b7;
    font-size: 1.2rem;
    line-height: 1.25;
    margin: 0 0 5px;
}
:is(.necrovill-map,.dungeon-workbench-map) .dg-map-point-detail {
    border: 0;
    background: transparent;
    margin: 9px 0;
    padding: 0;
}
:is(.necrovill-map,.dungeon-workbench-map) .dg-map-point-detail p { line-height: 1.45; }
:is(.necrovill-map,.dungeon-workbench-map) .dg-map-transition {
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    min-height: 44px;
    margin: 7px 0;
    padding: 8px 12px;
    background: #d5b57c;
    border: 1px solid #e3c798;
    border-radius: 4px;
    color: #252016;
    font-weight: 700;
    text-decoration: none;
    line-height: 1.25;
}
:is(.necrovill-map,.dungeon-workbench-map) .dg-map-transition:hover { background: #efce94; color: #19160e; }
:is(.necrovill-map,.dungeon-workbench-map) .dg-map-transition::after { content: '→'; margin-left: .55em; }
:is(.necrovill-map,.dungeon-workbench-map) .necro-cell-objects { margin-top: 9px; }
:is(.necrovill-map,.dungeon-workbench-map) .necro-cell-objects > summary {
    display: list-item;
    padding-block: 9px;
    color: var(--necro-gold);
    cursor: pointer;
}
:is(.necrovill-map,.dungeon-workbench-map) .necro-cell-objects .dg-map-object:first-of-type { margin-top: 0; }
:is(.necrovill-map,.dungeon-workbench-map) .necro-map-return { display: none; }
:is(.necrovill-map,.dungeon-workbench-map) :where(button, a, select, summary):focus-visible {
    outline: 3px solid #f3c174;
    outline-offset: 2px;
}
@media (max-width: 760px) {
    :is(.necrovill-map,.dungeon-workbench-map) [data-dungeon-map]:not([hidden]) {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }
    :is(.necrovill-map,.dungeon-workbench-map) .dg-map-form { gap: 6px 8px; }
    :is(.necrovill-map,.dungeon-workbench-map) .dg-map-form label { flex: 1 1 8.5rem; }
    :is(.necrovill-map,.dungeon-workbench-map) .dg-map-form [data-map-levels] { flex: 0 1 7rem; }
    :is(.necrovill-map,.dungeon-workbench-map) .dg-map-form .necro-map-places { flex: 1 1 100%; }
    :is(.necrovill-map,.dungeon-workbench-map) .dg-map-zoom { justify-content: start; flex-wrap: wrap; }
    :is(.necrovill-map,.dungeon-workbench-map) .necro-map-location {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }
    :is(.necrovill-map,.dungeon-workbench-map) .necro-map-open-card:not([hidden]) {
        display: block;
        flex: none;
        min-height: 44px;
        padding: 4px;
        border: 0;
        background: transparent;
        color: var(--necro-gold);
        text-decoration: underline;
        text-underline-offset: .2em;
        cursor: pointer;
    }
    :is(.necrovill-map,.dungeon-workbench-map) .dg-cell-coord { font-size: 12px; }
    :is(.necrovill-map,.dungeon-workbench-map) .dg-map-zoom button { min-height: 44px; min-width: 44px; padding-inline: 7px; }
    :is(.necrovill-map,.dungeon-workbench-map) .dg-map-layout { grid-template-columns: minmax(0, 1fr); }
    :is(.necrovill-map,.dungeon-workbench-map) .dg-map-scroll { max-height: min(49vh, 430px); }
    :is(.necrovill-map,.dungeon-workbench-map) .dg-map-info { scroll-margin-top: 72px; }
    :is(.necrovill-map,.dungeon-workbench-map) .necro-map-return {
        display: inline-block;
        min-height: 44px;
        margin-top: 4px;
        padding-inline: 0;
        border: 0;
        color: var(--necro-gold);
        background: transparent;
        text-decoration: underline;
        text-underline-offset: .2em;
        cursor: pointer;
    }
}
