:root
{
    --bm-bg: #07070a;
    --bm-stage: #12141c;
    --bm-line: #2a2e3a;
    --bm-text: #f4f4f6;
    --bm-muted: #8b90a0;
    --bm-avail-w: calc(100dvw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 1rem);
    --bm-avail-h: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 1rem);
}

*,
*::before,
*::after
{
    box-sizing: border-box;
}

html,
body
{
    margin: 0;
    width: 100%;
    height: 100%;
    background: var(--bm-bg);
    color: var(--bm-text);
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: none), (max-width: 900px)
{
    html:has(body.is-editor)
    {
        height: auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: scroll;
        overscroll-behavior-y: auto;
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
    }

    body.is-editor
    {
        height: auto;
        min-height: 0;
        overflow: visible;
        overscroll-behavior-y: auto;
        touch-action: pan-y;
        --bm-urlbar-scrape: 3.5rem;
        --bm-avail-w: var(--bm-vv-w, 100svw);
        --bm-avail-h: calc(var(--bm-vv-h, 100svh) - var(--bm-urlbar-scrape));
    }

    body.is-editor.is-urlbar-hidden
    {
        --bm-urlbar-scrape: 0px;
    }

    body.is-editor .app-shell
    {
        min-height: 0;
        width: 100%;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 0;
    }

    body.is-editor .app-stage,
    body.is-editor .app-stage.is-horizontal
    {
        position: sticky;
        top: 0;
        z-index: 2;
        aspect-ratio: auto;
        width: 100%;
        max-width: none;
        height: var(--bm-avail-h);
        max-height: none;
        border-radius: 0;
        border: 0;
        border-bottom: 1px solid var(--bm-line);
    }

    body.is-editor .app-urlbar-pad
    {
        display: block;
        width: 100%;
        height: 70vh;
        min-height: 12rem;
        background: #0b0c12;
        pointer-events: auto;
        touch-action: pan-y;
    }

    body.is-editor .app-urlbar-pad::before
    {
        content: '';
        display: block;
        width: 2.6rem;
        height: 0.28rem;
        margin: 0.75rem auto 0;
        border-radius: 999px;
        background: #5c6270;
    }

    body.is-editor .app-stage,
    body.is-editor .app-editor-dock
    {
        overscroll-behavior: contain;
    }
}

@media (display-mode: standalone), (display-mode: fullscreen)
{
    html:has(body.is-editor),
    body.is-editor
    {
        height: 100%;
        overflow: hidden;
        touch-action: manipulation;
    }

    body.is-editor
    {
        --bm-avail-h: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 1rem);
    }

    body.is-editor .app-shell
    {
        min-height: 100dvh;
        align-items: center;
        justify-content: center;
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
    }

    body.is-editor .app-urlbar-pad
    {
        display: none;
    }
}

.app-shell
{
    min-height: 100dvh;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: max(0.5rem, env(safe-area-inset-top, 0px));
    padding-right: max(0.5rem, env(safe-area-inset-right, 0px));
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
    padding-left: max(0.5rem, env(safe-area-inset-left, 0px));
}

.app-urlbar-pad
{
    display: none;
}

