#v40_wayfinding_error_dialog {
    box-sizing: border-box;
    width: min(560px, calc(100vw - 32px));
    max-width: 560px;
    max-height: min(720px, calc(100vh - 32px));
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: #fff;
    color: #182338;
    box-shadow: 0 24px 70px rgba(13, 24, 45, .32);
    overflow: auto;
}

#v40_wayfinding_error_dialog::backdrop {
    background: rgba(14, 25, 43, .57);
    backdrop-filter: blur(3px);
}

#v40_wayfinding_error_dialog,
#v40_wayfinding_error_dialog * {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#v40_wayfinding_error_dialog .v40-wf-modal { padding: 28px 30px 26px; }
#v40_wayfinding_error_dialog .v40-wf-modal__top { display: flex; align-items: flex-start; gap: 14px; }
#v40_wayfinding_error_dialog .v40-wf-modal__icon {
    display: grid;
    flex: 0 0 42px;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: #fff0d8;
    color: #a65b00;
    font-size: 26px;
    font-weight: 750;
    line-height: 1;
}
#v40_wayfinding_error_dialog .v40-wf-modal__heading { flex: 1; min-width: 0; }
#v40_wayfinding_error_dialog .v40-wf-modal__eyebrow {
    color: #9d5b09;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .09em;
    line-height: 1.4;
}
#v40_wayfinding_error_dialog .v40-wf-modal__title {
    margin: 3px 0 0;
    color: #17243b;
    font-size: 22px;
    font-weight: 750;
    line-height: 1.2;
}
#v40_wayfinding_error_dialog .v40-wf-modal__close {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #687488;
    cursor: pointer;
    font-size: 25px;
    line-height: 30px;
}
#v40_wayfinding_error_dialog .v40-wf-modal__close:hover { background: #f1f3f7; color: #182338; }
#v40_wayfinding_error_dialog .v40-wf-modal__lead {
    margin: 18px 0 0;
    color: #4b5a70;
    font-size: 15px;
    line-height: 1.5;
}
#v40_wayfinding_error_dialog .v40-wf-modal__details {
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px solid #f2d8b8;
    border-left: 4px solid #e99a31;
    border-radius: 10px;
    background: #fffaf3;
}
#v40_wayfinding_error_dialog .v40-wf-modal__label {
    color: #91550e;
    font-size: 12px;
    font-weight: 750;
}
#v40_wayfinding_error_dialog .v40-wf-modal__errors {
    margin: 7px 0 0;
    padding-left: 18px;
    color: #334155;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
#v40_wayfinding_error_dialog .v40-wf-modal__errors li + li { margin-top: 4px; }
#v40_wayfinding_error_dialog .v40-wf-modal__steps-title {
    margin: 22px 0 10px;
    color: #17243b;
    font-size: 15px;
    font-weight: 750;
}
#v40_wayfinding_error_dialog .v40-wf-modal__steps {
    margin: 0;
    padding-left: 23px;
    color: #44536a;
    font-size: 14px;
    line-height: 1.5;
}
#v40_wayfinding_error_dialog .v40-wf-modal__steps li { padding-left: 4px; }
#v40_wayfinding_error_dialog .v40-wf-modal__steps li + li { margin-top: 8px; }
#v40_wayfinding_error_dialog .v40-wf-modal__steps li::marker { color: #8754d1; font-weight: 750; }
#v40_wayfinding_error_dialog .v40-wf-modal__actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}
#v40_wayfinding_error_dialog .v40-wf-modal__actions button {
    min-height: 40px;
    padding: 9px 15px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
}
#v40_wayfinding_error_dialog .v40-wf-modal__secondary {
    border: 1px solid #d9dce7;
    background: #fff;
    color: #334155;
}
#v40_wayfinding_error_dialog .v40-wf-modal__secondary:hover { background: #f4f5f9; }
#v40_wayfinding_error_dialog .v40-wf-modal__primary {
    border: 1px solid #7046bc;
    background: #7549c7;
    color: #fff;
}
#v40_wayfinding_error_dialog .v40-wf-modal__primary:hover { background: #6338b5; }
#v40_wayfinding_error_dialog button:focus-visible { outline: 3px solid #b99bf0; outline-offset: 2px; }

#box_routing_esri #v40_wayfinding_guard_status.v40-wf-status--warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 10px;
    padding: 12px 14px;
    border: 1px solid #efc98d;
    border-left: 4px solid #db8a18;
    border-radius: 10px;
    background: #fff8eb;
    color: #553b13;
    box-shadow: 0 3px 10px rgba(87, 59, 19, .08);
    font: 600 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    white-space: pre-line;
    overflow-wrap: anywhere;
}
#box_routing_esri #v40_wayfinding_guard_status.v40-wf-status--warning::before {
    content: "!";
    display: grid;
    flex: 0 0 22px;
    place-items: center;
    height: 22px;
    border-radius: 50%;
    background: #f7dfb5;
    color: #8c5307;
    font-size: 15px;
    font-weight: 800;
}
#box_routing_esri #v40_wayfinding_guard_status[hidden] { display: none !important; }

#box_routing_esri #input_ESRI_line_node_a.v40-wf-endpoint-invalid,
#box_routing_esri #input_ESRI_line_node_b.v40-wf-endpoint-invalid {
    border: 2px solid #d72e37 !important;
    background: #fff0f1 !important;
    color: #971b23 !important;
    box-shadow: 0 0 0 3px rgba(215, 46, 55, .14) !important;
}

