/* Operations tank blueprint — component-only styles.
   Load after the unchanged operations-overview.css.
   All layout, type and color rules are confined to .ops-blueprint-host or the
   portaled .ops-inspector. No page, breadcrumb, hero, summary or shared selectors.
*/
.ops-blueprint-host,
.ops-blueprint-host *,
.ops-inspector,
.ops-inspector * {
    box-sizing: border-box;
}

.ops-blueprint-host,
.ops-inspector {
    --ops-text: #edf6fc;
    --ops-copy: #b9cbd8;
    --ops-muted: #8ca8bb;
    --ops-blue: #7dd3fc;
    --ops-green: #9beaab;
    --ops-gold: #edc061;
    --ops-border: rgba(112, 183, 215, .19);
    --ops-tone: var(--ops-blue);
    color: var(--ops-text);
    font-family: inherit;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;
}

.ops-blueprint-host [data-tone="blue"],
.ops-inspector[data-tone="blue"] {
    --ops-tone: #7dd3fc;
}

.ops-blueprint-host [data-tone="green"],
.ops-inspector[data-tone="green"] {
    --ops-tone: #9beaab;
}

.ops-blueprint-host [data-tone="gold"],
.ops-inspector[data-tone="gold"] {
    --ops-tone: #edc061;
}

.ops-blueprint-host [data-tone="red"],
.ops-inspector[data-tone="red"] {
    --ops-tone: #f59b9b;
}

.ops-blueprint-host [data-tone="neutral"],
.ops-inspector[data-tone="neutral"] {
    --ops-tone: #acbfce;
}

.ops-blueprint-host a {
    color: var(--ops-blue); text-decoration: none;
}

.ops-blueprint-host button,
.ops-inspector button {
    font: inherit; cursor: pointer;
}

.ops-blueprint-host [hidden],
.ops-inspector[hidden],
.ops-inspector [hidden] {
    display: none !important;
}

.ops-blueprint-host :is(a, button):focus-visible,
.ops-inspector :is(a, button):focus-visible {
    outline: 2px solid var(--ops-tone); outline-offset: 4px;
}

:where(.ops-blueprint-host) .ops-blueprint {
    position: relative; min-width: 0; background: #021520; overflow: hidden;
}

:where(.ops-blueprint-host) .ops-map-reset {
    color: var(--ops-copy); font-size: 9px !important; border: 1px solid var(--ops-border); border-radius: 5px; padding: 5px 9px; background: #0a2636;
}

:where(.ops-blueprint-host) .ops-map-reset:hover {
    color: #fff; border-color: var(--ops-blue);
}

:where(.ops-blueprint-host) .ops-map-guide {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px 18px; padding: 10px 21px 2px; color: var(--ops-muted); font-size: 9px;
}

:where(.ops-blueprint-host) .ops-map-guide > span:first-child {
    display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
}

:where(.ops-blueprint-host) .ops-map-guide strong {
    color: var(--ops-copy); font-weight: 650;
}

:where(.ops-blueprint-host) .ops-guide-dot {
    width: 5px; height: 5px; margin-right: 3px; background: var(--ops-blue); border-radius: 50%;
}

:where(.ops-blueprint-host) .ops-map-legend {
    display: flex; align-items: center; gap: 6px; font-size: 8px;
}

:where(.ops-blueprint-host) .ops-map-legend i {
    display: inline-block; width: 20px; height: 1px; margin-left: 4px; background: #73aec0;
}

:where(.ops-blueprint-host) .ops-map-legend i.evidence {
    height: 0; border-top: 1px dashed var(--ops-gold); background: none;
}

:where(.ops-blueprint-host) .ops-diagram {
    position: relative; display: grid; min-width: 0; isolation: isolate;
    /* Contain the complete branch map on wide screens without scaling its text. */
    width: 100%; max-width: 1180px; margin-inline: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-areas: "pumps storage agitator sensors" "art art art art" "maintenance assurance valves flowmeters" "processing processing accounting reporting";
    gap: 24px 16px; padding: 18px 20px 22px;
}

:where(.ops-blueprint-host) .ops-branch--pumps {
    grid-area: pumps;
}

