.xplore-hierarchy-shell {
    --xh-blue: #1769ee;
    --xh-blue-strong: #0757d8;
    --xh-ink: #112b58;
    --xh-text: #28456f;
    --xh-muted: #6d83a6;
    --xh-line: #dce7f7;
    --xh-line-soft: #edf3fc;
    --xh-canvas: #f4f8fd;
    --xh-card: #ffffff;
    --xh-active: #e9f3ff;
    --xh-shadow: 0 10px 28px rgba(42, 78, 136, .08);
    --xh-indent: 1.35rem;
    --xh-font-step: 2px;
    width: min(100%, 1780px);
    height: calc(100dvh - var(--xh-shell-top, var(--x-nav-height, 84px)));
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    margin: 0 auto;
    padding: clamp(1rem, 1.55vw, 1.55rem);
    color: var(--xh-text);
    font-size: calc(1rem + var(--xh-font-step));
    background:
        radial-gradient(circle at 90% 0%, rgba(60, 143, 255, .1), transparent 30rem),
        linear-gradient(145deg, #fbfdff, var(--xh-canvas));
}

.xplore-hierarchy-breadcrumb {
    width: fit-content;
    max-width: 100%;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    gap: .65rem;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 1.2rem;
    padding: .5rem .9rem;
    border: 1px solid var(--xh-line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--xh-card) 92%, transparent);
    box-shadow: 0 4px 16px rgba(40, 76, 135, .04);
    color: #55729c;
    font-size: calc(.78rem + var(--xh-font-step));
    font-weight: 650;
    white-space: nowrap;
    scrollbar-width: thin;
    scrollbar-color: #b8cbe7 transparent;
}

.xplore-hierarchy-breadcrumb::-webkit-scrollbar {
    height: .38rem;
}

.xplore-hierarchy-breadcrumb::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #b8cbe7;
}

.xplore-hierarchy-breadcrumb > i:first-child {
    color: var(--xh-blue);
    font-size: 1rem;
}

.xplore-hierarchy-breadcrumb > i:not(:first-child) {
    color: #9bb0cc;
    font-size: .62rem;
}

.xplore-hierarchy-breadcrumb strong {
    overflow: hidden;
    color: var(--xh-ink);
    text-overflow: ellipsis;
}

.xplore-hierarchy-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(.6rem, 1vw, 1rem);
    margin-bottom: clamp(1rem, 1.45vw, 1.25rem);
}

.xplore-hierarchy-metric {
    min-height: 4.4rem;
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .75rem .9rem;
    border: 1px solid var(--xh-line);
    border-radius: 14px;
    background: var(--xh-card);
    box-shadow: 0 6px 20px rgba(42, 78, 136, .05);
}

.xplore-hierarchy-metric-icon {
    width: 2.45rem;
    height: 2.45rem;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    color: var(--xh-blue);
    background: #eaf2ff;
    font-size: 1.1rem;
}

.xplore-hierarchy-metric-image {
    display: block;
    width: 1.36rem;
    height: 1.36rem;
    object-fit: contain;
}

.xplore-hierarchy-metric-icon .xplore-hierarchy-tree-icon--dark {
    display: none;
}

