.map-tool-search-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 9px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: rgba(20, 17, 10, .88);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.map-tool-search-shell:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(246, 207, 60, .14);
}

.map-tool-search-shell input {
    width: 100%;
    min-width: 0;
    padding: 8px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff6cf;
    font-size: 12px;
}

.map-tool-search-shell input::placeholder {
    color: #917e4f;
}

.map-tool-search-shell kbd {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    border: 1px solid #675329;
    border-radius: 5px;
    background: #302716;
    color: #c7b47c;
    font: 750 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.map-search-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.map-search-groups button {
    min-height: 27px;
    padding: 4px 8px;
    border: 1px solid #5d4a25;
    border-radius: 999px;
    background: rgba(26, 21, 12, .88);
    color: #cdbb86;
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
}

.map-search-groups button:hover,
.map-search-groups button.is-active {
    border-color: #d5ad30;
    background: rgba(246, 207, 60, .14);
    color: #ffe678;
}

.map-search-panel [data-map-search-status] {
    margin: 8px 0 0;
}

.map-search-results {
    display: grid;
    gap: 6px;
    max-height: 340px;
    margin-top: 8px;
    overflow: auto;
}

.map-search-result {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px;
    border: 1px solid #574620;
    border-radius: 7px;
    background: linear-gradient(180deg, rgba(52, 42, 22, .9), rgba(34, 28, 16, .94));
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.map-search-result:hover,
.map-search-result:focus-visible {
    border-color: var(--gold);
    background: linear-gradient(180deg, rgba(77, 60, 22, .96), rgba(43, 34, 16, .98));
    outline: 0;
}

.map-search-result-kind {
    display: inline-grid;
    place-items: center;
    min-width: 43px;
    min-height: 24px;
    padding: 3px 6px;
    border: 1px solid rgba(246, 207, 60, .25);
    border-radius: 5px;
    background: rgba(246, 207, 60, .09);
    color: #e9c84e;
    font-size: 9px;
    font-weight: 900;
    line-height: 1.05;
    text-align: center;
    text-transform: uppercase;
}

.map-search-result-copy {
    min-width: 0;
}

.map-search-result-copy strong,
.map-search-result-copy span,
.map-search-result-copy small {
    display: block;
}

.map-search-result-copy strong {
    overflow: hidden;
    color: #fff;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-search-result-copy span {
    margin-top: 2px;
    overflow: hidden;
    color: #d8c796;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-search-result-copy small {
    margin-top: 3px;
    overflow: hidden;
    color: #9d8b5e;
    font-size: 9px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-search-result-arrow {
    color: var(--gold);
    font-size: 16px;
}

.map-search-empty {
    margin: 0;
    padding: 10px;
    border: 1px dashed #5c4a26;
    border-radius: 7px;
    color: #a99767;
    font-size: 11px;
    text-align: center;
}

.map-progress-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.map-progress-stats div {
    min-width: 0;
    padding: 8px 5px;
    border: 1px solid #594820;
    border-radius: 7px;
    background: rgba(22, 18, 10, .64);
    text-align: center;
}

.map-progress-stats strong,
.map-progress-stats span {
    display: block;
}

.map-progress-stats strong {
    color: #ffe678;
    font-size: 11px;
    line-height: 1.15;
}

.map-progress-stats span {
    margin-top: 4px;
    color: #9f8d5c;
    font-size: 8px;
    line-height: 1.15;
}

.map-progress-options {
    margin-top: 8px;
}

.map-save-position-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    margin-top: 8px;
    padding: 9px;
    border: 1px solid rgba(246, 207, 60, .35);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(246, 207, 60, .12), rgba(22, 18, 10, .8));
}

.map-save-position-card > div,
.map-save-position-card span,
.map-save-position-card strong,
.map-save-position-card small {
    display: block;
    min-width: 0;
}

.map-save-position-card span {
    color: #bda85e;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .12em;
}

.map-save-position-card strong {
    margin-top: 3px;
    overflow: hidden;
    color: #fff0a6;
    font-size: 10px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-save-position-card small {
    margin-top: 3px;
    color: #a99767;
    font-size: 8px;
    line-height: 1.35;
}

.map-save-position-card a {
    padding: 7px 8px;
    border: 1px solid #715d25;
    border-radius: 6px;
    background: rgba(17, 15, 10, .76);
    color: #ffe678;
    font-size: 8px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
}

.map-save-position-card.is-ready {
    border-color: rgba(119, 183, 105, .56);
    background: linear-gradient(135deg, rgba(119, 183, 105, .13), rgba(22, 18, 10, .82));
}

.map-save-position-card.is-ready span {
    color: #9ed58e;
}

.map-save-position-card.is-ready a {
    border-color: rgba(119, 183, 105, .58);
    color: #c9f2bf;
}

.map-current-progress-action {
    width: 100%;
    margin-top: 8px;
}

.map-save-position {
    position: absolute;
    z-index: 30;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff6bd;
    cursor: pointer;
    filter: drop-shadow(0 5px 6px rgba(0, 0, 0, .72));
    pointer-events: auto;
    transform: translate(-50%, -50%);
}

.map-save-position[hidden] {
    display: none;
}

.map-save-position::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 14px;
    width: 34px;
    height: 34px;
    border: 2px solid rgba(246, 207, 60, .72);
    border-radius: 999px;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: map-save-position-pulse 1.8s ease-out infinite;
}

.map-save-position-pin {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 2px solid #fff3a0;
    border-radius: 999px;
    background: #d7ad24;
    box-shadow: inset 0 0 0 3px #4a3a12, 0 0 0 2px rgba(0, 0, 0, .58);
    color: #17130b;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: -.02em;
}

.map-save-position-label {
    max-width: 100px;
    padding: 4px 6px;
    overflow: hidden;
    border: 1px solid #715d25;
    border-radius: 5px;
    background: rgba(17, 15, 10, .9);
    color: #fff0a6;
    font-size: 8px;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes map-save-position-pulse {
    0% { opacity: .85; transform: translate(-50%, -50%) scale(.55); }
    75%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.35); }
}

