.ovf-section {
  padding-block: var(--chapter-space);
  scroll-margin-top: 5rem;
  color: var(--ink);
}
.ovf-wrap { width: min(91%, 84rem); margin-inline: auto; }
.ovf-head { display: flex; gap: 1.25rem; align-items: flex-end; justify-content: space-between; margin: 0 0 1.15rem; }
.ovf-head h2 { margin: 0; font:var(--section-face); letter-spacing:var(--section-tracking); }
.ovf-figure { margin: 0; }
.ovf-full { display: block; padding: clamp(.5rem, 1.25vw, 1.12rem); background: var(--surface); border: 1px solid var(--rule); border-radius:var(--panel-radius); cursor: zoom-in; }
.ovf-full img { display: block; width: 100%; height: auto; }
.ovf-notes { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: clamp(1rem,2vw,2rem); padding-top: 1.1rem; }
.ovf-note { min-width: 0; }
.ovf-note h3 { display: flex; align-items: baseline; gap: .4rem; margin: 0 0 .26rem; font: 600 1.01rem/1.3 var(--sans, sans-serif); color: var(--ink); }
.ovf-note h3 span { font: 500 .88em var(--sans); color: var(--blue); }
.ovf-note p { margin: 0; color: var(--muted); font: 400 .97rem/1.49 var(--sans, sans-serif); }
.ovf-mobile { display: none; }
/* Match the pixel density of the paper even when the shared dialog opens on a phone. */
#architecture-dialog:has(img[src$="/paper-overview.png"]) .diagram-scroll img { width: max(100%, 108rem); min-width: 0; max-width: none; }
@media (min-width: 761px) and (max-width: 1040px) {
  .ovf-notes { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .9rem 1.45rem; }
}
@media (max-width: 760px) {
  .ovf-head { display: block; margin-bottom: .65rem; }
  .ovf-full { display: none; }
  .ovf-notes { display: block; padding: 0; }
  .ovf-note + .ovf-note { margin-top: 1.4rem; }
  .ovf-mobile { display: block; }
  .ovf-part, .ovf-timeline { box-sizing: border-box; border: 1px solid var(--rule); margin: 0 0 .65rem; background: white; }
  .ovf-part { width: 100%; height: auto; padding: .4rem; }
  .ovf-note p { font-size: 1rem; }
  .ovf-pan { width: 100%; overflow-x:auto; padding-block: .45rem; overscroll-behavior-x: contain; scrollbar-width:thin; scrollbar-color:#849da8 #edf1ed; }
  .ovf-pan:focus-visible { outline: 2px solid #8f5c28; outline-offset: -2px; }
  .ovf-pan img { display: block; width: max(100%, 61rem); max-width: none; height: auto; }
  .ovf-stops { display: flex; justify-content: space-between; gap: .3rem; padding-inline: .45rem; background: var(--mist); border-top: 1px solid var(--rule); }
  .ovf-stops[hidden] { display: none; }
  .ovf-stops button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: .35rem .15rem; min-height: 44px; background: transparent; color: #526770; font: 500 .87rem/1.2 var(--sans,sans-serif); cursor: pointer; }
  .ovf-stops button[aria-pressed="true"] { border-color: #34617a; color: #163a4a; }
}
@media (min-width: 520px) and (max-width: 760px) {
  .ovf-notes { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1.45rem 1rem; align-items: start; }
  .ovf-note:first-child { grid-column: 1 / -1; }
  .ovf-note + .ovf-note { margin: 0; }
}
.ovf-actions { display:flex; gap:1rem; align-items:center; flex-wrap:wrap; }
#ovf-command { min-height:2.75rem; border:1px solid var(--rule,#cbd5d9); border-radius:3px; padding:.45rem .8rem; font:600 .9rem/1.25 var(--sans,sans-serif); background:var(--surface,#fffefa); color:var(--ink,#183340); cursor:pointer; }
#ovf-command:hover { border-color:var(--blue,#376b86); }
#ovf-command[hidden] { display:none; }
.ovf-sheet { position:relative; display:block; aspect-ratio:2450 / 1016; overflow:hidden; background:#fff; }
.ovf-sheet > img, #ovf-reel { display:block; width:100%; height:100%; }
#ovf-reel { visibility:hidden; position:absolute; inset:0; object-fit:fill; pointer-events:none; background:var(--night,#142c38); }
.ovf-figure:is([data-ovf-state="armed"],[data-ovf-state="loading"],[data-ovf-state="playing"]) #ovf-reel { visibility:visible; }
@media(max-width:760px) {
  .ovf-actions { gap:.9rem; margin:.48rem 0 .75rem; }
  .ovf-full { display:block; margin-bottom:1rem; padding:.27rem; }
}

@media screen and (min-width: 1500px) {
  .ovf-wrap { width: min(var(--project-width, 92vw), calc(2450px + 2rem)); }
  .ovf-full { padding: clamp(.55rem, .72vw, 1rem); }
  #architecture-dialog:has(img[src$="/paper-overview.png"]) {
    width: min(96vw, calc(2450px + 2.5rem));
    max-width: 96vw;
    max-height: 94dvh;
  }
  #architecture-dialog:has(img[src$="/paper-overview.png"]) .diagram-scroll { max-height: calc(93dvh - 6rem); }
  #architecture-dialog:has(img[src$="/paper-overview.png"]) .diagram-scroll img { width: 2450px; }
}
/* The paper plate is the primary view; panel-level explanations are optional. */
.ovf-full { position:relative; }
.ovf-zoom-icon {
  position:absolute; top:calc(100% + .25rem); right:0; z-index:1; display:grid; place-items:center;
  width:2.3rem; height:2.3rem; color:var(--ink); background:var(--surface);
  border:1px solid var(--rule); border-radius:50%;
}
.ovf-zoom-icon i { width:.74rem; height:.74rem; border:1.6px solid currentColor; border-radius:50%; position:relative; margin:-.18rem 0 0 -.18rem; }
.ovf-zoom-icon i::after { content:""; position:absolute; width:.4rem; height:1.6px; top:100%; left:85%; background:currentColor; transform:rotate(45deg); transform-origin:left; }
.ovf-full:hover .ovf-zoom-icon,.ovf-full:focus-visible .ovf-zoom-icon { background:var(--mist); }
.ovf-resources { display:flex; align-items:flex-start; flex-wrap:wrap; gap:0 1.5rem; margin-top:.4rem; min-height:2.75rem; }
.ovf-resources details { margin:0; border:0; }
.ovf-resources details[open] { flex:1 0 100%; }
.ovf-resources summary,.dg-notes summary,.cite-preview summary {
  width:fit-content; padding:.5rem 0; cursor:pointer; color:var(--blue); font:550 .94rem/1.4 var(--sans);
}
.ovf-resources .ovf-notes { padding-top:.3rem; }
.ovf-resources .abstract div { padding-bottom:.5rem; }
@media screen and (min-width:1500px) and (min-aspect-ratio:21/9) {
  .ovf-wrap { width:var(--project-width); display:grid; grid-template-columns:minmax(12rem,1fr) minmax(0,min(77%,196svh,2450px)); align-items:center; gap:clamp(2rem,4vw,5.5rem); }
  .ovf-head { flex-direction:column; align-items:start; }
}