.metric-subfunds .xplore-hierarchy-metric-icon { color: #009b62; background: #e7f8f0; }
.metric-series .xplore-hierarchy-metric-icon { color: #7344df; background: #f1ebff; }
.metric-records .xplore-hierarchy-metric-icon { color: #e77b00; background: #fff3df; }
.metric-documents .xplore-hierarchy-metric-icon { color: #0097a8; background: #e6f9fb; }

.xplore-hierarchy-metric small,
.xplore-hierarchy-metric strong {
    display: block;
}

.xplore-hierarchy-metric small {
    color: var(--xh-muted);
    font-size: calc(.72rem + var(--xh-font-step));
    font-weight: 650;
}

.xplore-hierarchy-metric strong {
    margin-top: .14rem;
    color: var(--xh-ink);
    font-size: calc(1.16rem + var(--xh-font-step));
    font-weight: 800;
    letter-spacing: -.03em;
}

.xplore-hierarchy-workspace {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1fr) minmax(0, .8fr);
    gap: clamp(.9rem, 1.1vw, 1.3rem);
    min-height: 0;
}

.xplore-hierarchy-tree-pane,
.xplore-hierarchy-records-pane,
.xplore-hierarchy-details {
    box-sizing: border-box;
    min-width: 0;
    min-height: 0;
    border: 1px solid var(--xh-line);
    border-radius: 15px;
    background: var(--xh-card);
    box-shadow: var(--xh-shadow);
}

.xplore-hierarchy-tree-pane,
.xplore-hierarchy-records-pane {
    display: grid;
    overflow: hidden;
    padding: clamp(.9rem, 1.2vw, 1.2rem);
}

.xplore-hierarchy-tree-pane {
    grid-template-rows: auto auto minmax(0, 1fr);
}

.xplore-hierarchy-records-pane {
    grid-template-rows: auto minmax(0, 1fr);
}

.xplore-hierarchy-panel-header {
    display: grid;
    grid-template-columns: 2.15rem minmax(0, 1fr);
    align-items: start;
    gap: .8rem;
    padding: .35rem .15rem 1rem;
    border-bottom: 1px solid var(--xh-line);
}

.xplore-hierarchy-tree-pane .xplore-hierarchy-panel-header {
    grid-template-columns: 2.15rem minmax(0, 1fr) 2.2rem;
}

.xplore-hierarchy-panel-header > div {
    min-width: 0;
}

.xplore-hierarchy-panel-icon {
    width: 2.15rem;
    height: 2.15rem;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 9px;
    background: #e8f1ff;
    color: var(--xh-blue);
    font-size: 1rem;
}

.xplore-hierarchy-panel-icon.records-icon {
    color: #e77b00;
    background: #fff3df;
}

.xplore-hierarchy-panel-header h2 {
    margin: 0;
    color: var(--xh-ink);
    font-size: calc(.9rem + var(--xh-font-step));
    font-weight: 800;
    letter-spacing: -.015em;
    line-height: 1.3;
}

.xplore-hierarchy-panel-header p {
    margin: .14rem 0 0;
    color: var(--xh-muted);
    font-size: calc(.72rem + var(--xh-font-step));
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.xplore-hierarchy-tool {
    width: 2.2rem;
    height: 2.2rem;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    align-self: center;
    padding: 0;
    border: 1px solid var(--xh-line);
    border-radius: 9px;
    background: var(--xh-card);
    color: var(--xh-blue);
    cursor: pointer;
    font: inherit;
    transition: background .16s ease, border-color .16s ease;
}

.xplore-hierarchy-tool:hover,
.xplore-hierarchy-tool:focus-visible {
    border-color: #a7c8ff;
    background: #f2f7ff;
    outline: none;
}

.xplore-hierarchy-status {
    margin: .7rem 0;
    padding: .52rem .65rem;
    border: 1px solid #cfe0fb;
    border-radius: 8px;
    background: #f2f7ff;
    color: #416896;
    font-size: calc(.75rem + var(--xh-font-step));
}

.xplore-hierarchy-status.is-error {
    border-color: #f2c5cb;
    background: #fff4f5;
    color: #9a2838;
}

.xplore-hierarchy-tree-pane:has(> #xploreHierarchyTree:empty) {
    grid-template-rows: auto minmax(0, 1fr);
}

.xplore-hierarchy-tree-pane:has(> #xploreHierarchyTree:empty) > #xploreHierarchyTree {
    display: none;
}

.xplore-hierarchy-tree-pane:has(> #xploreHierarchyTree:empty) > .xplore-hierarchy-status:not([hidden]) {
    align-self: center;
    justify-self: center;
    box-sizing: border-box;
    width: min(100%, 19rem);
    margin: 0;
    padding: 1.2rem;
    border-radius: 13px;
    line-height: 1.45;
    text-align: center;
}

.xplore-hierarchy-tree,
.xplore-hierarchy-children {
    margin: 0;
    padding: 0;
    list-style: none;
}

.xplore-hierarchy-tree,
.xplore-hierarchy-records-list {
    min-height: 0;
    overflow: auto;
    padding: .28rem .1rem;
    scrollbar-color: #b8cbe7 transparent;
    scrollbar-width: thin;
}

.xplore-hierarchy-tree {
    overflow-x: hidden;
}

.xplore-hierarchy-node,
.xplore-hierarchy-children {
    position: relative;
}

.xplore-hierarchy-children::before {
    content: "";
    position: absolute;
    top: .05rem;
    bottom: .45rem;
    left: calc(1rem + (var(--node-depth, 0) * var(--xh-indent)));
    width: 1px;
    background: #dce7f7;
}

.xplore-hierarchy-node-button {
    width: 100%;
    max-width: 100%;
    min-height: 2.95rem;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1.05rem 1.7rem minmax(0, 1fr);
    align-items: center;
    gap: .4rem;
    margin: .08rem 0;
    padding: .35rem .48rem .35rem calc(.4rem + (var(--node-depth, 0) * var(--xh-indent)));
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--xh-text);
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.xplore-hierarchy-node-button:hover,
.xplore-hierarchy-node-button:focus-visible {
    border-color: #d3e2f7;
    background: #f6faff;
    outline: none;
}

.xplore-hierarchy-node-button.is-selected {
    border-color: #bdd7ff;
    background: linear-gradient(90deg, #e7f2ff, #f2f8ff);
    box-shadow: inset 3px 0 0 var(--xh-blue);
}

.xplore-hierarchy-node.is-expanded > .xplore-hierarchy-node-button .xplore-hierarchy-node-toggle i {
    transform: rotate(90deg);
}

.xplore-hierarchy-node.is-loading > .xplore-hierarchy-node-button .xplore-hierarchy-node-toggle i {
    animation: xploreHierarchySpin .8s linear infinite;
}

.xplore-hierarchy-node-toggle,
.xplore-hierarchy-node-icon {
    display: inline-grid;
    place-items: center;
}

.xplore-hierarchy-node-toggle {
    color: #7088ac;
    font-size: .72rem;
}

.xplore-hierarchy-node-toggle i {
    transition: transform .16s ease;
}

.xplore-hierarchy-node-icon {
    width: 1.62rem;
    height: 1.62rem;
    border-radius: 6px;
    background: #eef5ff;
    color: var(--xh-blue);
    font-size: .88rem;
    overflow: hidden;
}

.xplore-hierarchy-tree-icon {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.xplore-hierarchy-tree-icon--dark {
    display: none;
}

.xplore-hierarchy-node-copy {
    min-width: 0;
    display: grid;
    gap: .12rem;
}

.xplore-hierarchy-node-title,
.xplore-hierarchy-node-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.xplore-hierarchy-node-title {
    color: var(--xh-ink);
    font-size: calc(.77rem + var(--xh-font-step));
    font-weight: 720;
}

.xplore-hierarchy-node-meta {
    color: var(--xh-muted);
    font-size: calc(.66rem + var(--xh-font-step));
    font-weight: 620;
}

.xplore-hierarchy-records-list {
    display: grid;
    align-content: start;
    gap: .58rem;
}

.xplore-hierarchy-records-list:has(> .xplore-hierarchy-records-empty) {
    align-content: center;
    justify-items: center;
}

.xplore-hierarchy-details:has(> .xplore-hierarchy-empty) {
    display: grid;
    place-items: center;
    padding-top: .35rem;
}

.xplore-hierarchy-records-empty,
.xplore-hierarchy-empty {
    box-sizing: border-box;
    width: min(100%, 19rem);
    min-height: 11rem;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: .45rem;
    padding: 1.3rem;
    border: 1px dashed var(--xh-line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--xh-card) 82%, var(--xh-canvas));
    color: var(--xh-muted);
    text-align: center;
}

.xplore-hierarchy-details > .xplore-hierarchy-empty {
    min-height: 9rem;
}

.xplore-hierarchy-records-empty {
    min-height: 9rem;
}

.xplore-hierarchy-demo-trigger {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.xplore-hierarchy-demo-trigger:hover,
.xplore-hierarchy-demo-trigger:focus-visible {
    border-radius: 12px;
    outline: none;
    background: var(--xh-active);
}

.xplore-hierarchy-demo-trigger:focus-visible {
    box-shadow: inset 0 0 0 2px var(--xh-blue);
}

.xplore-hierarchy-demo-notice {
    display: flex;
    align-items: center;
    gap: .42rem;
    margin: .15rem 0 .08rem;
    padding: .48rem .6rem;
    border: 1px solid #cfe0fb;
    border-radius: 8px;
    background: #f2f7ff;
    color: #416896;
    font-size: calc(.69rem + var(--xh-font-step));
    font-weight: 650;
}

.xplore-hierarchy-demo-record {
    width: 100%;
    display: grid;
    grid-template-columns: 2.45rem minmax(0, 1fr);
    gap: .65rem;
    align-items: center;
    padding: .68rem;
    border: 1px solid var(--xh-line);
    border-radius: 11px;
    background: color-mix(in srgb, var(--xh-card) 94%, var(--xh-canvas));
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.xplore-hierarchy-demo-record:hover,
.xplore-hierarchy-demo-record:focus-visible,
.xplore-hierarchy-demo-record.is-selected {
    border-color: var(--xh-blue);
    outline: none;
    background: var(--xh-active);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--xh-blue) 25%, transparent);
}

.xplore-hierarchy-demo-record-icon {
    width: 2.45rem;
    height: 2.45rem;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #fff3df;
    color: #e77b00;
    font-size: 1rem;
}

.xplore-hierarchy-demo-record > div > strong,
.xplore-hierarchy-demo-record > div > span,
.xplore-hierarchy-demo-record > div > small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.xplore-hierarchy-demo-record > div > strong {
    color: var(--xh-ink);
    font-size: calc(.75rem + var(--xh-font-step));
    font-weight: 800;
}

.xplore-hierarchy-demo-record > div > span {
    margin-top: .12rem;
    color: var(--xh-text);
    font-size: calc(.7rem + var(--xh-font-step));
}

.xplore-hierarchy-demo-record > div > small {
    margin-top: .35rem;
    color: var(--xh-muted);
    font-size: calc(.64rem + var(--xh-font-step));
    font-weight: 650;
}

.xplore-hierarchy-demo-record > div > small b {
    margin: 0 .18rem;
}

.xplore-hierarchy-records-empty i,
.xplore-hierarchy-empty i {
    width: 3rem;
    height: 3rem;
    display: grid;
    place-items: center;
    margin-bottom: .25rem;
    border-radius: 50%;
    background: #edf5ff;
    color: var(--xh-blue);
    font-size: 1.3rem;
}

.xplore-hierarchy-records-empty strong,
.xplore-hierarchy-empty strong {
    color: var(--xh-ink);
    font-size: calc(.88rem + var(--xh-font-step));
}

.xplore-hierarchy-records-empty span,
.xplore-hierarchy-empty span {
    max-width: 14rem;
    font-size: calc(.73rem + var(--xh-font-step));
    line-height: 1.45;
}

.xplore-hierarchy-details {
    box-sizing: border-box;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding: clamp(.9rem, 1.2vw, 1.2rem);
}

.xplore-hierarchy-detail-head {
    display: grid;
    grid-template-columns: 2.95rem minmax(0, 1fr);
    gap: .75rem;
    align-items: center;
    padding: .15rem .05rem .95rem;
    border-bottom: 1px solid var(--xh-line);
}

.xplore-hierarchy-detail-head > span {
    width: 2.95rem;
    height: 2.95rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #eaf3ff;
    color: var(--xh-blue);
    font-size: 1.35rem;
}

.xplore-hierarchy-detail-head strong,
.xplore-hierarchy-detail-head small {
    display: block;
    overflow-wrap: anywhere;
}

.xplore-hierarchy-detail-head strong {
    color: var(--xh-ink);
    font-size: calc(.96rem + var(--xh-font-step));
    font-weight: 800;
    letter-spacing: -.025em;
    line-height: 1.26;
}

.xplore-hierarchy-detail-head small {
    margin-top: .23rem;
    color: var(--xh-blue);
    font-size: calc(.7rem + var(--xh-font-step));
    font-weight: 750;
}

.xplore-hierarchy-record-title {
    color: var(--xh-ink) !important;
    font-size: calc(.78rem + var(--xh-font-step)) !important;
    font-weight: 700 !important;
    line-height: 1.3;
}

.xplore-hierarchy-record-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(5.5rem, 100%), 1fr));
    margin-top: .8rem;
    border-bottom: 1px solid var(--xh-line);
}

.xplore-hierarchy-record-tabs button {
    min-width: 0;
    padding: .5rem .12rem .58rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--xh-muted);
    cursor: pointer;
    font: inherit;
    font-size: calc(.62rem + var(--xh-font-step));
    font-weight: 700;
    line-height: 1.2;
}

.xplore-hierarchy-record-tabs button.is-active {
    border-bottom-color: var(--xh-blue);
    color: var(--xh-blue);
}

.xplore-hierarchy-record-detail-list {
    margin-top: .62rem;
}

.xplore-hierarchy-record-detail-list div {
    grid-template-columns: minmax(0, 1fr) minmax(0, .98fr);
    padding: .42rem .05rem;
}

.xplore-hierarchy-record-detail-list dt {
    display: flex;
    align-items: center;
    gap: .48rem;
}

.xplore-hierarchy-record-detail-list dt i {
    width: .95rem;
    color: #52729d;
    font-size: .72rem;
    text-align: center;
}

.xplore-hierarchy-record-detail-list dd {
    text-align: left;
}

.xplore-hierarchy-record-observation {
    margin-top: .72rem;
    padding-top: .68rem;
    border-top: 1px solid var(--xh-line-soft);
}

.xplore-hierarchy-record-observation strong {
    display: flex;
    align-items: center;
    gap: .48rem;
    color: #526f99;
    font-size: calc(.7rem + var(--xh-font-step));
}

.xplore-hierarchy-record-observation p {
    margin: .45rem 0 0 1.42rem;
    color: var(--xh-ink);
    font-size: calc(.7rem + var(--xh-font-step));
    font-weight: 600;
    line-height: 1.45;
}

.xplore-hierarchy-record-actions {
    display: grid;
    gap: .48rem;
    margin-top: .85rem;
}

.xplore-hierarchy-record-actions button {
    min-height: 2.2rem;
    border: 1px solid var(--xh-line);
    border-radius: 8px;
    background: var(--xh-card);
    color: var(--xh-blue-strong);
    cursor: pointer;
    font: inherit;
    font-size: calc(.66rem + var(--xh-font-step));
    font-weight: 750;
}

.xplore-hierarchy-record-actions i {
    margin-right: .35rem;
}

.xplore-hierarchy-record-actions .xplore-hierarchy-record-primary {
    border-color: var(--xh-blue);
    background: var(--xh-blue);
    color: #fff;
}

.xplore-hierarchy-record-actions > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .48rem;
}

