.floating-tree-menu {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1100;
    width: min(176px, calc(100vw - 48px));
    color: rgba(255, 255, 255, 0.88);
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    transition: width 180ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 180ms ease;
}

.tree-menu-toggle {
    width: 100%;
    min-height: 38px;
    padding: 6px 7px 6px 9px;
    border: 0;
    background: transparent;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    text-align: left;
    cursor: pointer;
    font: inherit;
    transition: min-height 180ms cubic-bezier(0.16, 1, 0.3, 1), padding 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tree-menu-heading {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    transition: opacity 140ms ease, transform 140ms ease;
}

.tree-menu-kicker {
    color: rgba(255, 255, 255, 0.52);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.tree-menu-title {
    color: #ffffff;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-menu-state {
    position: relative;
    width: 24px;
    height: 20px;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.72);
    border: 2px solid currentColor;
    opacity: 0.9;
}

.tree-menu-state::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 8px;
    border-left: 2px solid currentColor;
}

.tree-menu-state::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 3px;
    width: 2px;
    height: 2px;
    border-radius: 999px;
    color: currentColor;
    background: currentColor;
    box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor;
}

.tree-menu-panel {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    max-height: min(420px, calc(100vh - 154px));
    overflow-y: auto;
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    transition: max-height 180ms cubic-bezier(0.16, 1, 0.3, 1), opacity 120ms ease, transform 180ms cubic-bezier(0.16, 1, 0.3, 1), visibility 0ms linear 0ms, border-color 120ms ease;
}

.tree-menu-feature {
    display: block;
    padding: 8px 10px;
    color: inherit;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tree-menu-feature:hover,
.tree-link:hover {
    background: rgba(255, 255, 255, 0.12);
}

.tree-feature-title {
    display: block;
    color: #ffffff;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.2;
}

.tree-feature-meta,
.tree-link-meta {
    display: none;
    color: rgba(255, 255, 255, 0.56);
    font-size: 10px;
    font-weight: 650;
    line-height: 1.3;
    margin-top: 2px;
}

.tree-list,
.tree-list ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tree-list {
    padding: 7px 0 8px;
}

.tree-group {
    padding: 0 8px;
}

.tree-group summary {
    min-height: 26px;
    padding: 5px 7px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tree-group summary::-webkit-details-marker {
    display: none;
}

.tree-group summary::before {
    content: "+";
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.68);
    background: rgba(255, 255, 255, 0.12);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.tree-group[open] summary::before {
    content: "-";
}

.tree-children {
    margin-left: 12px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.18);
}

.tree-children li {
    position: relative;
}

.tree-children li::before {
    content: "";
    position: absolute;
    top: 15px;
    left: -10px;
    width: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.tree-link {
    min-height: 28px;
    padding: 5px 7px;
    border: 0;
    border-radius: 6px;
    display: block;
    width: 100%;
    background: transparent;
    color: #ffffff;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.tree-link-title {
    display: block;
    font-size: 12px;
    font-weight: 720;
    line-height: 1.2;
}

.floating-tree-menu[data-collapsed="true"] {
    width: 38px;
}

.floating-tree-menu[data-collapsed="true"] .tree-menu-toggle {
    min-height: 36px;
    padding: 7px;
    justify-content: center;
}

.floating-tree-menu[data-collapsed="true"] .tree-menu-heading {
    opacity: 0;
    transform: translateX(-4px);
    visibility: hidden;
}

.floating-tree-menu[data-collapsed="true"] .tree-menu-panel {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-4px);
    visibility: hidden;
    border-top-color: transparent;
    transition-delay: 0ms, 0ms, 0ms, 180ms, 0ms;
}

.floating-tree-menu[data-collapsed="true"] .tree-menu-state {
    color: rgba(255, 255, 255, 0.58);
}

@media (max-width: 768px) {
    .floating-tree-menu {
        top: 16px;
        right: 16px;
        width: min(176px, calc(100vw - 32px));
    }

    .tree-menu-panel {
        max-height: min(360px, calc(100vh - 124px));
    }
}