.app-stage
{
    position: relative;
    aspect-ratio: 9 / 16;
    width: min(var(--bm-avail-w), calc(var(--bm-avail-h) * 9 / 16));
    max-width: 100%;
    max-height: var(--bm-avail-h);
    height: auto;
    background: var(--bm-stage);
    border: 1px solid var(--bm-line);
    border-radius: 1.25rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.app-stage.is-horizontal
{
    aspect-ratio: 16 / 9;
    width: min(var(--bm-avail-w), calc(var(--bm-avail-h) * 16 / 9));
}

.app-stage-body
{
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.25rem 1.25rem 1.5rem;
    text-align: center;
    pointer-events: none;
}

.app-stage-body a,
.app-stage-body button,
.app-stage-body form,
.app-stage-body input,
.app-stage-body textarea,
.app-stage-body label
{
    pointer-events: auto;
}

.app-stage-body.is-interactive
{
    pointer-events: auto;
    overflow-y: auto;
    justify-content: flex-start;
    align-items: stretch;
    text-align: left;
    padding-top: 3.5rem;
}

.app-inline-form
{
    display: inline;
    margin: 0;
}

.app-auth-tabs
{
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}

.app-auth-tab
{
    flex: 1;
    text-align: center;
    border: 1px solid var(--bm-line);
    border-radius: 0.55rem;
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
    color: var(--bm-muted);
    text-decoration: none;
}

.app-auth-tab.is-on
{
    color: var(--bm-text);
    border-color: #4a5164;
    background: #1a1d27;
}

.app-auth-pane
{
    display: none;
}

.app-auth-pane.is-on
{
    display: block;
}

.app-field
{
    display: block;
    margin-bottom: 0.65rem;
    font-size: 0.72rem;
    color: var(--bm-muted);
}

.app-field .form-control
{
    margin-top: 0.25rem;
    background: #1a1d27;
    border-color: var(--bm-line);
    color: var(--bm-text);
}

.app-json
{
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.68rem;
    min-height: 10rem;
}

.app-msg
{
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.app-msg-error
{
    color: #f0a0a0;
}

.app-msg-ok
{
    color: #7dcea0;
}

.app-row-form
{
    display: flex;
    gap: 0.4rem;
}

.app-row-form .form-control
{
    flex: 1;
    background: #1a1d27;
    border-color: var(--bm-line);
    color: var(--bm-text);
}

.app-level-card
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border: 1px solid var(--bm-line);
    border-radius: 0.55rem;
    padding: 0.55rem 0.65rem;
    margin-bottom: 0.45rem;
    background: #1a1d27;
}

.app-editor-tabs
{
    position: absolute;
    top: 3.15rem;
    left: 0;
    right: 0;
    z-index: 6;
    display: flex;
    gap: 0.18rem;
    padding: 0 0.4rem;
    pointer-events: auto;
}

.app-editor-tabs .app-auth-tab
{
    flex: 1;
    border: 0;
    background: #1a1d27;
    cursor: pointer;
    min-height: 2.4rem;
    padding: 0.32rem 0.15rem;
    font-size: 0.68rem;
}

.app-editor-dock
{
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    max-height: 46%;
    overflow-y: auto;
    padding: 0.65rem 0.75rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
    background: #12141c;
    pointer-events: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: manipulation;
}

.app-editor-dock-handle
{
    display: none;
}

.is-ed-player .app-editor-dock,
.is-ed-buttons .app-editor-dock,
.is-ed-world .app-editor-dock
{
    min-height: 50%;
    max-height: 50%;
}

.is-ed-track .app-editor-dock
{
    min-height: 0;
    max-height: none;
    height: var(--ed-dock-h, 33%);
    padding-top: 0;
    overflow-y: auto;
}

.is-ed-track .app-editor-dock.is-anim
{
    transition: height 0.22s ease;
}

.is-ed-track.is-dock-collapsed .app-editor-dock,
.is-ed-track .app-editor-dock.is-collapsed
{
    height: 1.5rem;
    overflow: hidden;
    padding: 0;
}

.is-ed-track .app-editor-dock-handle
{
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 2;
    flex: 0 0 1.5rem;
    height: 1.5rem;
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--bm-line);
    background: #161822;
    cursor: ns-resize;
    touch-action: none;
    user-select: none;
}

.app-editor-dock-grip
{
    display: block;
    width: 2.5rem;
    height: 0.28rem;
    border-radius: 999px;
    background: #6a7080;
}

#editor-stage.is-horizontal .app-editor-tabs
{
    left: auto;
    right: 0;
    width: var(--ed-dock-w, 50%);
}

#editor-stage.is-horizontal:not(.is-ed-track) .app-editor-tabs
{
    width: 50%;
}

#editor-stage.is-horizontal .app-editor-dock
{
    top: 5.9rem;
    left: auto;
    right: 0;
    bottom: 0;
    width: var(--ed-dock-w, 50%);
    max-height: none;
    height: auto;
    padding: 0.65rem 0.75rem 0.85rem;
}

#editor-stage.is-horizontal:not(.is-ed-track) .app-editor-dock
{
    width: 50%;
}

#editor-stage.is-horizontal.is-ed-player .app-editor-dock,
#editor-stage.is-horizontal.is-ed-buttons .app-editor-dock,
#editor-stage.is-horizontal.is-ed-world .app-editor-dock
{
    min-height: 0;
    max-height: none;
}