.xplore-hierarchy-record-tab-panel {
    min-height: 7rem;
}

.xplore-hierarchy-tab-empty {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin-top: .75rem;
    padding: .72rem;
    border: 1px dashed var(--xh-line);
    border-radius: 8px;
    color: var(--xh-muted);
    font-size: calc(.7rem + var(--xh-font-step));
    font-weight: 600;
    line-height: 1.4;
}

.xplore-hierarchy-tab-empty i {
    color: var(--xh-blue);
}

.xplore-hierarchy-related-list {
    display: grid;
    gap: .45rem;
    margin-top: .72rem;
}

.xplore-hierarchy-related-list button {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .52rem;
    width: 100%;
    padding: .62rem .68rem;
    border: 1px solid var(--xh-line);
    border-radius: 8px;
    background: var(--xh-card);
    color: var(--xh-ink);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.xplore-hierarchy-related-list button:hover,
.xplore-hierarchy-related-list button:focus-visible {
    border-color: var(--xh-blue);
    outline: 0;
}

.xplore-hierarchy-related-list button > i:first-child {
    color: var(--xh-blue);
}

.xplore-hierarchy-related-list span {
    min-width: 0;
}

.xplore-hierarchy-related-list strong,
.xplore-hierarchy-related-list small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.xplore-hierarchy-related-list small {
    margin-top: .12rem;
    color: var(--xh-muted);
    font-size: calc(.65rem + var(--xh-font-step));
}

.xplore-hierarchy-detail-list {
    display: grid;
    gap: 0;
    margin: .85rem 0 0;
}

.xplore-hierarchy-detail-list div {
    display: grid;
    grid-template-columns: minmax(6.25rem, .86fr) minmax(0, 1.14fr);
    gap: .55rem;
    align-items: baseline;
    padding: .62rem .05rem;
    border-bottom: 1px solid var(--xh-line-soft);
}

.xplore-hierarchy-detail-list div:last-child { border-bottom: 0; }

.xplore-hierarchy-detail-list dt {
    color: #526f99;
    font-size: calc(.7rem + var(--xh-font-step));
    font-weight: 700;
}

.xplore-hierarchy-detail-list dd {
    margin: 0;
    color: var(--xh-ink);
    overflow-wrap: anywhere;
    font-size: calc(.72rem + var(--xh-font-step));
    font-weight: 650;
    line-height: 1.4;
    text-align: right;
}

@keyframes xploreHierarchySpin {
    to { transform: rotate(360deg); }
}

html[data-theme="dark"] .xplore-hierarchy-shell,
body[data-theme="dark"] .xplore-hierarchy-shell {
    --xh-blue: #68a3ff;
    --xh-blue-strong: #9cc4ff;
    --xh-ink: #ecf4ff;
    --xh-text: #c8dcf8;
    --xh-muted: #8eabd0;
    --xh-line: #234c83;
    --xh-line-soft: #173b6b;
    --xh-canvas: #061b38;
    --xh-card: #0a2448;
    --xh-active: #123d70;
    --xh-shadow: 0 14px 32px rgba(0, 7, 20, .28);
    background:
        radial-gradient(circle at 90% 0%, rgba(66, 159, 255, .12), transparent 30rem),
        linear-gradient(145deg, #061a35, var(--xh-canvas));
}

html[data-theme="dark"] .xplore-hierarchy-breadcrumb,
html[data-theme="dark"] .xplore-hierarchy-tree-pane,
html[data-theme="dark"] .xplore-hierarchy-records-pane,
html[data-theme="dark"] .xplore-hierarchy-details,
html[data-theme="dark"] .xplore-hierarchy-metric,
html[data-theme="dark"] .xplore-hierarchy-tool,
body[data-theme="dark"] .xplore-hierarchy-breadcrumb,
body[data-theme="dark"] .xplore-hierarchy-tree-pane,
body[data-theme="dark"] .xplore-hierarchy-records-pane,
body[data-theme="dark"] .xplore-hierarchy-details,
body[data-theme="dark"] .xplore-hierarchy-metric,
body[data-theme="dark"] .xplore-hierarchy-tool {
    background: var(--xh-card);
}

html[data-theme="dark"] .xplore-hierarchy-metric-icon,
html[data-theme="dark"] .xplore-hierarchy-panel-icon,
html[data-theme="dark"] .xplore-hierarchy-node-icon,
html[data-theme="dark"] .xplore-hierarchy-detail-head > span,
html[data-theme="dark"] .xplore-hierarchy-records-empty i,
html[data-theme="dark"] .xplore-hierarchy-empty i,
body[data-theme="dark"] .xplore-hierarchy-metric-icon,
body[data-theme="dark"] .xplore-hierarchy-panel-icon,
body[data-theme="dark"] .xplore-hierarchy-node-icon,
body[data-theme="dark"] .xplore-hierarchy-detail-head > span,
body[data-theme="dark"] .xplore-hierarchy-records-empty i,
body[data-theme="dark"] .xplore-hierarchy-empty i {
    background: #123b6f;
}

html[data-theme="dark"] .xplore-hierarchy-tree-icon--light,
body[data-theme="dark"] .xplore-hierarchy-tree-icon--light {
    display: none;
}

html[data-theme="dark"] .xplore-hierarchy-tree-icon--dark,
body[data-theme="dark"] .xplore-hierarchy-tree-icon--dark {
    display: block;
}

html[data-theme="dark"] .xplore-hierarchy-node-button:hover,
html[data-theme="dark"] .xplore-hierarchy-node-button:focus-visible,
body[data-theme="dark"] .xplore-hierarchy-node-button:hover,
body[data-theme="dark"] .xplore-hierarchy-node-button:focus-visible {
    background: #103763;
}

html[data-theme="dark"] .xplore-hierarchy-node-button.is-selected,
body[data-theme="dark"] .xplore-hierarchy-node-button.is-selected {
    background: linear-gradient(90deg, #164879, #10345f);
    border-color: #3879c9;
}

html[data-theme="dark"] .xplore-hierarchy-status,
body[data-theme="dark"] .xplore-hierarchy-status {
    border-color: #2a5d9e;
    background: #10345f;
    color: #bdd9ff;
}

html[data-theme="dark"] .xplore-hierarchy-demo-notice,
body[data-theme="dark"] .xplore-hierarchy-demo-notice {
    border-color: #2a5d9e;
    background: #10345f;
    color: #bdd9ff;
}

html[data-theme="dark"] .xplore-hierarchy-demo-record-icon,
body[data-theme="dark"] .xplore-hierarchy-demo-record-icon {
    background: #493313;
    color: #ffd08a;
}

html[data-theme="dark"] .xplore-hierarchy-record-detail-list dt i,
html[data-theme="dark"] .xplore-hierarchy-record-observation strong,
body[data-theme="dark"] .xplore-hierarchy-record-detail-list dt i,
body[data-theme="dark"] .xplore-hierarchy-record-observation strong {
    color: #a9c8ef;
}

html[data-theme="dark"] .xplore-hierarchy-breadcrumb,
body[data-theme="dark"] .xplore-hierarchy-breadcrumb {
    scrollbar-color: #3970aa transparent;
}

html[data-theme="dark"] .xplore-hierarchy-breadcrumb::-webkit-scrollbar-thumb,
body[data-theme="dark"] .xplore-hierarchy-breadcrumb::-webkit-scrollbar-thumb {
    background: #3970aa;
}

@media (max-width: 1280px) {
    .xplore-hierarchy-workspace {
        grid-template-columns: minmax(0, .85fr) minmax(0, 1fr) minmax(0, .7fr);
    }
    .xplore-hierarchy-metric { padding: .65rem; }
    .xplore-hierarchy-metric-icon { width: 2.15rem; height: 2.15rem; }
}

@media (max-width: 1200px) {
    .xplore-hierarchy-shell { height: auto; min-height: calc(100dvh - var(--x-nav-height, 84px)); }
    .xplore-hierarchy-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .xplore-hierarchy-workspace {
        grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
        min-height: min(56dvh, 32rem);
    }
    .xplore-hierarchy-details {
        grid-column: 1 / -1;
        min-height: 14rem;
        max-height: min(56dvh, 34rem);
    }
    .xplore-hierarchy-empty { min-height: 10rem; }
}

@media (max-width: 720px) {
    .xplore-hierarchy-shell { min-height: auto; padding: .75rem; }
    .xplore-hierarchy-workspace { grid-template-columns: 1fr; min-height: auto; }
    .xplore-hierarchy-tree-pane,
    .xplore-hierarchy-records-pane { min-height: min(56dvh, 34rem); }
    .xplore-hierarchy-details { grid-column: auto; min-height: min(40dvh, 24rem); }
}

@media (max-width: 500px) {
    .xplore-hierarchy-breadcrumb { gap: .4rem; padding-inline: .7rem; font-size: calc(.69rem + var(--xh-font-step)); }
    .xplore-hierarchy-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
    .xplore-hierarchy-metric:last-child { grid-column: 1 / -1; }
    .xplore-hierarchy-metric { min-height: 3.9rem; }
    .xplore-hierarchy-metric strong { font-size: calc(1rem + var(--xh-font-step)); }
    .xplore-hierarchy-node-button {
        grid-template-columns: 1rem 1.55rem minmax(0, 1fr);
        gap: .3rem;
        min-height: 2.85rem;
        padding-right: .32rem;
    }
    .xplore-hierarchy-detail-list div { grid-template-columns: 1fr; gap: .18rem; }
    .xplore-hierarchy-detail-list dd { text-align: left; }
}