.map-missing-catches {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #55441f;
}

.map-missing-catches p {
    margin: 0;
    color: #ad9b68;
    font-size: 10px;
    line-height: 1.4;
}

.map-missing-catches strong {
    color: #fff0a6;
}

.map-missing-catch-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
}

.map-missing-catch-list a {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 7px;
    border: 1px solid #5c4b25;
    border-radius: 999px;
    background: rgba(26, 22, 13, .82);
    color: #e6d69f;
    font-size: 9px;
    font-weight: 800;
}

.map-missing-catch-list a:hover {
    border-color: var(--gold);
    color: #ffe678;
}

.map-marker.is-map-complete {
    opacity: .48;
    filter: grayscale(.65) drop-shadow(0 4px 7px rgba(0, 0, 0, .28));
}

.map-marker.is-map-complete::after {
    content: "✓";
    position: absolute;
    z-index: 10;
    left: 14px;
    top: -8px;
    display: inline-grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border: 2px solid #17130b;
    border-radius: 999px;
    background: #77b769;
    color: #10210d;
    font-size: 10px;
    font-weight: 950;
    line-height: 1;
}

.map-marker.is-map-complete.is-selected {
    opacity: .8;
}

.map-marker.is-map-complete-hidden {
    display: none !important;
}

.map-helper-deck {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr);
    gap: 8px;
}

.map-helper-deck .deck-panel {
    min-height: 0;
}

.map-route-panel,
.map-puzzle-panel {
    background:
        radial-gradient(circle at 90% 0%, rgba(246, 207, 60, .11), transparent 32%),
        linear-gradient(180deg, rgba(49, 40, 21, .98), rgba(30, 25, 14, .98));
}

.map-route-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: end;
    gap: 8px;
}

.map-route-controls label,
.map-puzzle-select {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.map-route-controls label > span {
    color: #ad9b68;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.map-route-controls select,
.map-puzzle-select select {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0 30px 0 9px;
    border: 1px solid #695526;
    border-radius: 6px;
    background: #211b10;
    color: #fff2b6;
    font-size: 11px;
}

.map-route-controls select:focus,
.map-puzzle-select select:focus {
    border-color: var(--gold);
    outline: 2px solid rgba(246, 207, 60, .13);
}

.map-route-arrow {
    padding-bottom: 9px;
    color: var(--gold);
    font-size: 18px;
    font-weight: 900;
}

.map-route-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 7px;
}

.map-route-note {
    margin: 8px 0 0;
    color: #b6a372;
    font-size: 9px;
    line-height: 1.4;
}

.map-route-mode {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 5px;
    margin-top: 8px;
}

.map-route-mode button {
    padding: 5px 8px;
    border: 1px solid #5f4c23;
    border-radius: 4px;
    background: #1d180e;
    color: #9d8b5b;
    font-size: 8px;
    font-weight: 850;
}

.map-route-mode button.is-active {
    border-color: var(--gold);
    background: #3b3017;
    color: #ffe678;
}

.map-route-mode > span {
    color: #b09e6a;
    font-size: 8px;
    line-height: 1.35;
    text-align: right;
    overflow-wrap: anywhere;
}

.map-retry-button {
    margin-left: 6px;
    vertical-align: middle;
}

.map-route-result {
    margin-top: 9px;
}

.map-route-result > p {
    margin: 0;
    padding: 10px;
    border: 1px dashed #5b4924;
    border-radius: 7px;
    color: #ab9966;
    font-size: 10px;
    text-align: center;
}

.map-route-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
    color: #cbbb88;
    font-size: 10px;
}