#editor-stage.is-horizontal.is-ed-track .app-editor-dock
{
    min-height: 0;
    max-height: none;
    height: auto;
    width: var(--ed-dock-w, 50%);
    padding-left: 1.7rem;
}

#editor-stage.is-horizontal.is-ed-track .app-editor-dock.is-anim
{
    transition: width 0.22s ease;
}

#editor-stage.is-horizontal.is-ed-track.is-dock-collapsed .app-editor-dock,
#editor-stage.is-horizontal.is-ed-track .app-editor-dock.is-collapsed
{
    width: 1.5rem;
    height: auto;
    overflow: hidden;
    padding: 0;
}

#editor-stage.is-horizontal.is-ed-track .app-editor-dock-handle
{
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1.5rem;
    height: auto;
    flex: none;
    border-bottom: 0;
    border-right: 1px solid var(--bm-line);
    cursor: ew-resize;
}

#editor-stage.is-horizontal .app-editor-dock-grip
{
    width: 0.28rem;
    height: 2.5rem;
}

#editor-stage.is-horizontal .ed-map
{
    top: 5.75rem;
    left: 0;
    right: auto;
    bottom: 0;
    width: 3.4rem;
    max-width: 18%;
    height: auto;
    border-left: 0;
    border-right: 1px solid var(--bm-line);
}

#editor-stage.is-horizontal.is-run-right .ed-map
{
    top: auto;
    left: 0;
    right: var(--ed-dock-w, 50%);
    bottom: 0;
    width: auto;
    max-width: none;
    height: 3.4rem;
    border-right: 0;
    border-top: 1px solid var(--bm-line);
}

.is-ed-track .app-editor-dock-handle:active .app-editor-dock-grip
{
    background: #c8ccd8;
}

.app-editor-dock [data-ed-pane]
{
    display: none;
}

.app-editor-dock [data-ed-pane].is-on
{
    display: block;
}

.app-editor-dock .form-control
{
    min-height: 2.65rem;
    font-size: 1rem;
}

.app-editor-dock .form-range
{
    min-height: 1.5rem;
}

.app-editor-vis-track
{
    position: relative;
    height: 1.9rem;
    margin-top: 0.4rem;
}

.app-editor-vis-fill
{
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 0.72rem;
    transform: translateY(-50%);
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid var(--bm-line);
    pointer-events: none;
}