#inputboxinboxSubmit_leaflet_save_JSON.v40-wf-save-disabled,
#inputboxinboxSubmit_leaflet_save_JSON.v40-wf-save-disabled:hover {
    background: #d6dbe2 !important;
    border-color: #c5ccd5 !important;
    color: #627080 !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}

@media (max-width: 520px) {
    #v40_wayfinding_error_dialog .v40-wf-modal { padding: 22px 20px; }
    #v40_wayfinding_error_dialog .v40-wf-modal__title { font-size: 19px; }
    #v40_wayfinding_error_dialog .v40-wf-modal__actions button { width: 100%; }
}

.v40-wf-direction-icon { pointer-events: none !important; background: transparent; border: 0; }
.v40-wf-endpoint span {
    display: grid; place-items: center; width: 26px; height: 26px;
    border: 2px solid #fff; border-radius: 50%; background: #17243b; color: #fff;
    font: 800 14px/1 sans-serif; box-shadow: 0 2px 7px #0005;
}
.v40-wf-direction-arrow span {
    display: block; width: 26px; height: 26px; text-align: center;
    color: #146c3a; background: #fff; border-radius: 50%;
    box-shadow: 0 1px 5px #0004; font: 800 20px/26px sans-serif;
}
.v40-wf-direction-arrow.is-blocked span { color: #ba2932; }

/* Detailed leg labels: selected by default; all legs with Extra info enabled. */
.leaflet-tooltip.v40-wayfinding-leg-label.v40-wf-leg-summary {
    padding: 8px 10px;
    border: 1px solid #9c81d0;
    border-left: 3px solid #7549c7;
    border-radius: 9px;
    background: rgba(255,255,255,.98);
    color: #24334a;
    box-shadow: 0 4px 14px rgba(25,30,60,.18);
    font: 500 12px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    white-space: normal;
    width: max-content;
    min-width: 145px;
    max-width: 240px;
}
.v40-wf-leg-summary__top { display: flex; margin-bottom: 5px; }
.v40-wf-leg-summary__name { font-size: 13px; font-weight: 800; overflow-wrap: anywhere; }
.v40-wf-leg-summary__row { display: flex; align-items: center; gap: 10px; }
.v40-wf-leg-summary__direction { padding: 2px 6px; border-radius: 5px; background: #e8f5ec; color: #17643a; font-weight: 750; white-space: nowrap; }
.v40-wf-leg-summary__direction.is-blocked { background: #ffecee; color: #a52534; }
.v40-wf-leg-summary__access { display: inline-flex; align-items: center; gap: 3px; color: #334155; }
.v40-wf-access-icon { display: block; width: 19px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.v40-wf-leg-summary__physical { display: block; margin-top: 5px; color: #44546b; white-space: normal; }
.v40-wf-leg-summary__limitation { display: block; margin-top: 4px; color: #965600; max-width: 215px; }

/* Both label controls use the same visibility eye and one row each. */
body.v40-wayfinding-leg-mode #v40_wayfinding_labels_row {
    display: flex; flex-direction: column; align-items: stretch; gap: 8px;
}
#v40_wayfinding_labels_row #v40_wayfinding_labels_toggle { width: 100%; flex: 0 0 auto; }
#v40_wayfinding_labels_extra {
    display: flex; align-items: center; gap: 5px; flex: 0 0 auto; width: 100%; min-height: 24px;
    margin: 0; padding: 0; border: 0; background: transparent;
    color: #000; font: 10px/1.3 Arial, Helvetica, sans-serif; text-align: left; cursor: pointer;
}
#v40_wayfinding_labels_extra .v40-wf-extra-track {
    display: block; flex: 0 0 20px; width: 20px; height: 20px; border-radius: 4px;
    background: #ff0000 url('https://www.wizzymaps.com/images/btn_zichtbaar_clickitem.svg') center/20px 20px no-repeat;
}
#v40_wayfinding_labels_extra[aria-checked="true"] .v40-wf-extra-track { background-color: #07d332; }
#v40_wayfinding_labels_extra:focus-visible { outline: 2px solid #00a6eb; outline-offset: 2px; }
.leaflet-tooltip.v40-wayfinding-leg-label.v40-wf-leg-summary--unselected {
    border-color: #bcc5d1; border-left-color: #8c9aac;
}

/* Read-only grid guide remains available while placing ordinary POIs. */
#v40_wayfinding_grid_row { display: flex; clear: both; margin: 0 0 12px; }
#v40_wayfinding_grid_row[hidden] { display: none !important; }
#v40_wayfinding_grid_toggle {
    display: flex; align-items: center; gap: 5px; width: 100%; box-sizing: border-box;
    min-height: 24px; margin: 0; padding: 0; border: 0; background: transparent;
    color: #000; font: 10px/1.3 Arial, Helvetica, sans-serif; text-align: left; cursor: pointer;
}
#v40_wayfinding_grid_toggle img { flex: 0 0 20px; width: 20px; height: 20px; border-radius: 4px; background: #07d332; }
#v40_wayfinding_grid_toggle[aria-pressed="false"] img { background: #ff0000; }
#v40_wayfinding_grid_toggle .v40-wayfinding-grid-sample { flex: 1 1 10px; min-width: 8px; max-width: 18px; height: 1px; background: #ff00ff; margin-left: auto; }
#v40_wayfinding_grid_toggle:focus-visible { outline: 2px solid #00a6eb; outline-offset: 2px; }