.map-route-summary span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.map-route-summary strong {
    color: #ffe678;
}

.map-route-caveats {
    display: grid;
    gap: 6px;
    margin: 0 0 8px;
    padding: 8px;
    border: 1px solid rgba(223, 140, 54, .58);
    border-radius: 7px;
    background: rgba(111, 58, 20, .24);
}

.map-route-caveats > strong {
    color: #ffd58f;
    font-size: 9px;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.map-route-caveats > .map-route-caveat {
    padding-top: 5px;
    border-top: 1px solid rgba(223, 140, 54, .22);
}

.map-route-caveats > .map-route-caveat > span {
    color: #fff1c6;
    font-size: 10px;
    font-weight: 850;
}

.map-route-caveats > .map-route-caveat > p {
    margin: 2px 0 0;
    color: #c8ad7b;
    font-size: 9px;
    line-height: 1.42;
}

.map-route-caveat.is-open {
    border-left: 3px solid #77b769;
    padding-left: 7px;
}

.map-route-caveat.is-blocked {
    border-left: 3px solid #df765d;
    padding-left: 7px;
}

.map-route-caveat.is-save-locked {
    background: rgba(112, 38, 31, .2);
}

.map-route-requirements {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.map-route-requirements .map-route-requirement {
    max-width: 100%;
    padding: 3px 5px;
    border: 1px solid #76503a;
    border-radius: 999px;
    background: rgba(34, 25, 14, .7);
    color: #d79078;
    font-size: 7px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.map-route-requirements .map-route-requirement.is-met {
    border-color: #537b47;
    color: #95ca82;
}

.map-route-caveat > button {
    margin-top: 5px;
    padding: 4px 6px;
    border: 1px solid #705626;
    border-radius: 4px;
    background: #211a0e;
    color: #d7ba5c;
    font-size: 7px;
    font-weight: 850;
}

.map-route-caveat > button:disabled {
    border-color: #774c42;
    color: #e09884;
    cursor: not-allowed;
    opacity: .82;
}

.map-route-blocked-summary {
    margin-bottom: 7px;
    padding: 10px;
    border: 1px solid #824e42;
    border-radius: 7px;
    background: rgba(83, 37, 28, .34);
}

.map-route-blocked-summary strong {
    color: #f2a18d;
    font-size: 11px;
}

.map-route-blocked-summary p {
    margin: 4px 0 0;
    color: #c7a17f;
    font-size: 8px;
    line-height: 1.45;
}

.map-route-step.is-blocked {
    border-color: #7d493e;
    background: rgba(71, 34, 27, .48);
}

.map-route-step.is-blocked .map-route-step-index {
    background: #7b3f32;
    color: #ffd2c7;
}

.map-route-steps {
    display: grid;
    gap: 5px;
    max-height: 270px;
    margin: 0;
    padding: 0;
    overflow: auto;
    list-style: none;
}

.map-route-step {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 7px;
    border: 1px solid #56451f;
    border-radius: 7px;
    background: rgba(25, 21, 12, .72);
}

.map-route-step-index {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #584615;
    color: #ffe678;
    font-size: 10px;
    font-weight: 900;
}

.map-route-step-copy {
    min-width: 0;
}

.map-route-step-copy strong,
.map-route-step-copy span {
    display: block;
}

.map-route-step-copy strong {
    color: #fff;
    font-size: 10px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.map-route-step-copy span {
    margin-top: 2px;
    color: #a99767;
    font-size: 9px;
}

.map-route-step button {
    min-height: 27px;
    padding: 4px 8px;
    border: 1px solid #806526;
    border-radius: 5px;
    background: rgba(246, 207, 60, .08);
    color: #f2d75f;
    cursor: pointer;
    font-size: 9px;
    font-weight: 850;
}

.map-route-step button:hover {
    border-color: var(--gold);
    background: rgba(246, 207, 60, .16);
}

.map-puzzle-intro {
    margin-top: 8px;
}

.map-puzzle-intro h3 {
    margin: 0;
    color: #fff;
    font-size: 13px;
}

.map-puzzle-intro p {
    margin: 4px 0 0;
    color: #c6b582;
    font-size: 10px;
    line-height: 1.4;
}

.map-puzzle-requirements {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
}

.map-puzzle-requirements span {
    padding: 3px 6px;
    border: 1px solid #665225;
    border-radius: 999px;
    background: rgba(246, 207, 60, .07);
    color: #d7c27c;
    font-size: 8px;
    font-weight: 800;
}

.map-puzzle-progress {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    color: #a79564;
    font-size: 9px;
}

.map-puzzle-progress span {
    display: block;
    height: 5px;
    flex: 1;
    overflow: hidden;
    border-radius: 999px;
    background: #211b10;
}

.map-puzzle-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ce5252, #f6cf3c);
}

.map-puzzle-steps {
    display: grid;
    gap: 6px;
    max-height: 340px;
    margin: 9px 0 0;
    padding: 0;
    overflow: auto;
    list-style: none;
    counter-reset: map-puzzle-step;
}

.map-puzzle-step {
    counter-increment: map-puzzle-step;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
    padding: 8px;
    border: 1px solid #56451f;
    border-radius: 7px;
    background: rgba(24, 20, 12, .75);
}

.map-puzzle-step::before {
    content: counter(map-puzzle-step);
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: #503f18;
    color: #ffe678;
    font-size: 9px;
    font-weight: 950;
}

.map-puzzle-step.is-complete {
    border-color: rgba(119, 183, 105, .55);
    background: rgba(40, 65, 31, .32);
}

.map-puzzle-step.is-complete::before {
    content: "✓";
    background: #5c9c50;
    color: #11230d;
}

.map-puzzle-step-copy strong,
.map-puzzle-step-copy p {
    display: block;
}

.map-puzzle-step-copy strong {
    color: #fff;
    font-size: 10px;
}

.map-puzzle-step-copy p {
    margin: 3px 0 0;
    color: #b5a575;
    font-size: 9px;
    line-height: 1.42;
}

.map-puzzle-step-actions {
    display: grid;
    gap: 5px;
}

.map-puzzle-step-actions button {
    min-height: 25px;
    padding: 3px 7px;
    border: 1px solid #705923;
    border-radius: 5px;
    background: rgba(246, 207, 60, .08);
    color: #e8d064;
    cursor: pointer;
    font-size: 8px;
    font-weight: 850;
    white-space: nowrap;
}

.map-puzzle-step-actions button[data-map-puzzle-step-toggle] {
    border-color: #4f6642;
    background: rgba(119, 183, 105, .08);
    color: #a7d49d;
}

.map-puzzle-tip {
    margin: 8px 0 0;
    padding: 7px 8px;
    border-left: 3px solid #ce5252;
    border-radius: 0 5px 5px 0;
    background: rgba(206, 82, 82, .08);
    color: #cdbb86;
    font-size: 9px;
    line-height: 1.4;
}

@media (max-width: 1120px) {
    .map-helper-deck {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .map-route-controls {
        grid-template-columns: 1fr;
    }

    .map-route-arrow {
        display: none;
    }

    .map-route-actions {
        grid-column: auto;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
    }

    .map-route-actions button {
        min-width: 0;
        white-space: normal;
    }

    .map-route-actions .gold-fill {
        grid-column: 1 / -1;
    }

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

    .map-route-mode > span {
        grid-column: 1 / -1;
        text-align: left;
    }

    .map-route-step,
    .map-puzzle-step {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .map-route-step > button,
    .map-puzzle-step-actions {
        grid-column: 2;
        justify-self: start;
    }
}

@media (max-width: 420px) {
    .map-route-actions {
        grid-template-columns: 1fr;
    }

    .map-route-actions .gold-fill {
        grid-column: auto;
    }

    .map-progress-stats {
        grid-template-columns: 1fr;
    }

    .map-progress-stats div {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        text-align: left;
    }

    .map-progress-stats span {
        margin-top: 0;
    }
}