.app-editor-vis-ticks
{
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.app-editor-vis-tick
{
    position: absolute;
    top: 50%;
    width: 2px;
    height: 1.15rem;
    margin-left: -1px;
    transform: translateY(-50%);
    background: #12141c;
    border-radius: 1px;
}

.app-editor-vis-tick.is-on
{
    width: 3px;
    height: 1.35rem;
    background: #07070a;
}

.app-editor-key-grab
{
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1.15rem;
    height: 1.45rem;
    margin: 0;
    padding: 0;
    transform: translate(-50%, -50%);
    border: 1px solid #12141c;
    border-radius: 0.35rem;
    background: #f4f4f6;
    cursor: ew-resize;
    pointer-events: auto;
    touch-action: none;
    z-index: 3;
}

.app-editor-vis-track .form-range
{
    position: relative;
    z-index: 1;
    margin: 0;
    background: transparent;
}

.app-editor-vis-track .form-range::-webkit-slider-runnable-track
{
    background: transparent;
    border-color: transparent;
    height: 0.72rem;
}

.app-editor-vis-track .form-range::-moz-range-track
{
    background: transparent;
    border-color: transparent;
    height: 0.72rem;
}

.app-editor-dock .app-text-btn
{
    min-height: 2.65rem;
}

.ed-half-row
{
    display: flex;
    gap: 0.5rem;
}

.ed-half-row > .app-field
{
    flex: 0 0 calc(50% - 0.25rem);
    max-width: calc(50% - 0.25rem);
    min-width: 0;
}

.ed-color-select
{
    font-variant-numeric: tabular-nums;
    text-align: center;
    letter-spacing: 0.04em;
    min-height: 2.65rem;
    touch-action: manipulation;
}

.ed-hex-picker
{
    position: fixed;
    z-index: 40;
    padding: 0.55rem;
    background: #1a1d27;
    border: 1px solid var(--bm-line);
    border-radius: 0.85rem;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    touch-action: manipulation;
}

.ed-hex-picker:not([hidden])
{
    display: block;
}

.app-field .ed-icon-btn
{
    display: flex;
    margin-top: 0.25rem;
}

.ed-hex-board
{
    position: relative;
}

.ed-hex
{
    position: absolute;
    padding: 0;
    border: 0;
    background: none;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.ed-hex.is-on
{
    z-index: 1;
    transform: scale(1.12);
    filter: brightness(1.12);
}

.ed-dir-select
{
    font-size: 1.25rem;
    text-align: center;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
}

.app-editor-hint
{
    font-size: 0.72rem;
    color: var(--bm-muted);
    margin: 0.65rem 0 0;
}

.app-editor-slots
{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    width: min(15rem, 100%);
    margin: 0 auto 0.75rem;
}

.app-editor-slot
{
    min-height: 2.85rem;
    border: 1px solid var(--bm-line);
    border-radius: 0.7rem;
    background: #1a1d27;
    color: var(--bm-muted);
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.app-editor-slot[data-slot="up"]
{
    grid-column: 2;
}

.app-editor-slot[data-slot="left"]
{
    grid-column: 1;
    grid-row: 2;
}

.app-editor-slot[data-slot="down"]
{
    grid-column: 2;
    grid-row: 2;
}

.app-editor-slot[data-slot="right"]
{
    grid-column: 3;
    grid-row: 2;
}

.app-editor-slot.is-on
{
    color: var(--bm-text);
    border-color: #c8ccd8;
    background: #242836;
}

.app-editor-keys
{
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.15rem 0 0.65rem;
}

.app-text-btn.is-on
{
    border-color: #c8ccd8;
}

.is-readonly #ed-add-part,
.is-readonly #ed-add-key,
.is-readonly #ed-del-key,
.is-readonly #ed-del-part
{
    display: none;
}

#editor-canvas
{
    touch-action: none;
}

.ed-map
{
    display: none;
    position: absolute;
    top: 5.75rem;
    right: 0;
    bottom: 50%;
    z-index: 4;
    width: 3.4rem;
    max-width: 18%;
    border: 0;
    border-left: 1px solid var(--bm-line);
    background: rgba(8, 9, 14, 0.9);
    touch-action: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.ed-map-canvas
{
    display: block;
    width: 100%;
    height: 100%;
}

.is-ed-track .ed-map
{
    display: block;
    transition: opacity 0.28s ease, visibility 0s linear 0.28s;
}

.is-ed-track .ed-map.is-on
{
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.28s ease, visibility 0s linear 0s;
}

@media (hover: none), (max-width: 900px)
{
    .is-ed-track .ed-map
    {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: none;
    }
}

.ed-history
{
    position: absolute;
    top: 5.65rem;
    left: 0.4rem;
    z-index: 7;
    display: none;
    align-items: center;
    gap: 0.3rem;
    pointer-events: auto;
}

.is-ed-track .ed-history:not([hidden])
{
    display: flex;
}

.ed-history .app-text-btn
{
    min-height: 2.35rem;
    min-width: 2.35rem;
    padding: 0.2rem;
}

.ed-history .app-text-btn:disabled
{
    opacity: 0.35;
}

.ed-select-mode
{
    display: flex;
    align-items: center;
    gap: 0.15rem;
    margin-left: 0.15rem;
}

.ed-select-mode .app-text-btn
{
    min-width: 0;
    padding: 0.2rem 0.5rem;
    font-size: 0.78rem;
    line-height: 1.1;
}

.ed-select-mode .app-text-btn.is-on
{
    background: #f4f4f6;
    border-color: #f4f4f6;
    color: #12141c;
}

.ed-touch-bar
{
    position: absolute;
    left: 0.4rem;
    right: 4.2rem;
    bottom: calc(var(--ed-dock-h, 33%) + 0.4rem);
    z-index: 7;
    display: none;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 0.3rem;
    max-width: none;
    overflow: visible;
    pointer-events: auto;
}

.ed-touch-bar.is-beside-nudge
{
    left: calc(0.4rem + 3 * 2.35rem + 3 * 0.22rem);
}

.is-ed-track .ed-touch-bar:not([hidden])
{
    display: flex;
}

.ed-nudge-pad
{
    position: absolute;
    left: 0.4rem;
    bottom: calc(var(--ed-dock-h, 33%) + 0.4rem);
    z-index: 7;
    display: none;
    grid-template-columns: 2.35rem 2.35rem 2.35rem;
    gap: 0.22rem;
    pointer-events: auto;
}

.ed-nudge-value
{
    font-variant-numeric: tabular-nums;
    font-size: 0.72rem;
    padding: 0;
}

.ed-nudge-mode.is-on,
.ed-nudge-menu .app-text-btn.is-on
{
    border-color: #f4f4f6;
    color: #f4f4f6;
}

.ed-nudge-menu
{
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 0.3rem);
    display: none;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.22rem;
    z-index: 8;
}

.ed-nudge-menu:not([hidden])
{
    display: flex;
}

.ed-nudge-menu .app-text-btn
{
    min-width: 2.35rem;
    min-height: 2.35rem;
}

.is-ed-track .ed-nudge-pad:not([hidden])
{
    display: grid;
}

.is-ed-track.is-dock-collapsed .ed-touch-bar
{
    bottom: 2rem;
}

.is-ed-track.is-dock-collapsed .ed-nudge-pad
{
    bottom: 2rem;
}

.ed-nudge-pad .app-text-btn,
.ed-touch-bar .app-text-btn
{
    min-height: 2.35rem;
    min-width: 2.35rem;
    padding: 0.2rem 0.45rem;
}

.ed-icon-btn
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
}

.ed-icon-btn svg
{
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ed-plus-cluster
{
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 0.3rem;
    flex: 1 1 auto;
    min-width: 2.35rem;
    min-height: 2.35rem;
    overflow: visible;
}

.ed-plus-parents
{
    display: none;
    flex: 0 0 auto;
    align-items: flex-end;
    gap: 0.3rem;
}

.ed-plus-parents:not([hidden])
{
    display: flex;
}

.ed-plus-actions
{
    display: none;
    position: absolute;
    left: calc(2.35rem + 0.3rem);
    right: 0;
    bottom: 0;
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 0.3rem;
    z-index: 1;
    pointer-events: none;
}

.ed-plus-actions:not([hidden])
{
    display: flex;
}

.ed-touch-bar.is-object #ed-plus
{
    display: none;
}

.ed-touch-bar.is-object .ed-plus-actions
{
    left: 0;
}

.ed-touch-bar.is-add .ed-plus-actions
{
    left: 0;
    bottom: calc(100% + 0.3rem);
}

.ed-plus-row
{
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 0.3rem;
    pointer-events: auto;
}

.ed-plus-row.is-overflow
{
    justify-content: flex-end;
}

.ed-plus-actions .app-text-btn
{
    flex: 0 0 auto;
    width: auto;
}

.ed-plus-actions .ed-icon-btn
{
    min-width: 2.35rem;
    min-height: 2.35rem;
}

.ed-nudge-pad .ed-nudge-step.is-on,
.ed-touch-bar .app-text-btn.is-on
{
    border-color: #f4f4f6;
    color: #f4f4f6;
}

.ed-plus-parents .app-text-btn.is-on
{
    background: #f4f4f6;
    border-color: #f4f4f6;
    color: #12141c;
}

#editor-stage.is-horizontal.is-ed-track .ed-history
{
    top: 3.15rem;
}

#editor-stage.is-horizontal.is-ed-track .ed-touch-bar
{
    bottom: 0.4rem;
    right: calc(var(--ed-dock-w, 50%) + 0.4rem);
    max-width: none;
}

#editor-stage.is-horizontal.is-ed-track .ed-nudge-pad
{
    bottom: 0.4rem;
    max-width: calc(100% - var(--ed-dock-w, 50%) - 0.8rem);
}

.is-readonly .ed-history,
.is-readonly .ed-touch-bar,
.is-readonly .ed-nudge-pad
{
    display: none !important;
}

.app-chrome
{
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.65rem;
    padding: 0.55rem 0.65rem 0.35rem;
    pointer-events: none;
}

.app-chrome > *
{
    pointer-events: auto;
}

.app-chrome-spacer
{
    flex: 1 1 auto;
}

.app-icon-btn
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--bm-line);
    border-radius: 0.7rem;
    background: #1a1d27;
    color: var(--bm-text);
    text-decoration: none;
    cursor: pointer;
}

.app-icon-btn:hover,
.app-icon-btn:focus-visible
{
    border-color: #4a5164;
    color: var(--bm-text);
}

.app-icon-btn svg
{
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-chrome-title
{
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.app-check
{
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    color: var(--bm-muted);
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    cursor: pointer;
    user-select: none;
}

.app-check input
{
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: #d0d4e0;
}

.ed-agg-half
{
    display: flex;
    align-items: stretch;
    gap: 0.35rem;
    min-height: 2.65rem;
    margin-top: 0.25rem;
}

.ed-agg-half .app-check
{
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0 0.4rem;
    border: 1px solid var(--bm-line);
    border-radius: 0.55rem;
    background: #1a1d27;
}

.ed-agg-half .app-text-btn
{
    flex: 0 0 auto;
    white-space: nowrap;
}

.app-text-btn
{
    display: inline-block;
    border: 1px solid var(--bm-line);
    border-radius: 0.55rem;
    background: #1a1d27;
    color: var(--bm-text);
    font-size: 0.75rem;
    padding: 0.45rem 0.9rem;
    cursor: pointer;
    text-decoration: none;
}

.app-play-canvas
{
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
}

.app-play-hud
{
    position: absolute;
    left: 0;
    right: 0;
    top: 22%;
    z-index: 4;
    display: none;
    padding: 0 1rem;
    text-align: center;
    color: var(--bm-text);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    white-space: pre-line;
    pointer-events: none;
    text-shadow: 0 1px 0 #07070a;
}

.app-play-hud.is-on
{
    display: block;
}

.app-controls
{
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.app-controls.is-playable .app-pad-btn
{
    pointer-events: auto;
    background: rgba(26, 29, 39, 0.78);
    color: var(--bm-text);
}

.app-stage.is-autoplay .app-pad-btn
{
    background: rgba(26, 29, 39, 0.78);
    color: var(--bm-text);
}

.app-stage.is-autoplay .app-pad-btn.is-auto-down
{
    background: #c23b3b;
    border-color: #f08080;
    color: #fff;
}

.app-pad-btn
{
    position: absolute;
    left: 50%;
    top: 86%;
    width: 18%;
    height: 10%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 0;
    border: 1px solid var(--bm-line);
    border-radius: 0.7rem;
    background: #1a1d27;
    color: var(--bm-muted);
    font-size: clamp(0.65rem, 2.8vw, 0.85rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    touch-action: none;
}

.app-controls.is-editable .app-pad-btn
{
    pointer-events: auto;
    cursor: grab;
}

.app-pad-btn.is-selected
{
    border-color: #c8ccd8;
    color: var(--bm-text);
    z-index: 3;
}

.app-pad-btn.is-dragging
{
    cursor: grabbing;
    border-color: #e8eaf0;
}

.app-resize
{
    position: absolute;
    z-index: 4;
    display: none;
    background: #d8dce8;
    border-radius: 999px;
    pointer-events: auto;
}

.app-controls.is-editable .app-resize
{
    display: block;
}

.app-resize[data-resize="n"],
.app-resize[data-resize="s"]
{
    left: 50%;
    width: 42%;
    min-width: 1.75rem;
    height: 0.7rem;
    transform: translate(-50%, -50%);
    cursor: ns-resize;
    touch-action: none;
}

.app-resize[data-resize="n"] { top: 0; }
.app-resize[data-resize="s"] { top: 100%; }

.app-resize[data-resize="e"],
.app-resize[data-resize="w"]
{
    top: 50%;
    height: 42%;
    min-height: 1.75rem;
    width: 0.7rem;
    transform: translate(-50%, -50%);
    cursor: ew-resize;
    touch-action: none;
}

.app-resize[data-resize="e"] { left: 100%; }
.app-resize[data-resize="w"] { left: 0; }

.app-rotate
{
    display: none;
    min-height: 100dvh;
    width: 100%;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    color: var(--bm-text);
}

.app-kicker
{
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.7rem;
    color: var(--bm-muted);
    margin-bottom: 0.5rem;
}

.app-stage-body h1
{
    font-size: clamp(1.8rem, 8vw, 2.6rem);
    font-weight: 700;
    margin: 0 0 0.75rem;
}

.app-stage .lead
{
    color: var(--bm-muted);
    font-size: 1rem;
}

.step-slider
{
    position: relative;
    width: 100%;
    margin-top: 0.2rem;
}

.step-slider-src
{
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    min-height: 0 !important;
    pointer-events: none;
}

.step-slider-range
{
    width: 100%;
    min-height: 1.45rem;
    margin: 0;
}

.step-slider-readout
{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    margin: 0 0 0.12rem;
    position: relative;
    z-index: 2;
}

.step-slider-value
{
    display: block;
    min-width: 2.4rem;
    text-align: center;
    color: var(--bm-text);
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.step-slider-nudge
{
    flex: 0 0 1.7rem;
    width: 1.7rem;
    height: 1.7rem;
    padding: 0;
    border: 0;
    border-radius: 0.35rem;
    background: transparent;
    color: #9aa0ae;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.step-slider-nudge:disabled
{
    opacity: 0.35;
    cursor: default;
}

.step-slider-meta
{
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 0.1rem;
    margin-top: -0.72rem;
    min-height: 1.35rem;
}

.step-slider-jump
{
    display: inline-flex;
    align-items: flex-start;
    gap: 0.16rem;
    min-height: 1.35rem;
    padding: 0.02rem 0.05rem 0.35rem;
    border: 0;
    background: transparent;
    color: var(--bm-muted);
    font-size: 0.68rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.step-slider-jump[data-dir="1"]
{
    justify-self: end;
}

.step-slider-jump[data-dir="-1"]
{
    justify-self: start;
}

.step-slider-jump:disabled
{
    opacity: 0.35;
    cursor: default;
}

.step-slider-arrow
{
    width: 0;
    height: 0;
    border-style: solid;
    margin-top: 0.12rem;
}

.step-slider-jump[data-dir="-1"] .step-slider-arrow
{
    border-width: 0.24rem 0.32rem 0.24rem 0;
    border-color: transparent var(--bm-text) transparent transparent;
}

.step-slider-jump[data-dir="1"] .step-slider-arrow
{
    border-width: 0.24rem 0 0.24rem 0.32rem;
    border-color: transparent transparent transparent var(--bm-text);
}

.step-slider-jump:disabled .step-slider-arrow
{
    opacity: 0.5;
}

.step-slider.is-fixed .step-slider-arrow
{
    display: none;
}

.step-slider.is-fixed .step-slider-jump
{
    opacity: 1;
    pointer-events: none;
    cursor: default;
}

.step-slider-ghost,
.step-slider-flyer
{
    position: absolute;
    z-index: 4;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.step-slider-ghost
{
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #f4f4f6;
    box-shadow: 0 0 0 1px #12141c;
}

.step-slider-flyer
{
    z-index: 5;
    color: var(--bm-text);
    font-size: 0.68rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.step-slider.is-carrying .step-slider-range
{
    pointer-events: none;
}

.step-slider.is-towing .step-slider-range::-webkit-slider-thumb
{
    opacity: 0;
}

.step-slider.is-towing .step-slider-range::-moz-range-thumb
{
    opacity: 0;
}

.step-slider.is-carrying .step-slider-bound,
.step-slider.is-carrying .step-slider-readout
{
    opacity: 0;
    pointer-events: none;
}

@media (orientation: landscape) and (max-height: 500px)
{
    body:not(.is-level-horizontal) .app-stage
    {
        display: none;
    }

    body:not(.is-level-horizontal) .app-rotate
    {
        display: flex;
    }
}

@media (orientation: portrait) and (max-width: 500px)
{
    body.is-level-horizontal .app-stage
    {
        display: none;
    }

    body.is-level-horizontal .app-rotate
    {
        display: flex;
    }
}

@media (prefers-reduced-motion: reduce)
{
    * { scroll-behavior: auto; }
}