:where(.ops-blueprint-host) .ops-branch--storage {
    grid-area: storage;
}

:where(.ops-blueprint-host) .ops-branch--agitator {
    grid-area: agitator;
}

:where(.ops-blueprint-host) .ops-branch--sensors {
    grid-area: sensors;
}

:where(.ops-blueprint-host) .ops-branch--maintenance {
    grid-area: maintenance;
}

:where(.ops-blueprint-host) .ops-branch--assurance {
    grid-area: assurance;
}

:where(.ops-blueprint-host) .ops-branch--valves {
    grid-area: valves;
}

:where(.ops-blueprint-host) .ops-branch--flowmeters {
    grid-area: flowmeters;
}

:where(.ops-blueprint-host) .ops-branch--processing {
    grid-area: processing;
}

:where(.ops-blueprint-host) .ops-branch--accounting {
    grid-area: accounting;
}

:where(.ops-blueprint-host) .ops-branch--reporting {
    grid-area: reporting;
}

:where(.ops-blueprint-host) .ops-branch {
    position: relative; z-index: 3; display: grid; grid-template-columns: 30px minmax(0, 1fr) 13px;
    align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 11px 13px;
    border: 1px solid rgba(120, 182, 207, .26); border-radius: 7px;
    background: linear-gradient(110deg, #082232, #061a27); color: var(--ops-text);
    text-align: left; transition: border-color .14s ease, background .14s ease, box-shadow .14s ease;
}

:where(.ops-blueprint-host) .ops-branch::after {
    position: absolute; inset: auto 18px -1px; height: 1px; background: var(--ops-tone); opacity: .26; content: "";
}

:where(.ops-blueprint-host) .ops-branch-code {
    display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid rgba(120, 182, 207, .20); border-radius: 5px; color: var(--ops-tone); background: #051a27; font-family: ui-monospace, Consolas, monospace; font-size: 11px;
}

:where(.ops-blueprint-host) .ops-branch-copy {
    display: block; min-width: 0;
}

:where(.ops-blueprint-host) .ops-branch-copy strong {
    display: block; font-size: 12px; line-height: 1.35; color: var(--ops-text); font-weight: 650; overflow-wrap: anywhere;
}

:where(.ops-blueprint-host) .ops-branch-copy small {
    display: block; margin-top: 3px; font-size: 9px; font-weight: 400; line-height: 1.4; color: var(--ops-copy); overflow-wrap: anywhere;
}

:where(.ops-blueprint-host) .ops-branch-open {
    font-size: 15px; color: var(--ops-tone); font-weight: 400; opacity: .8;
}

:where(.ops-blueprint-host) .ops-branch:is(:hover, :focus-visible, .is-active) {
    border-color: var(--ops-tone); background: linear-gradient(110deg, #103041, #092131); box-shadow: 0 0 18px rgba(117, 212, 237, .055);
}

:where(.ops-blueprint-host) .ops-branch.is-pinned::after {
    opacity: 1; height: 2px;
}

:where(.ops-blueprint-host) .ops-branch[data-group="record"] {
    background: linear-gradient(105deg, #0a252d, #071e29);
}

:where(.ops-blueprint-host) .ops-branch[data-group="record"][data-tone="gold"] {
    background: linear-gradient(105deg, #222517, #0c2029);
}

:where(.ops-blueprint-host) .ops-art {
    position: relative; z-index: 1; grid-area: art; margin: 0; min-width: 0;
    /* Resize the artwork and its hotspot wrapper together. Connector endpoints
       follow their measured positions through the existing ResizeObserver. */
    width: 88%; max-width: 1040px; justify-self: center;
}

:where(.ops-blueprint-host) .ops-image-wrap {
    position: relative; width: 100%; aspect-ratio: 1942 / 809; background: #021520;
}

:where(.ops-blueprint-host) .ops-blueprint-image {
    display: block; width: 100%; height: auto; max-width: none; user-select: none;
}

:where(.ops-blueprint-host) .ops-art figcaption {
    display: flex; justify-content: center; flex-wrap: wrap; align-items: baseline; gap: 6px; margin: 5px 18px 0; color: #93aeba; font-size: 9px; line-height: 1.5; text-align: center;
}

:where(.ops-blueprint-host) .ops-art figcaption > span {
    color: #bbd3de; font-size: 8px; letter-spacing: .1em; font-weight: 750;
}

:where(.ops-blueprint-host) .ops-image-unavailable {
    position: absolute; inset: 20%; display: grid; place-items: center; padding: 16px; text-align: center; color: var(--ops-copy); border: 1px dashed var(--ops-border); font-size: 12px;
}

:where(.ops-blueprint-host) .ops-hotspot {
    position: absolute; z-index: 5; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
    display: grid; place-items: center; width: max(32px, var(--hit-w)); height: max(32px, var(--hit-h));
    margin: 0; padding: 0; border: 0; background: transparent; border-radius: 8px; color: var(--ops-tone);
    -webkit-tap-highlight-color: transparent;
}

:where(.ops-blueprint-host) .ops-hotspot-point {
    position: relative; display: grid; place-items: center; width: 16px; height: 16px; border: 1px solid currentColor; border-radius: 50%; background: rgba(2, 20, 30, .84); box-shadow: 0 0 0 4px rgba(2, 20, 30, .40); transition: box-shadow .14s ease, background .14s ease;
}

:where(.ops-blueprint-host) .ops-hotspot-point i {
    width: 4px; height: 4px; background: currentColor; border-radius: 50%;
}

:where(.ops-blueprint-host) .ops-hotspot:is(:hover, :focus-visible, .is-active) .ops-hotspot-point {
    background: #0a2a37; box-shadow: 0 0 0 6px rgba(2, 20, 30, .65), 0 0 0 7px currentColor, 0 0 24px currentColor;
}

:where(.ops-blueprint-host) .ops-hotspot.is-pinned .ops-hotspot-point {
    background: currentColor;
}

:where(.ops-blueprint-host) .ops-hotspot.is-pinned .ops-hotspot-point i {
    background: #021520;
}

:where(.ops-blueprint-host) .ops-connections {
    position: absolute; z-index: 2; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; pointer-events: none;
}

:where(.ops-blueprint-host) .ops-connection {
    fill: none; stroke: var(--ops-tone, #7dd3fc); stroke-width: 1; stroke-linejoin: round; stroke-linecap: round; opacity: .30; vector-effect: non-scaling-stroke; transition: opacity .14s ease, stroke-width .14s ease;
}

:where(.ops-blueprint-host) .ops-connection[data-tone="gold"] {
    --ops-tone: #edc061;
}

:where(.ops-blueprint-host) .ops-connection[data-tone="green"] {
    --ops-tone: #9beaab;
}

:where(.ops-blueprint-host) .ops-connection[data-tone="blue"] {
    --ops-tone: #7dd3fc;
}

:where(.ops-blueprint-host) .ops-connection.evidence {
    stroke-dasharray: 4 5; opacity: .5;
}

:where(.ops-blueprint-host) .ops-diagram.has-inspection .ops-connection {
    opacity: .08;
}

:where(.ops-blueprint-host) .ops-diagram .ops-connection.is-active {
    opacity: .93; stroke-width: 1.7;
}

:where(.ops-blueprint-host) .ops-map-footer {
    display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 22px; align-items: center; padding: 12px 21px; border-top: 1px solid var(--ops-border); background: #061b28;
}

:where(.ops-blueprint-host) .ops-map-footer > span {
    font-size: 8px; color: var(--ops-blue); font-weight: 750; letter-spacing: .075em;
}

:where(.ops-blueprint-host) .ops-map-footer p {
    margin: 0; color: var(--ops-copy); font-size: 9px;
}

.ops-inspector {
    position: fixed; z-index: 1080; top: 0; left: 0; width: 360px; max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px); padding: 0 16px 10px; overflow-y: auto; overscroll-behavior: contain;
    border: 1px solid var(--ops-tone); border-radius: 10px; background: rgba(5, 24, 37, .985);
    box-shadow: 0 18px 56px rgba(0, 6, 15, .65), inset 0 2px 0 var(--ops-tone);
    color-scheme: dark; outline: none;
}

:where(.ops-inspector) .ops-inspector-toolbar {
    position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -5px 12px 0; padding: 8px 0 6px; background: #051825; border-bottom: 1px solid var(--ops-border);
}

:where(.ops-inspector) .ops-inspector-toolbar > span {
    color: var(--ops-muted); font-size: 8px; font-weight: 750; letter-spacing: .08em;
}

:where(.ops-inspector) .ops-inspector-toolbar button {
    width: 30px; height: 30px; flex: 0 0 30px; padding: 0; border: 1px solid var(--ops-border); border-radius: 5px; background: #0c2839; color: var(--ops-text); font-size: 21px; line-height: 1;
}

:where(.ops-inspector) .ops-inspector-toolbar button:hover {
    border-color: var(--ops-tone);
}

:where(.ops-inspector) .ops-inspector-kicker {
    color: var(--ops-tone); font-size: 8px; font-weight: 750; letter-spacing: .09em;
}

.ops-inspector h3 {
    margin: 5px 0; color: var(--ops-text); font-size: 18px; font-weight: 650; line-height: 1.25; letter-spacing: -.02em;
}

:where(.ops-inspector) .ops-inspector-lead {
    color: var(--ops-copy); font-size: 11px; margin: 0 0 12px;
}

:where(.ops-inspector) .ops-inspector-facts {
    margin: 0;
}

:where(.ops-inspector) .ops-inspector-facts > div {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; gap: 12px; padding: 9px 0; border-top: 1px solid var(--ops-border);
}

:where(.ops-inspector) .ops-inspector-facts dt {
    color: var(--ops-muted); font-size: 10px; font-weight: 500; overflow-wrap: anywhere;
}

:where(.ops-inspector) .ops-inspector-facts dd {
    margin: 0; color: var(--ops-text); font-size: 11px; font-weight: 650; text-align: right; overflow-wrap: anywhere;
}

:where(.ops-inspector) .ops-inspector-note {
    padding: 10px 11px; margin: 9px 0 11px; border-left: 2px solid var(--ops-tone); border-radius: 0 4px 4px 0; background: #0a2332; color: var(--ops-copy); font-size: 10px; line-height: 1.6;
}

:where(.ops-inspector) .ops-inspector-links {
    display: grid; gap: 6px;
}

:where(.ops-inspector) .ops-inspector-links a {
    display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 11px; min-height: 34px; border: 1px solid var(--ops-border); border-radius: 5px; background: #0a2939; color: var(--ops-tone); font-size: 10px; font-weight: 650; text-decoration: none;
}

:where(.ops-inspector) .ops-inspector-links a:hover {
    border-color: var(--ops-tone); background: #103445;
}

:where(.ops-inspector) .ops-inspector-hint {
    margin-top: 9px; color: var(--ops-muted); font-size: 8px; line-height: 1.5;
}

:where(.ops-blueprint-host) .ops-fallback-links {
    display: flex; flex-wrap: wrap; gap: 9px; padding: 16px;
}

:where(.ops-blueprint-host) .ops-fallback-links p {
    flex-basis: 100%; color: var(--ops-copy); font-size: 11px;
}

:where(.ops-blueprint-host) .ops-fallback-links a {
    padding: 8px 12px; border: 1px solid var(--ops-border); border-radius: 5px; font-size: 11px;
}

@container ops-blueprint (max-width: 1050px) {
    :where(.ops-blueprint-host) .ops-branch {
        grid-template-columns: 25px minmax(0, 1fr); gap: 7px; padding: 10px;
    }
    
    :where(.ops-blueprint-host) .ops-branch-code {
        width: 25px; height: 28px; font-size: 10px;
    }
    
    :where(.ops-blueprint-host) .ops-branch-copy strong {
        font-size: 11px;
    }
    
    :where(.ops-blueprint-host) .ops-branch-open {
        display: none;
    }
    
    :where(.ops-blueprint-host) .ops-map-footer {
        grid-template-columns: minmax(0, 1fr); gap: 4px;
    }
}

@container ops-blueprint (max-width: 780px) {
    :where(.ops-blueprint-host) .ops-diagram {
        grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; padding: 16px 18px 18px;
            grid-template-areas: "art art" "pumps storage" "agitator sensors" "maintenance assurance" "valves flowmeters" "processing processing" "accounting reporting";
    }
    
    :where(.ops-blueprint-host) .ops-art {
        /* Keep the established full-width artwork at the compact breakpoint. */
        width: auto; max-width: none; justify-self: stretch;
        margin: 0 -17px 12px;
    }
    
    :where(.ops-blueprint-host) .ops-branch {
        min-height: 66px; padding: 10px 12px; grid-template-columns: 28px minmax(0, 1fr);
    }
    
    :where(.ops-blueprint-host) .ops-branch-code {
        width: 28px; height: 30px;
    }
    
    :where(.ops-blueprint-host) .ops-art figcaption {
        font-size: 9px;
    }
    
    :where(.ops-blueprint-host) .ops-connection:not(.is-active) {
        opacity: 0;
    }
    
    :where(.ops-blueprint-host) .ops-diagram.has-inspection .ops-connection:not(.is-active) {
        opacity: 0;
    }
    
    :where(.ops-blueprint-host) .ops-hotspot {
        min-width: 28px; min-height: 28px;
    }
    
    :where(.ops-blueprint-host) .ops-hotspot-point {
        width: 13px; height: 13px;
    }
    
    :where(.ops-blueprint-host) .ops-map-guide {
        padding: 10px 16px 0;
    }
}

@container ops-blueprint (max-width: 440px) {
    :where(.ops-blueprint-host) .ops-diagram {
        column-gap: 9px;
    }
    
    :where(.ops-blueprint-host) .ops-branch {
        padding: 9px; gap: 6px; grid-template-columns: 22px minmax(0, 1fr);
    }
    
    :where(.ops-blueprint-host) .ops-branch-code {
        width: 22px; height: 25px; font-size: 9px;
    }
    
    :where(.ops-blueprint-host) .ops-branch-copy strong {
        font-size: 10px;
    }
    
    :where(.ops-blueprint-host) .ops-branch-copy small {
        font-size: 9px;
    }
    
    :where(.ops-blueprint-host) .ops-map-footer {
        padding: 12px 15px;
    }
}

/* Integrated evidence path. Only the revised partial opts into this layout;
   the established blueprint remains a usable fallback for older markup. */
:where(.ops-blueprint-host--flow) .ops-diagram--flow {
    /* Connector routing reads these modes; they follow available panel width. */
    --ops-flow-mode: beside;
    --ops-equipment-mode: surround;
    --ops-evidence-mode: stacked;
    /* Fill the existing panel; keep the size cap on the tank artwork alone.
       Equipment labels and evidence cards use the available side space. */
    width: 100%; max-width: none; margin-inline: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr)) clamp(310px, 26cqi, 360px);
    grid-template-areas:
        "storage agitator sensors assurance path"
        "art art art art path"
        "pumps maintenance valves flowmeters path";
    grid-template-rows: auto auto auto;
    gap: 14px 16px;
    padding: 14px 18px 18px;
    align-items: center;
}

:where(.ops-blueprint-host--flow) .ops-art {
    /* Retain the accepted tank scale while the surrounding labels spread out. */
    width: 100%; max-width: 850px; margin: 0;
    align-self: center; justify-self: center;
}

:where(.ops-blueprint-host--flow) .ops-art figcaption {
    margin: 6px 6px 0; gap: 3px 6px; font-size: 9px;
}

:where(.ops-blueprint-host--flow) .ops-equipment-branch {
    grid-template-columns: 26px minmax(0, 1fr); gap: 10px;
    min-height: 54px; height: 100%; padding: 8px 12px;
}

:where(.ops-blueprint-host--flow) .ops-equipment-branch .ops-branch-code {
    width: 26px; height: 28px; font-size: 10px;
}

:where(.ops-blueprint-host--flow) .ops-equipment-branch .ops-branch-copy strong {
    font-size: 12px; line-height: 1.35;
}

:where(.ops-blueprint-host--flow) .ops-equipment-branch .ops-branch-copy small {
    font-size: 10px; line-height: 1.4; margin-top: 3px;
}

:where(.ops-blueprint-host--flow) .ops-equipment-branch .ops-branch-open {
    display: none;
}

:where(.ops-blueprint-host--flow) .ops-evidence-path {
    position: relative; z-index: 3; grid-area: path;
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px;
    align-self: center; min-width: 0; padding: 0 0 0 16px; margin: 0;
}

:where(.ops-blueprint-host--flow) .ops-evidence-heading {
    min-width: 0; margin: 0; padding: 0 2px 1px;
}

:where(.ops-blueprint-host--flow) .ops-evidence-heading > span {
    display: block; color: var(--ops-green); font-size: 9px;
    font-weight: 750; letter-spacing: .10em;
}

:where(.ops-blueprint-host--flow) .ops-evidence-heading h3 {
    margin: 5px 0; color: var(--ops-text); font-size: 14px;
    font-weight: 650; line-height: 1.35; overflow-wrap: anywhere;
}

:where(.ops-blueprint-host--flow) .ops-evidence-heading p {
    margin: 0; color: var(--ops-copy); font-size: 10px;
    line-height: 1.4; overflow-wrap: anywhere;
}

:where(.ops-blueprint-host--flow) .ops-record-card {
    position: relative; display: flex; flex-direction: column;
    min-width: 0; margin: 0;
    border: 1px solid var(--ops-border); border-left: 2px solid var(--ops-tone);
    border-radius: 6px;
    background: linear-gradient(120deg, #082733, #051c29 78%);
    box-shadow: inset 0 1px 0 rgba(147, 219, 236, .05);
    transition: border-color .14s ease, box-shadow .14s ease;
}

:where(.ops-blueprint-host--flow) .ops-record-card[data-tone="gold"] {
    background: linear-gradient(120deg, #17292b, #071d29 78%);
}

:where(.ops-blueprint-host--flow) .ops-record-card:focus-within,
:where(.ops-blueprint-host--flow) .ops-record-card:has(.is-active) {
    border-color: var(--ops-tone);
    box-shadow: 0 0 18px rgba(93, 189, 216, .07);
}

:where(.ops-blueprint-host--flow) .ops-record-card .ops-record-inspect {
    grid-area: auto; grid-template-columns: 34px minmax(0, 1fr) 10px;
    gap: 12px; min-height: 58px; padding: 10px 14px;
    border: 0; border-radius: 5px 5px 0 0; background: transparent;
    box-shadow: none;
}

:where(.ops-blueprint-host--flow) .ops-record-inspect:is(:hover, :focus-visible, .is-active) {
    background: rgba(67, 149, 171, .08);
}

:where(.ops-blueprint-host--flow) .ops-record-inspect::after {
    display: none;
}

:where(.ops-blueprint-host--flow) .ops-record-inspect .ops-record-symbol {
    width: 34px; height: 36px; padding: 0; border: 0;
    background: transparent; color: var(--ops-tone);
}

:where(.ops-blueprint-host--flow) .ops-record-symbol svg {
    display: block; width: 32px; height: 32px;
}

:where(.ops-blueprint-host--flow) .ops-record-inspect .ops-branch-open {
    display: block; font-size: 13px; opacity: .7;
}

:where(.ops-blueprint-host--flow) .ops-record-inspect .ops-branch-copy strong {
    font-size: 13px; line-height: 1.35; font-weight: 650;
}

:where(.ops-blueprint-host--flow) .ops-record-inspect .ops-branch-copy small {
    font-size: 9px; line-height: 1.4;
}

:where(.ops-blueprint-host--flow) .ops-record-inspect .ops-branch-copy .ops-record-stage {
    margin: 0 0 5px; color: var(--ops-tone); font-size: 9px;
    font-weight: 750; letter-spacing: .075em;
}

:where(.ops-blueprint-host--flow) .ops-record-card:not(.ops-record-card--processing) .ops-branch-copy > small:last-child {
    display: none;
}

:where(.ops-blueprint-host--flow) .ops-record-metrics {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px; margin: 0; padding: 0 14px 11px;
}

:where(.ops-blueprint-host--flow) .ops-record-metrics > div {
    min-width: 0; padding-top: 8px; border-top: 1px solid var(--ops-border);
}

:where(.ops-blueprint-host--flow) .ops-record-metrics dt {
    margin: 0; color: var(--ops-copy); font-size: 9px; font-weight: 500;
    line-height: 1.45; overflow-wrap: anywhere;
}

:where(.ops-blueprint-host--flow) .ops-record-metrics dd {
    margin: 4px 0 0; color: var(--ops-text); font-size: 16px; font-weight: 650;
    font-variant-numeric: tabular-nums; line-height: 1.3; overflow-wrap: anywhere;
}

:where(.ops-blueprint-host--flow) .ops-record-metrics dd small {
    color: var(--ops-copy); font-size: 9px; font-weight: 400;
}

:where(.ops-blueprint-host--flow) .ops-record-description {
    margin: 0; padding: 0 14px 11px; color: var(--ops-copy);
    font-size: 10px; line-height: 1.5; overflow-wrap: anywhere;
}

:where(.ops-blueprint-host--flow) .ops-record-card--reporting .ops-record-description {
    display: none;
}

:where(.ops-blueprint-host--flow) .ops-record-card .ops-record-source {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    min-height: 36px; margin-top: auto; padding: 8px 14px;
    border-top: 1px solid var(--ops-border); border-radius: 0 0 5px 5px;
    color: var(--ops-tone); background: rgba(3, 20, 30, .38);
    font-size: 10px; font-weight: 700; line-height: 1.4;
    text-decoration: none; overflow-wrap: anywhere;
}

:where(.ops-blueprint-host--flow) .ops-record-source > span:last-child {
    flex: 0 0 auto; font-size: 15px; font-weight: 400;
}

:where(.ops-blueprint-host--flow) .ops-record-source:hover {
    color: #effbff; background: rgba(43, 124, 145, .16);
}

:where(.ops-blueprint-host--flow) .ops-record-card :is(button, a):focus-visible {
    outline-offset: -3px;
}

/* At narrower panel widths, expose the evidence path before the equipment list.
   Active equipment connectors use the outer rails in the companion script. */
@container ops-blueprint (max-width: 1100px) {
    :where(.ops-blueprint-host--flow) .ops-diagram--flow {
        --ops-flow-mode: below;
        --ops-equipment-mode: list;
        --ops-evidence-mode: row;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-areas: "art art art art" "path path path path"
            "storage agitator sensors assurance" "pumps maintenance valves flowmeters";
        grid-template-rows: auto; gap: 16px 12px;
    }

    :where(.ops-blueprint-host--flow) .ops-art {
        width: 88%; max-width: 850px;
    }

    :where(.ops-blueprint-host--flow) .ops-evidence-path {
        grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, .85fr);
        gap: 12px; padding: 0; align-self: stretch; align-items: stretch;
    }

    :where(.ops-blueprint-host--flow) .ops-evidence-heading {
        grid-column: 1 / -1; display: flex; flex-wrap: wrap;
        align-items: baseline; gap: 4px 12px; padding: 0;
    }

    :where(.ops-blueprint-host--flow) .ops-evidence-heading h3 {
        margin: 0; font-size: 14px;
    }

    :where(.ops-blueprint-host--flow) .ops-evidence-heading p {
        margin-left: auto;
    }

    :where(.ops-blueprint-host--flow) .ops-record-card--reporting .ops-record-description {
        display: block;
    }

    :where(.ops-blueprint-host--flow) .ops-diagram .ops-connection:not(.evidence):not(.is-active) {
        opacity: 0;
    }
}

@container ops-blueprint (max-width: 780px) {
    :where(.ops-blueprint-host--flow) .ops-diagram--flow {
        --ops-evidence-mode: wrapped;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas: "art art" "path path" "storage agitator"
            "sensors assurance" "pumps maintenance" "valves flowmeters";
        gap: 14px 12px;
    }

    :where(.ops-blueprint-host--flow) .ops-art {
        width: auto; max-width: none; justify-self: stretch; margin: 0 -17px;
    }

    :where(.ops-blueprint-host--flow) .ops-evidence-path {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    :where(.ops-blueprint-host--flow) .ops-record-card--processing {
        grid-column: 1 / -1;
    }

    :where(.ops-blueprint-host--flow) .ops-record-card .ops-record-source {
        min-height: 40px;
    }

    :where(.ops-blueprint-host--flow) .ops-diagram .ops-connection.evidence {
        opacity: .5;
    }

    :where(.ops-blueprint-host--flow) .ops-diagram.has-inspection .ops-connection.evidence:not(.is-active) {
        opacity: .18;
    }

    :where(.ops-blueprint-host--flow) .ops-diagram .ops-connection.evidence.is-active {
        opacity: .93;
    }
}

@container ops-blueprint (max-width: 560px) {
    :where(.ops-blueprint-host--flow) .ops-diagram--flow {
        --ops-evidence-mode: stacked;
    }

    :where(.ops-blueprint-host--flow) .ops-evidence-path {
        grid-template-columns: minmax(0, 1fr); gap: 12px;
    }

    :where(.ops-blueprint-host--flow) .ops-evidence-heading {
        display: block; padding-bottom: 2px;
    }

    :where(.ops-blueprint-host--flow) .ops-evidence-heading h3 {
        margin: 4px 0;
    }

    :where(.ops-blueprint-host--flow) .ops-evidence-heading p {
        margin: 0;
    }

    :where(.ops-blueprint-host--flow) .ops-record-card--reporting .ops-record-description {
        display: none;
    }

    :where(.ops-blueprint-host--flow) .ops-equipment-branch {
        grid-template-columns: 22px minmax(0, 1fr); gap: 8px; padding: 9px 10px;
    }

    :where(.ops-blueprint-host--flow) .ops-equipment-branch .ops-branch-code {
        width: 22px; height: 25px; font-size: 9px;
    }

    :where(.ops-blueprint-host--flow) .ops-equipment-branch .ops-branch-copy strong {
        font-size: 11px;
    }
}

@media (max-width: 560px) {
    .ops-inspector {
        max-height: 58dvh; width: calc(100vw - 24px); left: 12px; top: auto; bottom: 12px;
    }

    /* The companion script may place a shorter panel above or below the
       selected equipment. Keep the bottom sheet as the unpositioned fallback. */
    .ops-inspector[data-ops-positioned="true"] {
        bottom: auto;
    }
    
    :where(.ops-inspector) .ops-inspector-toolbar button {
        width: 38px; height: 36px; flex-basis: 38px;
    }
    
    :where(.ops-inspector) .ops-inspector-links a {
        min-height: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ops-blueprint-host *,
    .ops-inspector * {
        transition: none !important; scroll-behavior: auto !important; animation: none !important;
    }
}

@media print {
    :where(.ops-blueprint-host) .ops-blueprint {
        position: relative; min-width: 0; background: #021520; overflow: hidden;
    }
    
    .ops-inspector,
    :where(.ops-blueprint-host) .ops-map-reset,
    :where(.ops-blueprint-host) .ops-hotspot,
    :where(.ops-blueprint-host) .ops-connections {
        display: none !important;
    }
}

:where(.ops-blueprint-host) .ops-diagram.image-missing .ops-hotspot {
    display: none;
}

/* Named containment is local to the visualization, never the page container. */
.ops-blueprint-host {
    display: block;
    width: 100%;
    min-width: 0;
    container: ops-blueprint / inline-size;
}
:where(.ops-blueprint-host) .ops-map-guide {
    padding-top: 12px;
    padding-bottom: 0;
}
:where(.ops-blueprint-host) .ops-map-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px 14px;
    min-height: 25px;
}
/* Reserve the reset control's space so hovering cannot move image anchors. */
.ops-blueprint-host .ops-map-reset[hidden] {
    display: inline-block !important;
    visibility: hidden;
    pointer-events: none;
}
