.trn-local-dialog {
    --local-ink: #182e49;
    --local-muted: #557089;
    --local-rule: #dce8f2;
    --local-canvas: #fcfdff;
    position: fixed;
    inset: 0;
    width: min(1220px, calc(100vw - 44px));
    max-height: calc(100dvh - 34px);
    margin: auto;
    padding: 0;
    border: 1px solid var(--local-rule);
    border-radius: 16px;
    color: var(--local-ink);
    background: #fff;
    box-shadow: 0 18px 52px #17345430;
    font: .83rem/1.4 var(--font-display, system-ui, sans-serif);
    overflow: auto;
}

.trn-local-dialog::backdrop { background: #254b723f; }
.trn-local-head, .trn-local-toolbar, .trn-local-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .55rem 1rem;
    padding: .76rem 1.16rem;
}
.trn-local-head { padding-block: .82rem; }
.trn-local-head, .trn-local-toolbar { border-bottom: 1px solid var(--local-rule); }
.trn-local-identity { min-width: 0; }
.trn-local-identity h2 { margin: 0; font-size: clamp(1.12rem, 3vw, 1.5rem); letter-spacing: -.025em; }
.trn-local-title { margin: .18rem 0 0; color: var(--local-muted); font-weight: 650; overflow-wrap: anywhere; }
.trn-local-button {
    min-width: 35px;
    min-height: 34px;
    padding: .33rem .58rem;
    border: 1px solid #d2e1ef;
    border-radius: 8px;
    background: #fff;
    color: #285681;
    font: 680 .81rem/1 var(--font-display, system-ui, sans-serif);
    cursor: pointer;
}
.trn-local-button:hover { border-color: #a6bfd8; background: #edf5fd; }
.trn-local-button:focus-visible { outline: 2px solid #2469a5; outline-offset: 2px; }
.trn-local-close { flex: none; min-height: 36px; font-size: 1.3rem; }
.trn-local-toolbar { flex-wrap: wrap; padding-block: .55rem; background: #f5f9fd; }
.trn-local-totals, .trn-local-evidence {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .34rem .55rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.trn-local-total {
    display: inline-flex;
    align-items: center;
    gap: .31rem;
    padding: .24rem .51rem;
    border-radius: 7px;
    background: var(--node-ui-fill);
    color: var(--node-ui-ink);
    font-size: .75rem;
}
.trn-local-total svg { width: 13px; height: 13px; flex: none; }
.trn-local-total strong { font-variant-numeric: tabular-nums; }
.trn-local-total .trn-local-marker { fill: var(--node-ui-fill); stroke: var(--node-ui-ink); }
.trn-local-actions { display: flex; align-items: center; gap: .78rem; margin-inline-start: auto; }
.trn-local-layout-status {
    color: var(--local-muted);
    font-size: .72rem;
    white-space: nowrap;
}
.trn-local-layout-status::before {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-inline-end: .34rem;
    border-radius: 50%;
    background: #3c89b5;
    content: '';
}
.trn-local-zoom { display: flex; gap: .28rem; }

.trn-local-stage {
    position: relative;
    height: min(68dvh, 680px);
    min-height: 210px;
    background: var(--local-canvas);
}
.trn-local-svg { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.trn-local-svg.is-dragging, .trn-local-svg.is-dragging .trn-local-node { cursor: grabbing; }
.trn-local-node { cursor: pointer; outline: none; }
.trn-local-dialog [data-type="tf"] {
    --node-ui-ink: #28599d; --node-ui-fill: #eaf3ff;
    --node-ink: #28599d; --node-fill: #e3effd; --node-active: #28599d;
}
.trn-local-dialog [data-type="cre"] {
    --node-ui-ink: #136a65; --node-ui-fill: #e6f5ef;
    --node-ink: #136a65; --node-fill: #def2eb; --node-active: #136a65;
}
.trn-local-dialog [data-type="gene"] {
    --node-ui-ink: #6b508f; --node-ui-fill: #f3edfa;
    --node-ink: #6b508f; --node-fill: #efe7f8; --node-active: #6b508f;
}
.trn-local-marker, .trn-local-halo { vector-effect: non-scaling-stroke; }
.trn-local-marker { fill: var(--node-fill); stroke: var(--node-ink); stroke-width: 1.25; }
.trn-local-node[data-type="cre"] .trn-local-marker { stroke-width: 1.7; }
.trn-local-hit { fill: transparent; }
.trn-local-halo { fill: var(--node-active); fill-opacity: .11; stroke: var(--node-ink); visibility: hidden; stroke-width: 1.3; }
.trn-local-node:is(.is-anchor, .is-selected, :focus-visible) .trn-local-halo { visibility: visible; }
.trn-local-node:is(.is-anchor, .is-selected) .trn-local-marker { fill: var(--node-active); stroke: #fff; }
.trn-local-node:focus-visible .trn-local-halo { stroke-dasharray: 3 2; stroke-width: 2; }
.trn-local-label {
    fill: var(--node-ink);
    stroke: var(--local-canvas);
    stroke-width: 3px;
    stroke-linejoin: round;
    paint-order: stroke fill;
    font: 630 10.75px/1 var(--font-display, system-ui, sans-serif);
    pointer-events: none;
    visibility: hidden;
}
.trn-local-node:is(.show-label, .is-anchor, .is-selected, :focus-visible, :hover) .trn-local-label { visibility: visible; }
.trn-local-node[data-type="cre"] .trn-local-label,
.trn-local-node:is(.is-anchor, .is-selected) .trn-local-label { font-weight: 760; }
.trn-local-stage.is-settling .trn-local-node:not(.is-anchor, .is-selected, :focus-visible, :hover) .trn-local-label { visibility: hidden; }

.trn-local-wire {
    stroke: #75849a;
    fill: none;
    stroke-width: .95;
    stroke-opacity: .52;
    vector-effect: non-scaling-stroke;
}
.trn-local-wire-activity { stroke: #127968; }
.trn-local-wire-chromatin { stroke: #2469a5; }
.trn-local-wire-crispr { stroke: #9a3b79; stroke-dasharray: 5 3; }
.trn-local-wire-eqtl { stroke: #a95310; stroke-dasharray: 1 3; stroke-linecap: round; }
.trn-local-wire-reference { stroke: #65748a; stroke-dasharray: 3 3; }
.trn-local-stage.is-dense .trn-local-wire { stroke-opacity: .25; stroke-width: .78; }
.trn-local-stage.has-selection .trn-local-edge:not(.is-muted) .trn-local-wire {
    stroke-opacity: .55;
    stroke-width: 1.16;
}
.trn-local-stage.has-selection .trn-local-edge.is-direct .trn-local-wire {
    stroke-opacity: .92;
    stroke-width: 1.65;
}
.trn-local-edge.is-muted { opacity: .13; }
.trn-local-node.is-muted:not(:hover, :focus-visible) { opacity: .19; }
.trn-local-node.is-muted:not(:hover, :focus-visible) .trn-local-label { visibility: hidden; }
.trn-local-evidence {
    gap: .21rem .82rem;
    color: var(--local-muted);
    font-size: .71rem;
}
.trn-local-evidence[hidden] { display: none; }
.trn-local-evidence li { display: flex; align-items: center; gap: .3rem; }
.trn-local-evidence svg { width: 21px; height: 8px; }
.trn-local-evidence .trn-local-wire { stroke-opacity: 1; stroke-width: 1.65; }
.trn-local-foot {
    align-items: baseline;
    flex-wrap: wrap;
    gap: .38rem .85rem;
    min-height: 2.55rem;
    margin: 0;
    padding-block: .52rem;
    border-top: 1px solid var(--local-rule);
    color: var(--local-muted);
    background: #f5f9fd;
    font-size: .75rem;
}
.trn-local-summary { margin-inline-start: auto; }
.trn-local-details { flex-basis: 100%; color: var(--local-ink); font-weight: 650; overflow-wrap: anywhere; }

@media (max-width: 640px) {
    .trn-local-dialog {
        width: calc(100vw - 18px);
        max-height: calc(100dvh - 18px);
        border-radius: 13px;
    }
    .trn-local-head, .trn-local-toolbar, .trn-local-foot { padding: .6rem .7rem; }
    .trn-local-stage { height: min(61dvh, 505px); }
    .trn-local-summary { margin-inline-start: 0; }
}
