/* The tree owns its open state; Frest still controls sidebar collapse and scroll. */
html body #layout-menu.hm-tree-menu { display: flex; flex-direction: column; }
#layout-menu.hm-tree-menu .menu-inner { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 12px !important; }
html body #layout-menu.hm-tree-menu .menu-inner > .menu-item { margin: 3px 13px; }
html body #layout-menu.hm-tree-menu .menu-inner > .menu-item > .menu-link {
    min-height: 46px; width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 10px 12px !important; border: 0; background: transparent; text-align: start;
    border-radius: 11px !important; font-size: .88rem; font-weight: 700 !important;
}
#layout-menu.hm-tree-menu .menu-link .menu-icon { margin: 0; width: 23px; font-size: 21px; color: #7a8caf; flex-shrink: 0; }
#layout-menu.hm-tree-menu .hm-tree-main > div, #layout-menu.hm-tree-menu .hm-tree-toggle > div { flex: 1; }
#layout-menu.hm-tree-menu .hm-tree-chevron { margin-inline-start: auto; font-size: 18px; color: #9ba9bf; transition: transform 300ms ease; }
#layout-menu.hm-tree-menu .is-open .hm-tree-chevron { transform: rotate(-90deg); }
html body #layout-menu.hm-tree-menu .has-active-page > .hm-tree-toggle { color: #4c71d9 !important; }
#layout-menu.hm-tree-menu .has-active-page > .hm-tree-toggle .menu-icon { color: #5a7fe2; }
#layout-menu.hm-tree-menu .hm-tree-panel {
    display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden;
    transition: grid-template-rows 320ms cubic-bezier(.22, 1, .36, 1), opacity 220ms ease, visibility 0s 320ms;
}
#layout-menu.hm-tree-menu .is-open > .hm-tree-panel {
    grid-template-rows: 1fr; opacity: 1; visibility: visible;
    transition: grid-template-rows 320ms cubic-bezier(.22, 1, .36, 1), opacity 220ms ease, visibility 0s;
}
#layout-menu.hm-tree-menu .hm-tree-children { min-height: 0; overflow: hidden; list-style: none; padding: 0 13px 0 0; margin: 0 23px 0 9px; position: relative; }
#layout-menu.hm-tree-menu .hm-tree-children::before { content: ''; position: absolute; right: 0; top: 4px; bottom: 7px; width: 1px; background: #dce5f3; }
#layout-menu.hm-tree-menu .hm-tree-item { position: relative; padding-block: 3px; }
#layout-menu.hm-tree-menu .hm-tree-item::before { content: ''; position: absolute; right: -13px; width: 13px; top: 50%; height: 1px; background: #dce5f3; }
#layout-menu.hm-tree-menu .hm-tree-leaf {
    display: flex; align-items: center; justify-content: space-between; gap: 6px; position: relative;
    min-height: 39px; padding: 9px 12px; border-radius: 9px; font-size: .79rem; font-weight: 600;
    color: #71819a; transition: background 180ms ease, color 180ms ease;
}
#layout-menu.hm-tree-menu .hm-tree-leaf:hover { color: #4c70d8; background: #f3f6fc; }
#layout-menu.hm-tree-menu .hm-tree-item.active > .hm-tree-leaf { color: #486bd9; background: #edf2ff; font-weight: 700; }
#layout-menu.hm-tree-menu .hm-tree-item.active > .hm-tree-leaf::after { content: ''; position: absolute; right: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: #6381ed; }
#layout-menu.hm-tree-menu .hm-tree-leaf > i { font-size: 16px; flex-shrink: 0; }
#layout-menu.hm-tree-menu .hm-tree-toggle:focus-visible, #layout-menu.hm-tree-menu .hm-tree-leaf:focus-visible { outline: 2px solid #5a8dee; outline-offset: 2px; }
.hm-sidebar-footer { padding: 12px 15px 17px; border-top: 1px solid #edf1f7; flex-shrink: 0; }
.hm-company-support {
    position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px;
    padding: 12px; border: 1px solid #26a69a18; border-radius: 20px; background: linear-gradient(135deg,#fff,#00a3e009);
    color: #273a41; text-align: start; box-shadow: 0 8px 20px #0175c209; cursor: pointer;
}
.hm-support-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 15px; background: #f0efff; color: #6d72c7; box-shadow: inset 0 0 0 1px #6d72c71f; font-size: 26px; flex-shrink: 0; }
.hm-support-copy { flex: 1; min-width: 0; }
.hm-support-copy strong { font-size: 15px; font-weight: 800; }
.hm-support-arrow { font-size: 23px; color: #52b8b0; }
.hm-company-support:hover { background: #f7f6ff; }
.hm-company-support:focus-visible { outline: 2px solid #777bd1; outline-offset: 3px; }
.hm-support-border { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.hm-support-border rect { width: calc(100% - 3px); height: calc(100% - 3px); fill: none; stroke: url(#support-border-gradient); stroke-width: 2.5px; stroke-linecap: round; stroke-dasharray: 24 76; animation: support-border-travel 2800ms linear infinite; }
@keyframes support-border-travel { to { stroke-dashoffset: -100; } }
html.dark-style #layout-menu.hm-tree-menu .hm-tree-leaf { color: #a0b0ca; }
html.dark-style #layout-menu.hm-tree-menu .hm-tree-item.active > .hm-tree-leaf { color: #afc4ff; background: #5a8dee22; }
html.dark-style #layout-menu.hm-tree-menu .hm-tree-leaf:hover { background: #ffffff08; color: #cad7ff; }
html.dark-style #layout-menu.hm-tree-menu .has-active-page > .hm-tree-toggle { color: #aec5ff !important; }
html.dark-style #layout-menu.hm-tree-menu .hm-tree-children::before, html.dark-style #layout-menu.hm-tree-menu .hm-tree-item::before { background: #40516f; }
html.dark-style .hm-sidebar-footer { border-color: #3a4961; }
html.dark-style .hm-company-support { background: #223443; color: #e1eef0; border-color: #26a69a25; }
html.dark-style .hm-company-dialog { background: #243348; color: #e1e9f5; border-color: #40516f; }
html.dark-style .hm-company-dialog-close { background: #ffffff0d; color: #b9c7dc; }
html.dark-style .hm-company-contact { background: #0175c218; color: #80c8f6; border-color: #40516f; }
html.dark-style .hm-contact-phone { background: #26a69a12; color: #69c9be; }
@media (min-width: 1200px) {
    html body #layout-menu.hm-tree-menu { position: sticky; top: 0; height: 100vh; align-self: flex-start; }
    .layout-menu-collapsed:not(.layout-menu-hover) #layout-menu .hm-tree-panel,
    .layout-menu-collapsed:not(.layout-menu-hover) #layout-menu .hm-tree-chevron,
    .layout-menu-collapsed:not(.layout-menu-hover) #layout-menu .hm-support-copy,
    .layout-menu-collapsed:not(.layout-menu-hover) #layout-menu .hm-support-arrow { display: none; }
    .layout-menu-collapsed:not(.layout-menu-hover) .hm-sidebar-footer { padding: 12px 8px 17px; }
    .layout-menu-collapsed:not(.layout-menu-hover) .hm-company-support { padding: 6px; min-height: 56px; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    #layout-menu.hm-tree-menu .hm-tree-panel, #layout-menu.hm-tree-menu .hm-tree-chevron { transition: none; }
    .hm-support-border rect { animation: none; }
}
