#timeline-app { margin-top: 26px; }
.tree-model { --tree-color: #31628e; --tree-tint: #edf4fc; --tree-border: #c5d9ee; }
.tree-runtime { --tree-color: #685289; --tree-tint: #f4eefb; --tree-border: #dbceec; }
.tree-hardware { --tree-color: #865a24; --tree-tint: #fbf3e5; --tree-border: #edd9b5; }
.tree-physical { --tree-color: #246857; --tree-tint: #edf7f2; --tree-border: #c5e1d6; }
.tree-all { --tree-color: var(--accent); --tree-tint: var(--tint); --tree-border: #e6ced7; }
.tree-frame { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 6px 22px #27384c0a; overflow: hidden; }
.tree-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px 18px; flex-wrap: wrap; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.tree-filters, .tree-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.tree-filter, .tree-control, .tree-year { min-height: 34px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font-size: .76rem; font-weight: 670; }
.tree-filter { display: inline-flex; align-items: center; gap: 6px; padding-inline: 8px; }
.tree-filter::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--tree-color); }
.tree-filter:hover, .tree-filter[aria-pressed="true"] { border-color: var(--tree-border); background: var(--tree-tint); color: var(--tree-color); }
.tree-control { width: 32px; font-size: 1rem; }
.tree-control:hover:not(:disabled), .tree-year:hover { background: #f5f7fa; }
.tree-fit { font-size: .76rem; }
.tree-year { padding-inline: 7px; margin-right: 3px; }
.tree-scale { min-width: 39px; color: var(--muted); font-size: .71rem; text-align: center; font-variant-numeric: tabular-nums; }
.tree-viewport { position: relative; overflow: auto; max-height: 536px; scrollbar-gutter: stable; }
.tree-viewport:focus-visible { outline-offset: -3px; }
.tree-sheet { --tree-count: 4; --tree-base: 880px; --tree-scale: 1; --year-width: 74px; position: relative; min-width: calc(var(--tree-base) * var(--tree-scale)); width: calc(100% * var(--tree-scale)); padding-bottom: 14px; background: #fcfdff; }
.tree-sheet.tree-focused { --tree-base: 285px; }
.tree-branches { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.tree-headings, .tree-band { display: grid; grid-template-columns: var(--year-width) repeat(var(--tree-count), minmax(0, 1fr)); }
.tree-headings { position: sticky; z-index: 3; top: 0; background: #f5f7fb; border-bottom: 1px solid #dbe3ec; }
.tree-heading, .tree-year-axis { display: grid; align-content: center; justify-items: center; padding: 12px 6px 10px; }
.tree-year-axis { color: var(--muted); font-size: .71rem; font-weight: 700; }
.tree-heading { background: var(--tree-tint); color: var(--tree-color); border-inline-start: 1px solid #e2e7ef; border-top: 2px solid var(--tree-color); text-align: center; }
.tree-heading strong { font-size: calc(.84rem * var(--tree-scale)); line-height: 1.25; }
.tree-heading span { margin-top: 2px; font-size: .67rem; color: var(--muted); }
.tree-band { border-bottom: 1px dashed #d8e1ec; }
.tree-band:nth-child(even) { background: #f7f9fc; }
.tree-era { position: relative; z-index: 2; align-self: start; padding: 11px 4px 0; text-align: center; color: var(--muted); font-size: .72rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.tree-cell { min-height: 65px; border-inline-start: 1px solid #e6ebf1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(calc(44px * var(--tree-scale)), auto); align-content: center; gap: 5px 15px; padding: 9px 7px; }
.tree-work { position: relative; z-index: 2; justify-self: end; min-width: 68px; max-width: 100%; padding: 5px 6px; text-align: left; line-height: 1.2; border: 1px solid var(--tree-border); border-radius: 6px; background: var(--tree-tint); color: var(--tree-color); box-shadow: 0 2px 4px #26384b08; }
.tree-work:nth-child(even) { justify-self: start; }
.tree-work strong { display: block; font-size: calc(.74rem * var(--tree-scale)); overflow-wrap: anywhere; }
.tree-work small { display: block; margin-top: 2px; font-size: calc(.65rem * var(--tree-scale)); font-weight: 560; color: var(--muted); }
.tree-work:hover, .tree-work[aria-pressed="true"] { border-color: var(--tree-color); box-shadow: 0 0 0 1px var(--tree-color); }
.tree-focused .tree-cell { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.tree-focused .tree-work { min-width: min(105px,100%); }
.tree-detail { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; min-height: 65px; gap: 10px 16px; padding: 12px 15px; border-top: 1px solid var(--line); }
.tree-detail > p, .tree-note { color: var(--muted); font-size: .8rem; }
.tree-detail-body { flex: 1 1 360px; }
.tree-detail-meta { color: var(--muted); font-size: .73rem; margin-bottom: 3px; }
.tree-detail h3 { font-size: .93rem; }
.tree-detail-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.tree-note { margin-top: 8px; }
@media (max-width: 760px) {
  .tree-toolbar { padding: 10px; }
  .tree-filters { width: 100%; }
  .tree-filter { padding-inline: 6px; }
  .tree-viewport { max-height: 460px; }
  .tree-sheet { --year-width: 60px; }
  .tree-era, .tree-year-axis { position: sticky; left: 0; background: #f7f9fc; }
  .tree-era { align-self: stretch; }
}

.tree-band.tree-current-era { background: #f7f0e8; }
.tree-current-era .tree-era { color: #6b4222; }
.tree-view-controls { display: inline-flex; gap: 2px; padding: 2px; margin-inline-end: 4px; border: 1px solid var(--line); border-radius: 7px; background: #f5f7fb; }
.tree-view-button { min-height: 29px; border: 1px solid transparent; border-radius: 4px; background: transparent; padding: 3px 7px; color: var(--muted); font-size: .73rem; font-weight: 650; }
.tree-view-button[aria-pressed="true"] { border-color: #e0ccd5; color: var(--accent-dark); background: #fff; }
.tree-view-button:hover { color: var(--accent-dark); }
.tree-frame:has(.tree-dense) .tree-viewport { max-height: 630px; }
.tree-dense .tree-cell { align-content: start; grid-auto-rows: minmax(calc(40px * var(--tree-scale)), auto); }
.tree-dense .tree-work strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.tree-era { align-self: stretch; }
.tree-era span { display: block; position: sticky; top: calc(var(--tree-header-height, 62px) + 8px); }
@media (max-width: 760px) {
  .tree-frame:has(.tree-dense) .tree-viewport { max-height: 460px; }
  .tree-controls { row-gap: 7px; }
}
