
#stairs {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 1em 1.5em;
    position: sticky;
    top: 3em;
}

#stairs:has( > .stairs__title) {
    top: 1em;
}

body:has( > #wpadminbar) #stairs {
    top: calc(3em + 32px);
}

body:has( > #wpadminbar) #stairs:has( > .stairs__title) {
    top: calc(1em + 32px);
}

.stairs__title {
    text-align: center;
}

#stairbase-l {
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: contain;
    object-position: 50% 50%;
    overflow: visible;
    width: calc(100% - 2em);
}

.stairs__step {
    vector-effect: non-scaling-stroke; 
}

.stairs__legend {
    font-size: 0.75em;
    line-height: 1;
    position: absolute;
    text-align: center;
    z-index: 3;
}

.stairs__legend:before {
    content: '';
    position: absolute;
    z-index: 1;
}

.stairs__legend--x {
    border-left: 1px dashed #0006;
    border-right: 1px dashed #0006;
    left: 0;
    right: 0;
    top: 100%;
    top: calc(100% + 1em);
}

.stairs__legend--x::before {
    border-top: 1px dashed #0006;
    left: 0;
    right: 0;
    top: 50%;
}

.stairs__legend--y {
    border-bottom: 1px dashed #0006;
    border-top: 1px dashed #0006;
    bottom: 0;
    left: 100%;
    left: calc(100% + 1em);
    top: 0;
    writing-mode: vertical-rl;
}

.stairs__legend--y::before {
    border-left: 1px dashed #0006;
    bottom: 0;
    left: 50%;
    top: 0;
}

.stairs__legend-text {
    background: #ededed;
    position: relative;
    z-index: 3;
}

.stairs__legend-text--x {
    padding: 0.25em 1em;
}

.stairs__legend-text--y {
    padding: 1em 0.25em;
}