/* "Your business, one view": an isometric model of a distributor's building wired to its operating view.
   Markup comes from tools/build_ov_scene.py; behaviour is in assets/ov-scene.js. Sits on a black section.
   Only opacity and transform are animated, except the one connector that draws itself on (stroke-dashoffset). */
.ov{ --ln:rgba(255,255,255,.18); --amb:#D9921A; position:relative; margin-top:clamp(2rem, 4vw, 3rem); border:1px solid var(--ln); color:#fff; }
.ov-bar{ padding:.75rem 1rem; border-bottom:1px solid var(--ln); font-weight:500; font-size:.9375rem; color:#fff; }
.ov-body{ position:relative; display:grid; grid-template-columns:minmax(0,1fr); }
.ov-scene{ order:2; min-width:0; padding:clamp(.75rem, 1.6vw, 1.25rem) clamp(.5rem, 1vw, .75rem); }
.ov-dash{ order:1; min-width:0; border-bottom:1px solid var(--ln); }
.ov-wires{ display:none; }
@media (min-width:900px){
  /* the building, a narrow gutter that carries the links, then the panel */
  .ov-body{ grid-template-columns:minmax(0,13fr) 3.25rem minmax(0,7fr); }
  .ov-scene{ order:1; align-self:center; }
  .ov-dash{ order:2; grid-column:3; border-bottom:0; border-left:1px solid var(--ln); }
  .ov-wires{ display:block; position:absolute; inset:0; width:100%; height:100%; overflow:visible; pointer-events:none; }
}

/* ---------- the drawing ---------- */
.ov-stage{ position:relative; }
.ov-svg{ display:block; width:100%; height:auto; overflow:visible; }
.ov-svg path, .ov-svg circle{ vector-effect:non-scaling-stroke; stroke-width:1; stroke-linejoin:round; stroke-linecap:round; fill:none; }
.ov-svg .fl{ fill:#040404; stroke:rgba(255,255,255,.34); }
.ov-svg .g{ stroke:rgba(255,255,255,.09); }
.ov-svg .g2{ stroke:rgba(255,255,255,.22); }
.ov-svg .w{ stroke:rgba(255,255,255,.26); }
.ov-svg .f{ fill:#070707; stroke:rgba(255,255,255,.72); }
.ov-svg .l1{ stroke:rgba(255,255,255,.72); }
.ov-svg .l2{ stroke:rgba(255,255,255,.34); }
.ov-svg .l3{ stroke:rgba(255,255,255,.2); }
.ov-svg .pp{ stroke:rgba(255,255,255,.55); }
.ov-svg .mk{ stroke:rgba(255,255,255,.26); stroke-dasharray:3 3; }
.ov-svg .mk2{ stroke:rgba(255,255,255,.2); }
.ov-svg .pw{ fill:rgba(255,255,255,.025); stroke:rgba(255,255,255,.45); }
.ov-svg .bx{ fill:#0d0d0d; stroke:rgba(255,255,255,.4); }
.ov-svg .dr{ fill:rgba(255,255,255,.03); stroke:rgba(255,255,255,.72); }
.ov-svg .ld{ stroke:rgba(255,255,255,.5); stroke-dasharray:2 3; }
.ov-svg .ld-d{ fill:#fff; stroke:none; }
/* vehicles sit at their dock door; things that move are placed by the script */
.ov-veh{ transform:translate(var(--x), var(--y)); }
/* the truck that stays too long: the same door and truck again in amber, faded in over the white ones */
.ov-late{ opacity:0; transition:opacity .6s ease; }
.ov-late .f, .ov-late .dr, .ov-late .l2, .ov-late .l3, .ov-late .mk{ stroke:var(--amb); }
.ov-late .dr{ fill:rgba(217,146,26,.16); }
.is-late .ov-late{ opacity:1; }
/* the first box truck leaves on time */
.ov-t1{ transition:transform 2.6s cubic-bezier(.5,0,.75,.4), opacity 1.2s ease 1.4s; }
.is-go .ov-t1, .is-done .ov-t1{ transform:translate(calc(var(--x) + var(--gx)), calc(var(--y) + var(--gy))); opacity:0; }

/* zone labels: a numbered square on the scene with the zone's name beside it */
.ov-z, .ov-kb{ display:inline-flex; align-items:center; gap:.4375rem; color:#fff; font-size:.8125rem; font-weight:500; line-height:1.2; white-space:nowrap; }
/* zones without a number of their own are named but are not buttons */
.ov-zp{ color:#a8a8a8; } .ov-zp .ov-zn{ border-color:rgba(255,255,255,.5); }
.ov-z{ position:absolute; left:var(--x); top:var(--y); transform:translate(-.625rem, -50%); padding:.1875rem .25rem .1875rem 0; }
.ov-z.rt{ flex-direction:row-reverse; transform:translate(calc(-100% + .625rem), -50%); padding:.1875rem 0 .1875rem .25rem; }
.ov-zn{ flex:none; display:grid; place-items:center; width:1.25rem; height:1.25rem; border:1px solid #fff; background:#000; font-size:.75rem; font-variant-numeric:tabular-nums; }
button.ov-z:hover .ov-zn, button.ov-kb:hover .ov-zn, .ov-z[aria-pressed="true"] .ov-zn, .ov-kb[aria-pressed="true"] .ov-zn{ background:#fff; color:#000; }
.ov-z:active, .ov-kb:active{ opacity:.6; }
.ov-z:focus-visible, .ov-kb:focus-visible{ outline:2px solid var(--amb); outline-offset:3px; }
.is-late .ov-z[data-z="ship"] .ov-zn, .is-late .ov-kb[data-z="ship"] .ov-zn{ border-color:var(--amb); }
.ov-zt{ padding:0; }
.ov-key{ display:none; }
/* the row's zone number sits inside the row when the layout stacks; on wide screens it is in the gutter instead */
.ov-rn{ display:inline-grid; place-items:center; width:1.125rem; height:1.125rem; margin-right:.5rem; border:1px solid rgba(255,255,255,.6); font-size:.6875rem; color:#fff; font-variant-numeric:tabular-nums; vertical-align:-.1875rem; }
@media (min-width:900px){ .ov-rn{ display:none; } }
/* below wide screens there is no room for the names beside the building: each number sits on its own zone,
   the leaders go, and the names are listed in a key under the drawing */
@media (max-width:1359px){
  .ov-zt{ display:none; }
  .ov-z, .ov-z.rt{ left:var(--ax); top:var(--ay); transform:translate(-50%, -50%); padding:.25rem; }
  .ov-svg .ld, .ov-svg .ld-d{ display:none; }
  .ov-key{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:.125rem 1rem; margin-top:1rem; padding-inline:.5rem; }
  .ov-kb{ padding:.375rem 0; }
}
@media (min-width:900px) and (max-width:1359px){ .ov-key{ grid-template-columns:repeat(5, max-content); justify-content:space-between; font-size:.75rem; } .ov-key .ov-kb{ font-size:.75rem; gap:.375rem; } }

/* ---------- the operating view ---------- */
.ov-dh{ padding:.75rem 1rem .5rem; font-size:.8125rem; font-weight:500; color:#929292; }
.ov-m + .ov-dh{ border-top:1px solid var(--ln); }
.ov-m{ display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"k sp" "v sp" "n n"; align-items:center; column-gap:.75rem; width:100%; padding:.5rem 1rem .5625rem; border-top:1px solid var(--ln); text-align:left; color:#fff; }
.ov-m:hover, .ov-m[aria-pressed="true"]{ background:#111; }
.ov-m:active{ background:#1b1b1b; }
.ov-m:focus-visible{ outline:2px solid var(--amb); outline-offset:-2px; }
.ov-k{ grid-area:k; font-size:.8125rem; font-weight:500; line-height:1.3; color:#c8c8c8; }
.ov-v{ grid-area:v; position:relative; margin-top:.125rem; font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:clamp(1.1875rem, 1.6vw, 1.375rem); line-height:1.15; letter-spacing:-.02em; font-variant-numeric:tabular-nums; }
.ov-v small{ margin-left:.4375rem; font-family:Switzer, Arial, sans-serif; font-size:.75rem; letter-spacing:0; color:#929292; }
.ov-sp{ grid-area:sp; width:clamp(5.5rem, 8vw, 6.75rem); aspect-ratio:108 / 30; height:auto; overflow:visible; }
.ov-sp .sp-band{ fill:rgba(255,255,255,.09); }
.ov-sp .sp-l{ fill:none; stroke:#fff; stroke-width:1.5; stroke-linejoin:round; stroke-linecap:round; vector-effect:non-scaling-stroke; }
.ov-sp .sp-e{ fill:#fff; }
.ov-sp .sp-amb{ fill:var(--amb); }
/* the number that drifts: its two values, two line endings and its note cross-fade */
.ov-va, .ov-vb, .sp-a, .sp-b, .ov-note{ transition:opacity .5s ease; }
.ov-vb{ position:absolute; left:0; top:0; color:var(--amb); opacity:0; }
.sp-b{ opacity:0; }
.ov-note{ grid-area:n; margin-top:.1875rem; font-size:.75rem; font-weight:500; line-height:1.3; color:var(--amb); opacity:0; }
.is-drift .ov-va, .is-drift .sp-a{ opacity:0; }
.is-drift .ov-vb, .is-drift .sp-b, .is-drift .ov-note{ opacity:1; }
/* the drill-down under the numbers, three lines that arrive one after another */
.ov-drill{ display:grid; gap:.25rem; padding:.75rem 1rem 1rem; border-top:1px solid var(--ln); }
.ov-drill p{ font-size:.875rem; line-height:1.4; opacity:0; transform:translateY(6px); transition:opacity .45s ease, transform .6s cubic-bezier(.16,1,.3,1); }
.ov-d1{ font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:.8125rem; }
.ov-d2{ color:#c8c8c8; }
.ov-d3{ margin-top:.5rem; }
.ov-d3 span{ display:inline-block; padding:.3125rem .625rem; border:1px solid var(--amb); color:var(--amb); font-size:.8125rem; font-weight:500; line-height:1.2; }
.is-d1 .ov-d1, .is-d2 .ov-d2, .is-d3 .ov-d3{ opacity:1; transform:none; }

/* ---------- the gutter (wide screens): each zone's number again, with one straight link to its row.
   The office has one number and one link that splits into three at the panel. Very faint at rest. ---------- */
.ov-gl{ fill:none; stroke:#fff; stroke-width:1; opacity:.2; transition:opacity .25s ease; }
.ov-gc rect{ fill:#000; stroke:#fff; stroke-width:1; }
.ov-gc text{ fill:#fff; font-size:12px; font-weight:500; font-variant-numeric:tabular-nums; text-anchor:middle; dominant-baseline:central; }
.ov-gc{ opacity:.55; transition:opacity .25s ease; }
/* the link for the number that drifts: an amber line drawn on over the white one (the only stroke-dashoffset in the piece) */
.ov-ga{ fill:none; stroke:var(--amb); stroke-width:1.5; stroke-dasharray:1; stroke-dashoffset:1; transition:stroke-dashoffset .9s ease; }
.is-wire .ov-ga{ stroke-dashoffset:0; }
.ov-gc-a{ opacity:0; transition:opacity .4s ease; }
.ov-gc-a rect{ stroke:var(--amb); } .ov-gc-a text{ fill:var(--amb); }
.is-wire .ov-gc-a{ opacity:1; }
.is-late .ov-z[data-z="ship"]{ color:var(--amb); }

/* ---------- tracing one number or one zone: everything else steps back ---------- */
.ov-dim{ transition:opacity .25s ease; }
.ov[data-focus] .ov-dim{ opacity:.22; }
.ov[data-focus="recv"] [data-z="recv"], .ov[data-focus="stor"] [data-z="stor"], .ov[data-focus="pick"] [data-z="pick"], .ov[data-focus="ship"] [data-z="ship"],
.ov[data-focus="will"] [data-z="will"], .ov[data-focus="office"] [data-z="office"]{ opacity:1; }
.ov[data-focus] .ov-gw{ opacity:.18; }
.ov[data-focus="recv"] .ov-gw[data-z="recv"], .ov[data-focus="stor"] .ov-gw[data-z="stor"], .ov[data-focus="pick"] .ov-gw[data-z="pick"], .ov[data-focus="ship"] .ov-gw[data-z="ship"],
.ov[data-focus="will"] .ov-gw[data-z="will"], .ov[data-focus="office"] .ov-gw[data-z="office"]{ opacity:1; }
.ov[data-focus] .ov-gw .ov-gl, .ov[data-focus] .ov-gw .ov-gc{ opacity:1; }
.ov-gw{ transition:opacity .25s ease; }

.ov-foot{ display:flex; justify-content:flex-end; min-height:2.5rem; padding:.5rem 1.125rem; border-top:1px solid var(--ln); }
.ov-replay{ font-size:.8125rem; font-weight:500; color:#929292; text-decoration:underline; text-underline-offset:.2em; opacity:0; visibility:hidden; transition:opacity .3s ease; }
.is-done .ov-replay{ opacity:1; visibility:visible; }
.ov-replay:hover{ color:#fff; }
.ov-replay:active{ opacity:.6; }
.ov-replay:focus-visible{ outline:2px solid var(--amb); outline-offset:3px; }

/* while the script rewinds to the start, nothing animates */
.ov-snap, .ov-snap *{ transition:none !important; }

@media (prefers-reduced-motion: reduce){
  .ov *, .ov *::before, .ov *::after{ transition:none !important; }
}
